Registered Member
|
Since I'm a hardcore openbox user for about 15 years I figured, why not use a floating menu on kde. Just for giggles. There are over 20 menus available for kde of which only two I actually find any good. The cupnoodle kickoff and the onze one. But, those things reside on panels mostly. So, enter jgmenu. Make no mistake, although it's very customizable, it's a pain in the a.. to get it right. If you're fine with the default ( which is an application menu to which you can add top and bottom entries), no prob. If you want some more exotic....myeah...you need time. Anywho, jgmenu set on right click the desktop ( openbox nostalgia if you will) with some pipemenus and custom subs. https://imgur.com/a/OL4pJYf ...... .. https://imgur.com/a/3ZkYx11
Of course, you can add it to the panel, either in this openbox like layout or a whatever-you-want one. In either case, twenty menus for kde, yet only one simple one (popup launcher).
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
Would it be possible to give a brief explaination on how to do this? I cannot for the life of me figure it out. I even changed the KDE menu and hoped perhaps jgmenu would adapt to the new menu but it did not. Great and perfect app for what I need but having a damned time configuring it. I love the idea you had when configuring as a popup menu on top of it. Any assistance would be GREATLY appreciated. Many thanks!
|
Registered Member
|
Well. There's plenty of info on it but in the end it requires some text file editing to get it the way you want. In either case, the structure of the menu itself is done in the jgmenu folder in ~/.config/. There are certain default files like the jgmenu.rc, the prepend.csv, favorites.csv..... The overall looks of the menu are in the jgmenu.rc, but the entries have to be set in the prepend.csv. As for applications as a whole, they come by default ( like a dynamic openbox or lxmenu), the custom ones...well, you have to do them yourself.
Here's a part of mine: Terminal stuff,^checkout(2),utilities-terminal ****, brave-browser,/opt/brave.com/brave/product_logo_32.png Webcrap,^checkout(1),/home/john/.icons/tralala.svg Places,^pipe(jgmenu_run ob --cmd=/home/john/Scripts/bl-places-pipemenu),system-file-manager Recent Files,^pipe(jgmenu_run ob --cmd=/home/john/Scripts/recent-pipemenu),view-history Calc, kcalc, kcalc Kate, kate, kate Buddha Lounge, brave-browser --app=https://www.youtube.com/c/BuddhasLounge/videos --class=WebApp-Buddhalounge6731 --user-data-dir=/home/john/.local/share/ice/profiles/Buddhalounge6731, /home/john/.icons/All Google/32/youtube_television_32dp.svg Multimedia,^checkout(3),smplayer Graphics,^checkout(4),kcolorchooser Kantoor,^checkout(5),libreoffice-impress Kronometer, kronometer, kronometer.svg Wallpaper, dolphin /home/john/Afbeeldingen, preferences-desktop-wallpaper Tiling mode, /home/john/Scripts/Toggle,preferences-desktop-virtual.svg Ksnip/Kazam,^checkout(6), /home/john/.icons/All Google/32/images_32dp.svg Applications,^checkout(7),ring-kde ^sep() Logout,QT_STYLE_OVERRIDE=Lightly /home/john/Scripts/Logout.sh,process-stop-symbolic.svg So, it supports openbox pipemenus as you can see. Takes a bit of research into what works. But the guys from Bunsenlabs make their stuff available so you can try some of theirs. Now, I believe ( not sure though) there's a gui menu editor in existence to make things easier but once you get the structure of the prepend.csv, it's quite easy to do it manually. One thing I can't get to work though is the gtk theme. For some reason, the menu doesn't adapt when changing a color scheme in kde. It does on most, just not kde. So I set the color to use the dark variant of my daily themes. So yeah, I made a desktop entry which you can put anywhere you like. But I also made a desktop click action for it. That requires a little tweak of the default kde desktop menu of course. In short, I can't really really help you with it. I could post the jgmenu.rc, the prepend.csv, the pipemenus and the autostart file ( to change the not-working gtk adapt) but in the end, it's all up to you really. https://imgur.com/a/v7JYdUX It's a pitty no one came up with this type of customizable floating menu for qt. There was one once, but it hasn't been updated in a looong time. If you're a hardcore openbox geek like me, you're kinda used to floating wm's.
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
My jgmenu.rc:
# verbosity = 0 # stay_alive = 1 # persistent = 0 # hide_on_startup = 0 #csv_cmd = favorites.csv #csv_cmd = places.csv # tint2_look = 0 position_mode = pointer # edge_snap_x = 30 terminal_exec = x-terminal-emulator # terminal_args = -e # monitor = 0 # hover_delay = 100 # hide_back_items = 1 #columns = 2 # tabs = 120 #menu_margin_x = 0 # menu_margin_y = 0 menu_width = 180 # menu_height_min = 0 # menu_height_max = 0 # menu_height_mode = static # menu_padding_top = 5 menu_padding_right = 0 # menu_padding_bottom = 5 menu_padding_left = 0 menu_radius = 7 menu_border = 1 # menu_halign = left # menu_valign = bottom # menu_gradient_pos = none sub_spacing = 5 #sub_padding_top = 15 # sub_padding_right = auto # sub_padding_bottom = auto # sub_padding_left = auto # sub_hover_action = 1 # item_margin_x = 3 # item_margin_y = 3 # item_height = 25 # item_padding_x = 4 item_radius = 5 # item_border = 0 # item_halign = left sep_height = 8 # sep_halign = left # sep_markup = # font = # font_fallback = xtg # icon_size = 22 # icon_text_spacing = 10 # icon_norm_alpha = 100 # icon_sel_alpha = 100 # icon_theme = # icon_theme_fallback = xtg # arrow_string = ▸ arrow_string = › hover_delay = 30 #arrow_width = 30 color_menu_bg = #1a1d22 100 # color_menu_bg_to = #1a1d22 100 color_menu_border = #000000 100 # color_norm_bg = #000000 00 color_norm_fg = #b9b9b9 100 color_sel_bg = #434a50 100 color_sel_fg = #8aa4b7 100 # color_sel_border = #eeeeee 8 # color_sep_fg = #ffffff 20 # color_scroll_ind = #eeeeee 40 color_title_fg = #b9b9b9 100 color_title_bg = #1a1d22 100 color_title_border = #1a1d22 100 # csv_name_format = %n (%g) # csv_single_window = 0 # csv_no_dirs = 0 # csv_i18n = # csv_no_duplicates = 0
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
My prepend.csv:
Terminal stuff,^checkout(2),utilities-terminal ****, brave-browser,/opt/brave.com/brave/product_logo_32.png Webcrap,^checkout(1),/home/john/.icons/tralala.svg Places,^pipe(jgmenu_run ob --cmd=/home/john/Scripts/bl-places-pipemenu),system-file-manager Recent Files,^pipe(jgmenu_run ob --cmd=/home/john/Scripts/recent-pipemenu),view-history Calc, kcalc, kcalc Kate, kate, kate Buddha Lounge, brave-browser --app=https://www.youtube.com/c/BuddhasLounge/videos --class=WebApp-Buddhalounge6731 --user-data-dir=/home/john/.local/share/ice/profiles/Buddhalounge6731, /home/john/.icons/All Google/32/youtube_television_32dp.svg Multimedia,^checkout(3),smplayer Graphics,^checkout(4),kcolorchooser Kantoor,^checkout(5),libreoffice-impress Kronometer, kronometer, kronometer.svg Wallpaper, dolphin /home/john/Afbeeldingen, preferences-desktop-wallpaper Tiling mode, /home/john/Scripts/Toggle,preferences-desktop-virtual.svg Ksnip/Kazam,^checkout(6), /home/john/.icons/All Google/32/images_32dp.svg Applications,^checkout(7),ring-kde ^sep() Logout,QT_STYLE_OVERRIDE=Lightly /home/john/Scripts/Logout.sh,process-stop-symbolic.svg ^tag(1) Firefox, firefox, /home/john/.icons/tralala.svg Fhatever, brave-browser --app=https://www.facebook.com/?sk=h_chr --class=WebApp-Facecrapbrave7074 --user-data-dir=/home/john/.local/share/ice/profiles/Facecrapbrave7074,/home/john/.icons/facebook-messenger-icon-png-image-free-download-searchpngcom-messenger-icon-png-715_715.png Gmail, brave-browser --app=https://mail.google.com/mail/u/0/?tab=wm#inbox --class=WebApp-Gmail6329 --user-data-dir=/home/john/.local/share/ice/profiles/Gmail6329,/home/john/.icons/All Google/48/googlemail_48dp.svg Maps, brave-browser --app=https://www.google.be/maps --class=WebApp-Mappies1096 --user-data-dir=/home/john/.local/share/ice/profiles/Mappies1096,/home/john/.icons/All Google/48/maps_48dp.svg Calendar, /opt/brave.com/brave/brave-browser --profile-directory=Default --app-id=kjbdgfilnfhdoflbpgamdcdgpehopbep,/home/john/.icons/All Google/48/calendar_48dp.svg KMI, brave-browser --app=https://www.meteo.be/nl/gent --class=WebApp-KMI2456 --user-data-dir=/home/john/.local/share/ice/profiles/KMI2456,/home/john/.icons/weather-storm-day.svg Utube, brave-browser --app=https://www.youtube.com/ --class=WebApp-Utube5820 --user-data-dir=/home/john/.local/share/ice/profiles/Utube5820,/home/john/.icons/All Google/48/youtube_48dp.svg Google docs, brave-browser --app=https://translate.google.be/?hl=nl&tab=wT&sl=nl&tl=en&op=translate --class=WebApp-Translate1515 --user-data-dir=/home/john/.local/share/ice/profiles/Translate1515,/home/john/.icons/All Google/48/docs_48dp.svg Keep, brave-browser --app=https://keep.google.com/u/0/ --class=WebApp-GoogleKeep4755 --user-data-dir=/home/john/.local/share/ice/profiles/GoogleKeep4755,/home/john/.icons/All Google/48/keep_48dp.svg Drive, brave-browser --app=https://drive.google.com/drive/my-drive --class=WebApp-GoogleDrive4024 --user-data-dir=/home/john/.local/share/ice/profiles/GoogleDrive4024,/home/john/.icons/All Google/48/drive_48dp.svg ^tag(2) Htop, konsole -e htop,htop Shabbam, konsole -e /home/john/Scripts/shabbam.sh, alienarena Gdu, konsole -e gdu,utilities-terminal Cava, konsole -e cava,amarok_playcount ^tag(3) Audacious, audacious,audacious Smplayer, smplayer, smplayer YouTuber, /usr/bin/youtubedl-gui,youtubedl-gui Flowblade, flowblade, io.github.jliljebl.Flowblade Kwave, kwave,kwave Imagination, imagination, imagination ^tag(4) Gimp, gimp, gimp Kcolorchooser, kcolorchooser, kcolorchooser ^tag(5) LibreOffice Writer,QT_STYLE_OVERRIDE=kvantum libreoffice --writer,libreoffice-writer OnlyOffice, onlyoffice-desktopeditors --new=doc, onlyoffice Speciale Tekens, kcharselect, accessories-character-map Emoji's, ibus-ui-emojier-plasma, preferences-desktop-emoticons Okular,okular,okular Fsearch, fsearch, edit-find ^tag(6) Sleep 5, sleep 5 && ksnip -m, ksnip Sleep 10, bash -c "sleep 10 && ksnip -m", ksnip Rectangular area, ksnip -r -c, ksnip Fullscreen, ksnip -m -c, ksnip ^sep() Kazam, kazam, kazam ^tag(7)
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
That prepend.csv has a places menu that will show all the files that are in a hovered folder menu entry.
Like so: https://imgur.com/a/o6xrCmI Keep in mind that jgmenu doesn't do "open with". So whatever file is clicked, it'll do it with the default application.
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
But you can use a different one. Now, you can run a openbox pipemenu with the command "^pipe(jgmenu_run ob --cmd=/path/to/menu" OR, you can place the pipemenu in ~/.bin/. This one, for example:
#!/bin/sh # # Inspired by the {a,b}l-places-pipemenu scripts found in # ArchLabs and BunsenLabs # shown_dotfiles='.config .local ' : ${JGMENU_RESOURCE_OPENER=xdg-open} path=${1:-$HOME} [ $path != "/" ] && path=${path%/} test -d "$path" || { echo "$0: '$path' is not a directory" >&2 ; exit 1 ; } for i in "$path"/* do test -e "$i" || continue shortname=${i##*/} if test -d "$i" then directories_menu="${directories_menu} ${shortname},^pipe(places \"${path}/${shortname}\")" else files_menu="$files_menu ${shortname},${JGMENU_RESOURCE_OPENER} \"${path}/${shortname}\"" fi done printf "%b\n" "^sep(<small><i>${path}</i></small>)" printf "%b\n" " Otwórz w menadżerze plików,${JGMENU_RESOURCE_OPENER} \"${path}\"" printf "%b\n" " Otwórz w termianlu,terminator --working-directory=\"${path}\"" printf "%b\n" "^sep()" #printf "%b\n" "^sep(Katalogi)" printf "%b\n" "${directories_menu}" #printf "%b\n" "^sep(Pliki)" printf "%b\n" "${files_menu}" if test -z "${directories_menu}" && test -z "${files_menu}" then printf "%b\n" '<empty>' fi It has to be launched as in the text screenshot. And it'll give you this: https://imgur.com/a/MoPDzlx
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
This is the script for the separate places thing:
#!/bin/sh # bl-places-pipemenu - an openbox places pipe menu # Copyright (C) 2010~2019 John Crawley <john@bunsenlabs.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # NB The default shell (usually dash, not bash) is invoked # because it is faster. # Usage: add # <menu id="places" label="Places" execute="/path/to/bl-places-pipemenu ~/" /> # to your .config/openbox/menu.xml # or, if you want the "recent files" menu incorporated at the top, use: # <menu id="places" label="Places" execute="/path/to/bl-places-pipemenu --recent ~/" /> # make sure you have bl-recent-files-pipemenu somewhere, and enter its path below. # path to your "recent files" script, if you want to incorporate it: recent_script=~/.local/share/recently-used.xbel # Command to open folders at "Browse here..." - any file manager open_folder_cmd=dolphin # Default command to open files with - others might be exo-open, gnome-open, thunar, pcmanfm... default_open_cmd=xdg-open # Text editor of choice text_editor=kate # function to open files with default open command, or alternative command for certain files # - edit conditions or add other conditions to choice open_file() { [ -x "$1" ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit executables instead of executing #[ -x "$1" ] && exec "x-terminal-emulator -e" "$1" # uncomment this and comment out previous line to run executables in terminal instead of editing [ "${1##*.}" = desktop ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit .desktop files instead of executing exec "$default_open_cmd" "$1" # use default open command if above conditions not satisfied } # extra dotfiles and directories to display in HOME folder (dotfiles are hidden by default) # edit the list (space separated, surrounded by single quotes) or comment this line out, to taste: shown_dotfiles='.config .local ' # By default, this script will display directories separately, before files. # To change this behaviour, see NOTE1, NOTE2 and NOTE3 below, near end of page. HELP=' bl-places-pipemenu an Openbox Pipe Menu for showing a directory tree It should normally be called from an openbox menu. Usage: bl-places-pipemenu [options] [directory tree root] Options: -h --help show this message --open <filepath> open a file with configured default application (in this case the script will not output a menu) --recent incorporate a "recent files" submenu If a directory tree root is not specified, $HOME will be used. Configuration: /usr/bin/bl-places-pipemenu may be copied to ~/bin and edited there for per-user changes. Editable variables and functions, at the top of the file: recent_script path to a script outputting an openbox pipemenu open_folder_cmd command to open folders - any file manager default_open_cmd default command to open files text_editor command to open text files open_file() open files, using commands above, or alternatives shown_dotfiles list of dotfiles to display (they are hidden by default) By default, this script will display directories separately, before files. To change this behaviour, see NOTE1, NOTE2 and NOTE3 near end of file. ' ############################################################################ case $1 in -h|--help) echo "$HELP" exit 0 ;; # if "--open" option is sent as $1, open file ($2) instead of generating menu --open) open_file "$2" echo "$0 : failed to open $2" >&2 exit # in case exec command fails ;; # if "--recent" option is sent, incorporate "recent files" menu --recent) shift output='<openbox_pipe_menu> ' if [ -x "$recent_script" ] then output="${output}<separator label=\"Recently opened...\" /> <menu execute=\"$recent_script\" id=\"recent\" label=\"files\" /> " else echo "$0 : cannot find executable script $recent_script" >&2 fi ;; *) output='<openbox_pipe_menu> ' ;; esac path="${1:-$HOME}" # default starting place is ~, otherwise $1 [ -d "$path" ] || { echo "$0 : $path is not a directory" >&2; exit 1; } path="${path%/}" case "$path" in # only escape if string needs it *\&*|*\<*|*\>*|*\"*|*\'*) pathe=$(sed "s/\&/\&/g;s/</\</g;s/>/\>/g;s/\"/\"/g;s/'/\'/g;" <<XXX $path XXX ) ;; *) pathe=$path ;; esac case "$pathe" in *\&apos\;*) pathe_apos=$(sed 's/\'/\'\"\'\"\'/g;'<<XXX $pathe XXX ) ;; *) pathe_apos=$pathe ;; esac output="$output<separator label=\"$pathe\" /> <item label=\"Browse here...\"> <action name=\"Execute\"> <command> '$open_folder_cmd' '$pathe_apos' </command> </action> </item> <separator /> " unset extra_entries directories_menu files_menu [ "$path" = "$HOME" ] && extra_entries="$shown_dotfiles" for i in "$path"/* $extra_entries do [ -e "$i" ] || continue # only output code if file exists shortname="${i##*/}" case $shortname in *\&*|*\<*|*\>*|*\"*|*\'*) shortnamee=$(sed "s/\&/\&/g;s/</\</g;s/>/\>/g;s/\"/\"/g;s/'/\'/g;" <<XXX $shortname XXX ) ;; *) shortnamee=$shortname ;; esac case $shortnamee in *\&apos\;*) shortnamee_apos=$(sed 's/\'/\'\"\'\"\'/g;'<<XXX $shortnamee XXX ) ;; *) shortnamee_apos=$shortnamee ;; esac case $shortnamee in *_*) shortnamee_label=$(sed 's/_/__/g;'<<XXX $shortnamee XXX ) ;; *) shortnamee_label=$shortnamee ;; esac if [ -d "$i" ] then # NOTE1 If you want directories and files listed together # change next line [directories_menu="$directories_menu] to read: [files_menu="$files_menu] (there is no final quote) directories_menu="$directories_menu <menu id=\"${pathe_apos}/${shortnamee_apos}\" label=\"$shortnamee_label\" execute=\"'$0' '${pathe_apos}/${shortnamee_apos}'\" />" else files_menu="$files_menu <item label=\"$shortnamee_label\"> <action name=\"Execute\"> <command> '$0' --open '${pathe_apos}/${shortnamee_apos}' </command> </action> </item>" fi done [ -n "$directories_menu" ] && { # NOTE2 comment out next 2 lines if you don't want "Directories" label # output="${output}<separator label=\"Directories\" /> #" output="${output}${directories_menu} " } [ -n "$files_menu" ] && { # NOTE3 comment out next 2 lines if you don't want "Files" label # output="${output}<separator label=\"Files\" /> #" output="${output}${files_menu} " } output="${output}</openbox_pipe_menu> " printf '%s' "$output" exit
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
And this is the script for the recent files pipe:
#!/bin/sh echo "<openbox_pipe_menu>" files=$( cat ~/.local/share/recently-used.xbel | grep file:/// | tail -n15 | cut -d "\"" -f 2 | tac | while read line; do file=$(echo "$line") name=$(echo -en "$file" | sed 's,.*/,,' | sed 's/%20/ /g') echo "<item label=\"$name\"> <action name=\"Execute\"><command>xdg-open $line</command> </action> </item>" done); echo "$files" echo "<separator />" echo "<item label=\"Clear Recent Documents\"> <action name=\"Execute\"> <command>rm ~/.local/share/recently-used.xbel</command> </action> </item>" echo "</openbox_pipe_menu>"
Last edited by dzon on Tue Mar 21, 2023 9:50 pm, edited 1 time in total.
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
And this is the (not working) gtk style script.
#!/bin/sh gtktheme_cache=~/.cache/jgmenu/.last-gtktheme mkdir -p ~/.cache/jgmenu gtktheme () { while IFS='=' read -r key value; do key=${key#"${key%%[![:blank:]]*}"} # strip any leading spaces key=${key%"${key##*[![:blank:]]}"} # " " trailing " " if [ "${key}" = 'gtk-theme-name' ]; then value=${value%%#*} # strip trailing comments value=${value#"${value%%[![:blank:]]*}"} value=${value%"${value##*[![:blank:]]}"} printf '%s' "${value}" return 0 fi done < "$HOME/.config/gtk-3.0/settings.ini" } old=$(cat "$gtktheme_cache") new=$(gtktheme) if [ -n "${old}" ]; then if ! [ "${old}" = "${new}" ]; then printf '%b\n' "info: change gtk theme from ${old} to ${new}" jgmenu_run gtktheme fi else printf '%s' "$new" > "$gtktheme_cache" fi
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
And this is the desktop application file which goes in ~/.local/share/applications.
[Desktop Entry] Categories=System Comment=Displays menu for launching installed applications Encoding=UTF-8 Exec=\sjgmenu_run GenericName=Application Menu Icon=jgmenu Name=jgmenu NoDisplay=false Path= StartupNotify=false Terminal=false TerminalOptions= Type=Application X-KDE-SubstituteUID=false X-KDE-Username=
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
As for adding a custom command to kde's desktop menu: https://github.com/wsdfhjxc/run-command
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
This should get you started. It'll give you that type of openbox like menu. But jgmenu can do a lot lot more, like rofi style menu and such. But I'd advize you to do some reading on that.
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered Member
|
Like I said, it's a pitty something similar, if even just as this type of layout, isn't available in a qt form. Because these types of menus are great. As far as I know you can't have another type which can pack all of it, apps, files ( as pipes on top of it )...in such a compact form. Again, as a longterm openbox user, it's something I miss in any DE.
https://imgur.com/a/uRmOJse
This realm's name is Maya. And she speaks Hertz. But Ahamkara makes a fuzz about it.
|
Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]