SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-08-27 15:06:38

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

dmenu-extended

Last edited by chameleon (2014-08-27 18:32:24)

Offline

Be excellent to each other!

#2 2014-08-27 20:59:16

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: dmenu-extended

@chameleon --- have you checked this out?
I don't want to execute a setup script with root permissions (I don't trust my script audit enough)...
Desktop's looking good; what music player is that?
I'll definitely grab your .iso & have a play when I get more download allowance.
smile

Offline

#3 2014-08-27 23:30:20

spiritchaser
#! CrunchBanger
From: Temple Suspended in Void
Registered: 2013-05-14
Posts: 101

Re: dmenu-extended

@chameleon - wow nice distro there, will install, will play wink

Offline

#4 2014-08-28 00:34:45

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: dmenu-extended

Last edited by chameleon (2014-08-28 00:40:26)

Offline

#5 2014-08-28 01:45:34

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: dmenu-extended

Last edited by Alad (2014-08-28 01:47:35)

Offline

#6 2014-08-28 08:33:36

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: dmenu-extended

Last edited by Head_on_a_Stick (2014-08-28 08:57:30)

Offline

#7 2014-09-10 00:04:21

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

Offline

#8 2014-09-10 00:45:45

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: dmenu-extended

Hi and welcome to the forums. Thanks for the quote repairs (and indeed, it looks all good in shellcheck.net, bar from ` ` vs $( ) ).

A starting suggestion would be to keep things simple. Don't make a wrapper to compile or install dmenu for each distribution, but put in your README that dmenu, preferably version 4.5, is required. Similarly, have the user keep track of updates.

Should you wish to keep this functionality, I'd suggest to at least put it in a separate script.

Last edited by Alad (2014-09-10 00:47:34)

Offline

#9 2014-09-10 06:20:53

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: dmenu-extended

Offline

#10 2014-09-10 13:35:49

Resident Bot
#! Die Hard
From: The Netherlands
Registered: 2012-02-17
Posts: 638

Re: dmenu-extended

#!/bin/bash
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
	cache=$cachedir/dmenu_run
else
	cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
fi

if [ -f ~/.bash_alias ]; then
	aliases=( ~/.bash_alias )
elif [ -f ~/.zsh_aliases ]; then
	aliases=( ~/.zsh_aliases )
else
	touch ~/.bash_alias
fi

if [ ~/.bash_functions ]; then
	functions=( ~/.bash_functions )
elif [ ~/.zsh_functions ]; then
	functions=( ~/.zsh_functions )
else
	touch ~/.bash_functions
fi

source $aliases

cmd=`(
	IFS=:
 if stest -dqr -n "$cache" $PATH || stest -fqr -n "$cache" "$aliases" || stest -fqr -n "$cache" "$functions"; then
          (
            stest -flx $PATH
	    	alias | awk -F '[ =]' '{print $2}'
	    	compgen -A function
          ) | sort -u | tee "$cache" | dmenu "$@"
	else
		dmenu "$@" < "$cache"
	fi
)`

if [ -f ~/.bash_alias ] || [ -f ~/.zsh_aliases ]; then
	if [ ! -z "$(grep '^alias' $aliases|cut -d'=' -f1|grep $cmd)" ] || [ -z $(which $cmd) ]; then
		echo -e "source $aliases \n $cmd" | bash -O expand_aliases &
	else
		exec $cmd &
	fi
fi

Troll = not a fanatic
slave of #!  and arch

Offline

#11 2014-09-11 01:14:33

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

Hello again,
I have updated dmenu-extended so root permissions are not necessary.
The setup.sh script has gone and its non-root functionality has been moved elsewhere. The user is advised to install dmenu themselves. The file dmenu_extended.py can now be run directly to open the menu, meaning it is not necessary to install at all. Both local and global installation instructions have been added to the README.md file.
The menu settings plugin no longer handles updates of dmenu-extended (which required executing downloaded scripts as root) and has been integrated into dmenu_extended.py so it is not necessary to install separately.

