From 155d3d8f5e6fcc23d5c43937da7bdbba812dab59 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 18 May 2023 16:05:29 +0200 Subject: [PATCH] middle click menu update (jgdesktops) --- usr/bin/jgdeskgrid | 6 ++-- usr/bin/jgdeskmngr | 2 +- usr/bin/jgdesktops | 61 ++++++++++++++++++++++++++++++-------- usr/bin/jgwallpaperchanger | 8 ++--- 4 files changed, 56 insertions(+), 21 deletions(-) diff --git a/usr/bin/jgdeskgrid b/usr/bin/jgdeskgrid index dfba90a..f43502b 100755 --- a/usr/bin/jgdeskgrid +++ b/usr/bin/jgdeskgrid @@ -80,9 +80,9 @@ ROWS=${rows:-12} me="jgdeskgrid -s" out+=("^sep(DesktopGrid)") -out+=("$ABOUT,notify-send.sh -u critical -i mbcc '$title' '$help' -o '$SHOW_IMGHELPER:drawgrid' -o '$EDITCONF:xdg-open ~/.config/deskgrid/deskgrid.cfg'") -out+=("$SHOW_IMGHELPER,drawgrid") -out+=("$QUICK_TILE,yhtml /usr/share/mabox/help/Quick_tiling.html 'Mabox Quick tiling trainer - Ctrl + Shift + click'") +out+=("󱇙 $ABOUT,notify-send.sh -u critical -i mbcc '$title' '$help' -o '$SHOW_IMGHELPER:drawgrid' -o '$EDITCONF:xdg-open ~/.config/deskgrid/deskgrid.cfg'") +out+=("󰕰 $SHOW_IMGHELPER,drawgrid") +out+=("󰋁 $QUICK_TILE,yhtml /usr/share/mabox/help/Quick_tiling.html 'Mabox Quick tiling trainer - Ctrl + Shift + click'") out+=("^sep($CONFIGURATION)") #out+=("$LCOLUMNS [ $COL ],^checkout(columns)") #out+=("$LROWS [ $ROWS ],^checkout(rows)") diff --git a/usr/bin/jgdeskmngr b/usr/bin/jgdeskmngr index 1c02f4a..e3be630 100755 --- a/usr/bin/jgdeskmngr +++ b/usr/bin/jgdeskmngr @@ -77,7 +77,7 @@ SESSIONDIR="$HOME/.config/deskmngr/" mkdir -p $SESSIONDIR out+=("^sep($DESKMNGR)") -out+=("$ABOUT,\"\"\"notify-send.sh -u critical -i mbcc '$title' '$help';$me\"\"\"") +out+=(" $ABOUT,\"\"\"notify-send.sh -u critical -i mbcc '$title' '$help';$me\"\"\"") out+=("^sep($SAVED_SESS)") diff --git a/usr/bin/jgdesktops b/usr/bin/jgdesktops index 097bce3..07aab57 100755 --- a/usr/bin/jgdesktops +++ b/usr/bin/jgdesktops @@ -32,6 +32,12 @@ case $LANG in MCORNERS="Krawędzie ekranu" RUNNING="(uruchomiona)" STOPPED="(zatrzymana)" + MOUSE_DESK_ACTIONS="Akcje myszy na pulpicie" + SHOW_DESK="Pokaż pulpit - lewy klik" + SWITCH_DESK="Zmień pulpit - kółko myszy" + FOCUS="Fokus podąża za myszą" + WALLPAPER="Tapeta" + TOOLS="Narzędzia" ;; es*) REMOVE="Eliminar este menú del panel" @@ -50,7 +56,7 @@ case $LANG in DESKMNGR="Desktop session Manager" WALLCHANGER="Wallpaper" DESKGRID="Desktop Grid" - SCREEN_RES="Screen resolution" + SCREEN_RES="Screen Settings" ENABLE="Enable" DISABLE="Disable" DESK_SERVICES="Desktop services" @@ -60,6 +66,12 @@ case $LANG in MCORNERS="Screen Edges - hot corners" RUNNING="(running)" STOPPED="(stopped)" + MOUSE_DESK_ACTIONS="Mouse on Desktop Actions" + SHOW_DESK="Show Desktop on left click" + SWITCH_DESK="Switch Desktop on mousewheel up/down" + FOCUS="Focus follow Mouse" + WALLPAPER="Wallpaper" + TOOLS="Tools" ;; *) REMOVE="Remove this menu from panel" @@ -88,6 +100,12 @@ case $LANG in MCORNERS="Screen Edges - hot corners" RUNNING="(running)" STOPPED="(stopped)" + MOUSE_DESK_ACTIONS="Mouse on Desktop Actions" + SHOW_DESK="Show Desktop on left click" + SWITCH_DESK="Switch Desktop on mousewheel up/down" + FOCUS="Focus follow Mouse" + WALLPAPER="Wallpaper" + TOOLS="Tools" ;; esac @@ -95,14 +113,12 @@ CSVFILE="$HOME/.config/mabox/jgdesktops-bottom.csv" # If config file not exist create one with defaults if [ ! -f $CSVFILE ]; then cat < ${CSVFILE} -^sep(WALLPAPER) +^sep($TOOLS) 󰸉 $WALLCHANGER,^pipe(jgwallpaperchanger) -^sep(TOOLS) 󱇙 $DESKGRID,^pipe(jgdeskgrid) $DESKMNGR,^pipe(jgdeskmngr) -^sep($SCREEN_RES) -ARandR,arandr -LXRandr,lxrandr +󰹑 $SCREEN_RES - ARandR,arandr +󰹑 $SCREEN_RES - LXRandr,lxrandr EOF fi @@ -151,14 +167,11 @@ out+=("^sep($MANAGE)") desktops=$(wmctrl -d |wc -l) out+=("  $ADD,wmctrl -n $((desktops+1));$me") out+=("  $REMOVE_LAST,wmctrl -n $((desktops-1));$me") + + + out+=("^sep($DESK_SERVICES)") -if command -v mcorners &> /dev/null;then - if [[ -f /tmp/mcorners.lck ]]; then - out+=("󰄲 $MCORNERS $RUNNING,mcorners --stop;$me") - else - out+=("󰄱 $MCORNERS $STOPPED,mcorners -tl 'colorizer -s' -l 'mb-jgtools places' -t mabox-terminal -tr 'mb-music -s' -bl 'colorizer-menus -s' -b 'mb-fetch' -br 'skippy-xd-fix' -r 'mb-jgtools right' -iof;$me") - fi -fi + if pidof conky &>/dev/null; then out+=("󰄲 $CONKY $RUNNING,conky_toggle;$me") else @@ -169,6 +182,13 @@ out+=("󰄲 $PICOM $RUNNING,compton_toggle;$me") else out+=("󰄱 $PICOM $STOPPED,compton_toggle;$me") fi +if command -v mcorners &> /dev/null;then + if [[ -f /tmp/mcorners.lck ]]; then + out+=("󰄲 $MCORNERS $RUNNING,mcorners --stop;$me") + else + out+=("󰄱 $MCORNERS $STOPPED,mcorners -tl 'colorizer -s' -l 'mb-jgtools places' -t mabox-terminal -tr 'mb-music -s' -bl 'colorizer-menus -s' -b 'mb-fetch' -br 'skippy-xd-fix' -r 'mb-jgtools right' -iof;$me") + fi +fi if command -v cortilectl &> /dev/null;then if pidof cortile &>/dev/null; then out+=("󰄲 $CORTILE $RUNNING,cortilectl stop;$me") @@ -176,6 +196,21 @@ if command -v cortilectl &> /dev/null;then out+=("󰄱 $CORTILE $STOPPED,cortilectl start;$me") fi fi + +# DESKTOP MOUSE ACTIONS +lclick=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/@name' $HOME/.config/openbox/rc.xml) +mousewheel=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Up"]/a:action/a:to' $HOME/.config/openbox/rc.xml) +focus=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:focus/a:followMouse' $HOME/.config/openbox/rc.xml) + +out+=("^sep($MOUSE_DESK_ACTIONS)") +if [[ ! -z "$lclick" ]];then +[[ "$lclick" = "none" ]] && out+=("󰄱 $SHOW_DESK,obxml show_desk on") || out+=("󰄲 $SHOW_DESK,obxml show_desk off") +fi +if [[ ! -z "$mousewheel" ]];then +[[ "$mousewheel" = "none" ]] && out+=("󰄱 $SWITCH_DESK,obxml switch_desk on") || out+=("󰄲 $SWITCH_DESK,obxml switch_desk off") +fi +[[ "$focus" = "no" ]] && out+=("󰄱 $FOCUS,obxml focus_follow_mouse on") || out+=("󰄲 $FOCUS,obxml focus_follow_mouse off") + out+=(". ~/.config/mabox/jgdesktops-bottom.csv") diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger index fe79c3f..77ad615 100755 --- a/usr/bin/jgwallpaperchanger +++ b/usr/bin/jgwallpaperchanger @@ -1,5 +1,5 @@ #!/bin/bash -# jgwallpaperchanger - submenu to configure wallpapers +# jgwallpaperchanger - dynamic menu (or submenu) to configure/set wallpapers # CONFIG_DIR="$HOME/.config/mbwallpaper" @@ -76,13 +76,13 @@ help='\nBased on Mabox forum member Shwaybo /dev/null; then #out+=("$NITROGEN,nitrogen") - out+=("$RANDWALL,mbwallpaper -o;$me") - out+=("$CHOOSE,pcmanwp") + out+=("󰇎 $RANDWALL,mbwallpaper -o;$me") + out+=("󰉔 $CHOOSE,pcmanwp") out+=("$GENERATOR,^pipe(jgwallpapergenerate)") out+=("^sep($SLIDESHOW)") out+=("$STARTS,run_wallpaperslideshow;$me") else - out+=("$STOPS,killall mbwallpaper;$me") + out+=("$STOPS,killall mbwallpaper;pkill -f 'yad --not';$me") fi