You are not logged in.
Wow. That's very clever, bordering on mind boggling.
I'm not near a machine, but will have a play tomorrow.
Offline
^
Here is an alternative version. It avoids the python code and gtk dependency.
It also keeps all the code in one file.
#!/bin/bash
# In case jgmenu is already running in stay-alive mode
killall jgmenu >/dev/null
printf "%b" \
'Copy,cat /tmp/misko | xclip -selection clipboard,gtk-copy\n
Google Search,q=$(cat /tmp/misko | tr " " "+"); firefox https://www.google.co.uk/#q=$q,google\n' \
| jgmenu --at-pointer --stay-awake --hide-on-startup &
yad --list --column="#":text --column="Nick":text --width=500 --height=600 \
--dclick-action='bash -c "echo $1 >/tmp/misko; jgmenu_run"' "1" "Misko" "2" "Damo" "3" "Malm" "4" "Head Without a Stick"
test -e /tmp/misko && rm -f /tmp/misko
killall jgmenu >/dev/null
Do you mean "paste" and "new row" functionality for jgmenu or yad?
I found a bug in jgmenu whilst playing with this. I've just pushed a fix, so it'd advise pulling and re-compiling.
Last edited by malm (2017-04-08 22:38:07)
Offline
i don't know what your script is doing, but i noticed that you can eliminate a few pipes (each one opens a subshell) by using bash builtin string manipulation.
exampkle:
#!/bin/bash echo "$DATA" | sed "s/\&/\&/g" etc.
better:
echo "${DATA//&/&}"
Offline
@Misko, sorry I had missed these last couple of posts.
Your named pipe is neater than my simple tmp file
Although I think it would be easier to run jgmenu in short-lived mode for these yad scripts (recently added --simple for this).
Sorry to mess around with the defaults. I want to make it as easy as possible for those using jgmenu as a long-running start menu. Still early days
I'll have a play with yad. I'm sure between us we'll get there.
Offline
@misko
I've had a play with the code you posted on 10 April.
I think it works very well It's a nice solution.
Regarding the "xclip problem", if you put
echo "" > $PIPE_03
after the xclip line too if works fine (unless I'm missing the point of what you expect it to do).
Offline
^ regarding the IFS, yes we use fgets() and then change '\n' to '\0', so it's very much '\n'.
I think I'd prefer to keep it as it is, but am of course happy to re-consider if it is going to help solve a problem.
Offline
It worked consistently when I played with it.
Are you using --simple?
Does the xclip selection contain '\n' when you get the inconsistent behaviour?
If you're happy, I can commit this script to the jgmenu repo so that we make sure we talk about the same version.
Offline
I'm thinking of writing a jgmenuconf tool using shell + yad. It will probably be small and just cover some options that tint2conf doesn't.
Python+gtk/qt might be a more conventional choice, but I rather like yad
Offline
Malm,
I have been building a new system this weekend. When it came time to install jgmenu (which is now part of my "standard setup" (I love it )), I noticed one change in the Installation instructions on https://github.com/johanmalm/jgmenu since I did this the last time - you have added a handy new script, "install-debian-dependencies.sh".
Which is very nice enhancement, although I didn't notice it until after I had typed in all those "apt install" commands for the various lib*-dev packages. Anyway, I thought in the instructions,
./scripts/install-debian-dependencies.sh
mkdir ~/src && cd ~/src
git clone https://github.com/johanmalm/jgmenu.git
cd jgmenu
make
make install
the order is wrong, because the "install-debian-dependencies.sh" script won't exist until after you run the "git clone" command. I think the step to run the "install-debian-dependencies.sh" script needs to go between "cd jgmenu" and "make", as in:
mkdir ~/src && cd ~/src
git clone https://github.com/johanmalm/jgmenu.git
cd jgmenu
./scripts/install-debian-dependencies.sh
make
make install
Ben
Offline
Thanks. Good spot! I've changed it.
I'm delighted that you use+like it.
Depending on how old your jgmenurc is, you may do well to delete/update it to allow tint2 integration to take place (assuming you use tint2).
Do shout if there are any config mismatches between jgmenu+tint2. jgmenu should pick up on all the tint2 colour scheme and positioning automatically.
If you modify your tint2rc, you'll need to do a `killall jgmenu` to re-load the config (for the time being anyway).
In terms of "interfaces", beware that icon-caching has now been implemented in C and happens automatically, so there is no need to do `jgmenu_run cache` anymore.
I've got a few things to sort out before v0.5.2 (see the TODO2 file).
Offline
P.S.
- We also honour bl-tint2zen, so it should work even if you don't use a plain tint2rc.
- The recent addition of `jgmenu_run lx` is still a bit experimental. It's an alternative to pmenu and is just a front-end to libmenu-cache (LXDE's lib for parsing XDG menus). I've noticed a few peculiarities with it and will try to iron them out.
Offline
I'm not sure if it is - easily? - possible, but I'd like to suggest a menu configuration feature to consider: (Vertical) Mirroring.
The categories are on the left side and sub-menus open on the right side. In certain configurations (e.g. when the start button is in the upper right corner) the other way around would work more convenient.
Offline
Good to hear from you.
I'll have a go. Shouldn't be too hard. It'll have to be tomorrow/weekend though.
Offline
^Awesome, thank you! That's exactly what I meant.
Very nice desktop btw.
Offline
Screenshot below based on examples/ex11.sh
It is as vanilla as it gets. There is no jgmenurc. The tint2rc is the one created automatically by tint2 with only the following mods:
panel_items = PLTSC
button = new
button_icon = your_favourite_icon
button_max_icon_size = 22
button_lclick_command= jgmenu_run
Offline
Screenshot below based on examples/ex13.sh showing a search box at the top of the menu.
It's a flavour widgets.c - which is at less than 1% complete/mature and API is likely to change. Yet, I thought some of you might find it slightly more interesting than the scrot in the previous post.
Last edited by malm (2017-07-22 19:36:01)
Offline
a small problem with jgmenu...
I have sublime text installed but it does not show in the menu.
As per usual practice re: sublime the app is installed to /opt and symlinked to /usr/bin
sudo ln -s /opt/sublime_text_3/sublime_text /usr/bin/sublime
Any ideas how to get this app to show in jgmenu would be appreciated.
Offline
^
Fixed by adding a 'prepend' to ~/.config/jgmenu
Lesson#8
https://github.com/johanmalm/jgmenu/blo … orial.7.md
Firefox,firefox,firefox
Thunar,thunar,system-file-manager
Termite,termite,utilities-terminal
Sublime,sublime,sublime-text-editor
^sep()
I added a couple more for good measure
Offline
Nice. I was in the middle of trying to install void linux in virtualbox. It beat me though :-(
Couldn't get grub2 to play. I'll try it on a real drive tomorrow.
jgmenu has made into the official repo on void, so thought I should give it ago.
Offline