Thank you to Alad and Head_on_a_Stick for your constructive criticisms. I believe the project as a whole has been greatly improved based on your suggestions.

Offline

#12 2014-09-11 01:25:19

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

Code listing removed for brevity

Last edited by markjones112358 (2014-09-11 01:51:59)

Offline

#13 2014-09-11 01:51:18

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

@Resident Bot
I have updated dmenu-extended to allow adding URL alias commands like so:

+http://youtube.com#Youtube

It will use the browser defined in your configuration file (firefox by default) to open the URL. If you wish to tweak how it is displayed in the menu you can edit it directly in the configuration file. Remember to rebuild your cache after editing the alias.

Hopefully this helps or at least answers your question.

Offline

#14 2014-09-11 09:02:39

Resident Bot
#! Die Hard
From: The Netherlands
Registered: 2012-02-17
Posts: 638

Re: dmenu-extended

Thanks for adding the url addition.
I am not sure abt the # alias bit and converting some of my bash alias's
I tried  translating this bash alias to open my cd
alias ejectcd='eject /dev/sr0'
to this but it didn't work
+'eject /dev/sr0'#ejectcd


Troll = not a fanatic
slave of #!  and arch

Offline

#15 2014-09-11 09:06:41

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: dmenu-extended

Offline

#16 2014-09-11 09:18:10

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

+eject /dev/sr0#ejectcd

Offline

#17 2014-09-11 09:21:34

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

@Alad
Hey thanks very much!

Offline

#18 2014-09-11 09:25:00

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: dmenu-extended

Works nicely so far, a few notes..

- When editing menu preferences, nothing happens as xdg-open had no mimetype registered to .json. As them's the breaks (I certainly wouldn't suggest replacing xdg-open), perhaps consider adding an error message if xdg-open exits with status 4 ("no associations found"), and inform the user of the missing association (through xdg-mime query filetype <file>).

- The update function hangs for me; traceback:

Traceback (most recent call last):
  File "/usr/bin/dmenu_extended_run", line 7, in <module>
    dmenu_extended.run()
  File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 936, in run
    plugin_hook.run(out[len(pluginTitle):])
  File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 855, in run
    self.update_plugins()
  File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 804, in update_plugins
    here_sha = self.command_output("sha1sum " + path_plugins + '/' + here + '.py')[0].split()[0]
  File "/usr/lib/python3.4/site-packages/dmenu_extended.py", line 451, in command_output
    tmp = subprocess.check_output(command)
  File "/usr/lib/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['sha1sum', '/home/alad/.config/dmenu-extended/plugins/dmenuExtended_settings.py']' returned non-zero exit status 1

Offline

#19 2014-09-11 11:01:46

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

@Alad
Both of those issues should be fixed now. I've tested with gnome-open but not with xdg-open so let me know if it's still a problem and I'll sort it out.
Thanks for trying the menu.

Offline

#20 2014-09-11 11:37:31

Resident Bot
#! Die Hard
From: The Netherlands
Registered: 2012-02-17
Posts: 638

Re: dmenu-extended

Last edited by Resident Bot (2014-09-11 11:55:34)


Troll = not a fanatic
slave of #!  and arch

Offline

#21 2014-09-12 01:02:53

markjones112358
New Member
Registered: 2014-09-09
Posts: 8

Re: dmenu-extended

firefox www.google.com

Offline

#22 2014-09-12 06:48:04

Resident Bot
#! Die Hard
From: The Netherlands
Registered: 2012-02-17
Posts: 638

Re: dmenu-extended

Last edited by Resident Bot (2014-11-15 10:48:35)


Troll = not a fanatic
slave of #!  and arch

Offline

#23 2014-09-12 10:35:35

chameleon
UK #! Guy
From: Luxembourg
Registered: 2009-01-13
Posts: 719
Website

Re: dmenu-extended

@markjones112358
Thanks for the dmenu-extended tweaks  cool

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo