mabox-pipemenus/usr/bin/jgkeys-pipe

177 lines
6.0 KiB
Plaintext
Raw Permalink Normal View History

2020-09-17 01:27:02 +02:00
#!/bin/bash
# jgkeys-pipe - native jgmenu pipemenu with keyboard shortcuts
#
case $LANG in
pl*)
APPS="Aplikacje"
FILEMNGR="Menadżer plików"
BROWSER="Przeglądarka WWW"
TERMINAL="Terminal"
EDITOR="Edytor tekstu"
FSEARCH="Wyszukiwanie plików"
2020-09-25 16:06:39 +02:00
RESMON="Monitor zasobów"
2021-04-25 12:44:34 +02:00
PYRADIO="PyRadio"
2020-09-21 14:43:15 +02:00
VOLUME="Kontrola głośności"
COMPOSITOR="wł/wył Picom"
WINDOWS="Okna"
HALF="połowa ekranu"
2021-02-09 23:50:50 +01:00
FULL="Pełny ekran"
2020-10-02 00:18:00 +02:00
ARROWS="Strzałki"
2020-09-21 14:43:15 +02:00
SHOW_DESKTOP="pokaż pulpit"
2020-09-17 01:27:02 +02:00
PANELS="Menu/Panele boczne"
M_MAIN="Główne menu"
M_SETTINGS="Menu ustawień"
2020-09-21 14:43:15 +02:00
M_HELP="Menu pomocy (to menu)"
2020-09-17 01:27:02 +02:00
PLACES="Lewy (miejsca)"
RIGHT="Prawy (ustawienia/pomoc)"
LOCK="Blokada ekranu"
EXIT="Wyloguj..."
2020-09-25 16:06:39 +02:00
HELPERS="Pomocnicy"
HISTORY="Ściągawka z historii"
ESPANSO="Espanso - text expander"
2020-10-02 00:18:00 +02:00
JGTILE="Kafelkowanie okien"
2020-10-02 09:56:51 +02:00
SHORTCUTS="Wszystkie skróty"
2020-09-17 01:27:02 +02:00
REMOVE="Usuń to menu z panelu"
2020-09-18 21:54:15 +02:00
2020-09-17 01:27:02 +02:00
;;
es*)
2020-09-27 12:37:22 +02:00
APPS="Ejecutar"
2020-09-18 21:54:15 +02:00
FILEMNGR="gestor archivos"
BROWSER="Navegador"
TERMINAL="Terminal"
EDITOR="Editor de textos"
FSEARCH="FSearch"
2020-09-25 16:06:39 +02:00
RESMON="Monitor de recursos"
2021-04-25 12:44:34 +02:00
PYRADIO="Internet Radio"
2020-09-21 14:43:15 +02:00
VOLUME="control volumen "
COMPOSITOR="activa/desact compositor"
WINDOWS="VENTANAS"
HALF="1/2 pantalla"
2021-02-09 23:50:50 +01:00
FULL="Toggle Full Screen"
2020-10-02 00:18:00 +02:00
ARROWS="Arrows"
2020-09-21 14:43:15 +02:00
SHOW_DESKTOP="mostrar escritorio"
2020-09-17 01:27:02 +02:00
2020-09-18 21:54:15 +02:00
PANELS="Paneles Laterales"
2020-09-21 14:43:15 +02:00
2020-09-18 21:54:15 +02:00
M_MAIN="Menú principal"
M_SETTINGS="Menú de configuración"
2020-09-21 14:43:15 +02:00
M_HELP="Menú de ayuda"
2020-09-18 21:54:15 +02:00
PLACES="Lugares (izquierda)"
RIGHT="Ajustes (derecha)"
LOCK="Bloquear pantalla"
EXIT="Salir "
2020-09-27 12:37:22 +02:00
HELPERS="Ayudantes"
2020-09-25 16:06:39 +02:00
HISTORY="Historia breve"
ESPANSO="Espanso - text expander"
2020-10-02 00:18:00 +02:00
JGTILE="Tiling helper"
2020-10-02 09:56:51 +02:00
SHORTCUTS="Atajos del teclado"
2020-09-17 01:27:02 +02:00
REMOVE="Eliminar este menú del panel"
2020-09-18 21:54:15 +02:00
2020-09-17 01:27:02 +02:00
;;
*)
APPS="Applications"
FILEMNGR="File Manager"
BROWSER="WWW browser"
TERMINAL="Terminal"
EDITOR="Text Editor"
FSEARCH="FSearch"
2020-09-25 16:06:39 +02:00
RESMON="Resource Monitor"
2021-04-25 12:44:34 +02:00
PYRADIO="Internet Radio"
2020-09-21 14:43:15 +02:00
VOLUME="Volume Control"
COMPOSITOR="toggle Picom (Compositor)"
WINDOWS="Windows"
HALF="Half screen"
2021-02-09 23:50:50 +01:00
FULL="Toggle Full Screen"
2020-10-02 00:18:00 +02:00
ARROWS="Arrows"
2020-09-21 14:43:15 +02:00
SHOW_DESKTOP="Show desktop"
2020-09-17 01:27:02 +02:00
PANELS="Menu/SidePanels"
M_MAIN="Main Menu"
M_SETTINGS="Settings Menu"
2020-09-21 14:43:15 +02:00
M_HELP="Help (this) Menu"
2020-09-18 21:54:15 +02:00
PLACES="Places Sidepanel (Left)"
RIGHT="Help/Settings Sidepanel (Right)"
2020-09-17 01:27:02 +02:00
LOCK="Lock screen"
EXIT="Exit Dialog"
2020-09-25 16:06:39 +02:00
HELPERS="Helpers"
HISTORY="History helper"
ESPANSO="Espanso - text expander"
2020-10-02 00:18:00 +02:00
JGTILE="Tiling helper"
2020-10-02 09:56:51 +02:00
SHORTCUTS="All Keybindings"
2020-09-17 01:27:02 +02:00
REMOVE="Remove this menu from panel"
2020-09-18 21:54:15 +02:00
2020-09-17 01:27:02 +02:00
;;
esac
out+=("^sep($APPS)")
2021-02-09 23:50:50 +01:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-f" "$FILEMNGR" "exo-open --launch FileManager")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-w" "$BROWSER" "exo-open --launch WebBrowser")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-t" "$TERMINAL" "exo-open --launch TerminalEmulator")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-grave" "Quake-like $TERMINAL" "mabox-terminal")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-e" "$EDITOR" geany)")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-g" "Galculator" galculator)")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-h" "$RESMON" "^term(bpytop)")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-/" "$FSEARCH" fsearch)")
2021-04-25 12:44:34 +02:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-r" "$PYRADIO" "sakura -e 'pyradio'")")
2021-02-09 23:50:50 +01:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-v" "$VOLUME" pavucontrol)")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-c" "$COMPOSITOR" compton_toggle)")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-l" "$LOCK" "betterlockscreen -l")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-x" "$EXIT" "mb-jgtools mblogout")")
2020-09-17 01:27:02 +02:00
out+=("^sep($PANELS)")
2021-02-09 23:50:50 +01:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W" "$M_MAIN" "mb-jgtools main")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-s" "$M_SETTINGS" "mb-jgtools settings")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-k" "$M_HELP" "jgkeys-pipe -s")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "C-W-Left" "$PLACES" "mb-jgtools places")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "C-W-Right" "$RIGHT" "mb-jgtools right")")
2020-09-17 01:27:02 +02:00
2020-09-21 14:43:15 +02:00
out+=("^sep($WINDOWS)")
2021-02-09 23:50:50 +01:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-d" "$SHOW_DESKTOP" show_desktop)")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-$ARROWS" "$HALF")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "F11/W-Enter" "$FULL")")
2020-09-21 14:43:15 +02:00
2020-09-25 16:06:39 +02:00
out+=("^sep($HELPERS)")
2020-10-02 00:18:00 +02:00
2021-02-09 23:50:50 +01:00
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-t" "$JGTILE" "jgtile")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-h" "$HISTORY" "jghistory-pipe -s")")
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-e" "$ESPANSO" "jgespanso-pipe -s")")
2020-10-02 09:56:51 +02:00
out+=("^sep()")
out+=("$(printf "%s,%s" "$SHORTCUTS" "mb-kb --gui &>/dev/null")")
2020-09-17 01:27:02 +02:00
### RUN
if [ $1 == "-s" ]; then
2021-09-24 01:40:09 +02:00
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
2021-01-12 15:53:38 +01:00
. $HOME/.config/mabox/mabox.conf
2020-09-17 01:27:02 +02:00
MENU_PADDING_TOP=0
MENU_HALIGN="center"
MENU_VALIGN="center"
jgmenu_icon_size=0
2021-01-12 15:53:38 +01:00
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
[ -z $jgmenu_use_borders ] && menu_border=0
2020-09-17 01:27:02 +02:00
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
$(printf '%s\n' "${out[@]}")
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
exit 0
fi
printf '%s\n' "${out[@]}"
2021-01-31 22:00:55 +01:00
#printf '%s\n' "${out[@]}" > $HOME/.config/mabox/shortkeys.csv
2020-09-21 14:43:15 +02:00
if [ $1 == "-r" ]; then
2020-09-18 21:54:15 +02:00
printf '%s\n' "^sep()"
2021-05-23 10:20:13 +02:00
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_keyspipe=false;mb-jgtools places"
2020-09-21 14:43:15 +02:00
fi
2020-09-17 01:27:02 +02:00