mb-jgtools/bin/mb-jgtools

878 lines
30 KiB
Plaintext
Raw Normal View History

2021-01-12 01:28:26 +01:00
#!/bin/bash -l
2020-08-29 15:40:13 +02:00
#
# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox
2021-01-12 01:28:26 +01:00
# Copyright (C) 2019-2021 Daniel Napora <napcok@gmail.com>
2021-01-14 19:01:40 +01:00
. $HOME/.config/mabox/mabox.conf
2021-01-12 19:14:32 +01:00
unset font
unset menu_gradient_pos
2020-02-23 00:51:41 +01:00
jgmenu_theme=${jgmenu_theme:-obtheme}
2020-02-15 23:27:35 +01:00
case $jgmenu_theme in
2020-02-16 01:51:13 +01:00
default)
2020-09-26 18:19:58 +02:00
#export color_norm_fg="#FFFFFF "
2020-02-16 01:51:13 +01:00
;;
2020-02-15 23:27:35 +01:00
obtheme)
2020-09-26 18:19:58 +02:00
#export color_title_fg="#FFFFFF "
2020-02-15 23:27:35 +01:00
ob_file=$HOME/.config/openbox/rc.xml
[[ -f $ob_file ]] && wm_theme=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
2020-09-26 18:19:58 +02:00
if [ ! -f "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc" ]; then
obtheme2jgmenu
fi
2020-02-15 23:27:35 +01:00
while read -r a b c
do
2020-02-22 17:01:00 +01:00
[[ -n "$a" && "$a" != [[:blank:]#]* ]] && export "$a$b$c"
2020-09-26 18:19:58 +02:00
done < "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc"
2020-02-15 23:27:35 +01:00
;;
2020-02-16 01:51:13 +01:00
*)
export color_title_fg="#FFFFFF "
while read -r a b c
do
[[ -n "$a" && "$a" != [[:blank:]#]* ]] && export "$a$b$c"
done < $HOME/.config/mabox/jgobthemes/$jgmenu_theme.colorrc
2020-02-16 01:51:13 +01:00
;;
2020-02-15 23:27:35 +01:00
esac
2020-09-17 12:16:41 +02:00
menu_font_size=${menu_font_size:-9}
menu_font_family=${menu_font_family:-Noto Sans Medium}
jgmenu_font="${menu_font_family} ${menu_font_size}"
2021-01-12 15:54:11 +01:00
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
2020-09-17 12:16:41 +02:00
[ -z $jgmenu_use_borders ] && menu_border=0
2020-02-11 15:19:56 +01:00
gtkbookmarks() {
2021-02-06 14:46:30 +01:00
if [ $places_bookmarks == true ]; then
BOOKMARKS="$HOME/.gtk-bookmarks"
if [[ -s "$BOOKMARKS" ]]; then
case $LANG in
pl*) GTK_BOOKMARKS="Zakładki";;
es*) GTK_BOOKMARKS="Marcadores" ;;
*) GTK_BOOKMARKS="Bookmarks" ;;
esac
while read -r line
do
uri=$(echo $line | cut -b 8- | cut -d' ' -f1 | sed 's/%20/ /g')
dirs+=(" ${line#* },^pipe(jgbrowser \"${uri}\")")
done <"$BOOKMARKS"
printf "%b\n" "^sep($GTK_BOOKMARKS)"
printf '%s\n' "${dirs[@]}"
fi
else
printf ""
2020-02-11 15:19:56 +01:00
fi
}
2020-02-12 12:24:04 +01:00
2020-02-20 18:33:48 +01:00
WEBBROWSER="exo-open --launch WebBrowser"
2020-01-21 23:00:04 +01:00
OSNAME=$(lsb_release -d | awk '{print $2}')
OSVERSION=$(lsb_release -r | awk '{print $2}')
OSCODE=$(lsb_release -c | awk '{print $2}')
mkconfigfile() {
cat <<EOF > ${CONFIG_FILE}
2020-01-28 23:28:23 +01:00
position_mode = ${POSITION_MODE:-fixed}
2021-01-12 01:28:26 +01:00
csv_cmd = apps
2020-01-21 23:00:04 +01:00
stay_alive = 0
2020-01-28 23:28:23 +01:00
hide_back_items = ${HIDE_BACK_ITEMS:-0}
2020-01-21 23:00:04 +01:00
terminal_exec = terminator
terminal_args = -e
2020-02-09 16:52:47 +01:00
tabs = ${TABS:-220}
2021-01-12 01:28:26 +01:00
menu_border = ${jgtools_border:-0}
# MENU MARGIN
menu_margin_x = ${menu_margin_x:-0}
2021-05-10 23:15:51 +02:00
menu_margin_y = ${MENU_MARGIN_Y:-0}
2021-01-12 01:28:26 +01:00
sub_spacing = ${submenu_spacing:-0}
2021-01-19 01:16:01 +01:00
menu_width = ${JGWIDTH:-40}
2020-01-21 23:00:04 +01:00
menu_height_min = ${MENU_HEIGHT_MIN:-0}
menu_height_max = ${MENU_HEIGHT_MAX:-0}
2020-03-06 14:23:50 +01:00
menu_padding_top = ${MENU_PADDING_TOP:-70}
2021-01-14 19:01:40 +01:00
menu_padding_right = ${jgtools_padding:-0}
menu_padding_bottom = ${jgtools_padding:-0}
menu_padding_left = ${jgtools_padding:-0}
2021-01-12 15:54:11 +01:00
menu_radius = ${MENU_RADIUS:-0}
2020-01-21 23:00:04 +01:00
menu_valign = ${MENU_VALIGN:-top}
2020-02-09 16:52:47 +01:00
menu_halign = ${MENU_HALIGN:-left}
2020-01-21 23:00:04 +01:00
2020-03-06 14:23:50 +01:00
item_height = ${jgmenu_item_height:-20}
2020-02-11 15:19:56 +01:00
item_halign = ${ITEM_HALIGN:-left}
2021-01-12 01:28:26 +01:00
item_padding_x = 4
item_margin_x = ${item_margin_x:-0}
2021-01-15 00:18:35 +01:00
item_margin_y = ${item_margin_y:-2}
2020-02-16 19:40:48 +01:00
item_radius = ${item_radius:-2}
item_border = ${item_border:-0}
2020-02-11 15:19:56 +01:00
arrow_string = ${ARROW_STRING:-⮞}
2020-01-21 23:00:04 +01:00
2021-01-12 01:28:26 +01:00
columns = ${COLUMNS:-1}
2021-01-12 19:14:32 +01:00
menu_gradient_pos = ${menu_gradient_pos:-none}
2020-02-15 23:27:35 +01:00
color_menu_bg = ${color_menu_bg:-#222222 80}
2021-01-12 01:28:26 +01:00
color_menu_bg_to = ${color_menu_bg_to:- #000000 100}
2020-02-17 01:17:24 +01:00
color_menu_border = ${color_menu_border:-#2f9b85 100}
2020-02-15 23:27:35 +01:00
color_norm_bg = ${color_norm_bg:-#000000 0}
color_norm_fg = ${color_norm_fg:-#CCCCCC 100}
color_sel_bg = ${color_sel_bg:-#169f6f 60}
color_sel_fg = ${color_sel_fg:-#f8f8f8 100}
color_sel_border = ${color_sel_border:-#504e65 100}
color_sep_fg = ${color_sep_fg:-#4D4D4D 100}
2021-02-02 23:08:24 +01:00
color_sep_bg = ${color_sep_bg:-#169f6f 100}
2020-02-16 19:40:48 +01:00
color_title_fg = ${color_title_fg:-#4D4D4D 100}
2020-02-17 17:14:08 +01:00
color_title_border = ${color_title_border:-#169f6f 100}
2021-02-02 23:08:24 +01:00
color_title_bg = ${color_title_bg:-#169f6f 100}
color_scroll_ind = ${color_scroll_ind:-#504e65 100}
2020-02-16 01:51:13 +01:00
2020-02-17 19:18:20 +01:00
sep_markup = weight="bold" foreground="${color_title_fg% *}"
2021-01-19 01:16:01 +01:00
sep_halign = ${sep_halign:-center}
2020-03-06 14:23:50 +01:00
sep_height = ${sep_height:-5}
2020-03-02 23:32:09 +01:00
font = ${jgmenu_font:-Noto Sans Medium 9}
2021-01-15 00:18:35 +01:00
icon_size = ${jgmenu_icon_size:-18}
2020-08-24 10:11:11 +02:00
icon_theme = ${jgmenu_icon_theme:-Numix-Square}
2020-01-21 23:00:04 +01:00
EOF
2020-02-17 01:17:24 +01:00
2020-02-17 19:18:20 +01:00
unset font
2021-01-12 19:14:32 +01:00
unset menu_gradient_pos
2020-01-21 23:00:04 +01:00
}
2020-01-28 23:28:23 +01:00
#MENU GŁÓWNE
main() {
2021-01-12 15:54:11 +01:00
mb-setvar jgtools_last="\"main ipc\""
2020-08-29 15:40:13 +02:00
2020-01-28 23:28:23 +01:00
CONFIG_FILE=$(mktemp)
2021-01-14 19:01:40 +01:00
HEADER_FILE=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${HEADER_FILE}" EXIT
2020-01-28 23:28:23 +01:00
2020-02-12 12:24:04 +01:00
POSITION_MODE=${1:-pointer}
2020-01-28 23:28:23 +01:00
HIDE_BACK_ITEMS=1
2021-01-14 19:01:40 +01:00
#MENU_PADDING_TOP=24
2021-06-01 01:10:06 +02:00
MENU_PADDING_TOP=$((jgtools_padding + 24))
2021-01-27 12:53:11 +01:00
panels_topmargin=0
2021-01-14 19:01:40 +01:00
### write header file to prepend.csv
case $LANG in
2021-01-27 12:53:11 +01:00
pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać"
APPS="Programy";;
es*) TYPE_TO_SEARCH="Buscar"
APPS="Aplicationes";;
*) TYPE_TO_SEARCH="Type to Search"
APPS="Applications";;
2021-01-14 19:01:40 +01:00
esac
2021-01-27 12:53:11 +01:00
#apps_in_submenu=true
if [[ $apps_in_submenu == true ]]
then
sub_lines="$APPS,^checkout(lx-apps),applications-other
. ~/.config/jgmenu/sub-append.csv
^tag(lx-apps)"
[ ! -f ~/.config/jgmenu/sub-append.csv ] && cp ~/.config/jgmenu/append.csv ~/.config/jgmenu/sub-append.csv
rm -f ~/.config/jgmenu/append.csv
else
sub_lines=""
cp ~/.config/jgmenu/sub-append.csv ~/.config/jgmenu/append.csv
fi
2021-01-14 19:01:40 +01:00
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
2021-05-10 23:15:51 +02:00
@text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size="large"></span>
@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i>
2021-01-14 19:01:40 +01:00
^sep()
. ~/.config/mabox/favorites.csv
2021-01-27 12:53:11 +01:00
$sub_lines
2021-01-14 19:01:40 +01:00
EOF
2020-09-02 01:34:07 +02:00
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0
2020-03-06 14:23:50 +01:00
2020-01-28 23:28:23 +01:00
mkconfigfile
2020-03-06 14:23:50 +01:00
2020-01-28 23:28:23 +01:00
jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
2021-01-14 19:01:40 +01:00
2020-01-28 23:28:23 +01:00
}
2020-01-21 23:00:04 +01:00
# PANEL PO PRAWEJ AKTUALIZACE-USTAWIENIA-POMOC
right() {
2021-01-12 15:54:11 +01:00
mb-setvar jgtools_last="\"right\""
2020-01-21 23:00:04 +01:00
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
2020-09-02 01:34:07 +02:00
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0
2021-01-27 12:53:11 +01:00
#BOTTOM_IMG=${right_bottom_img:-/usr/share/mb-jgtools/mabox_3D_gold.png}
2020-02-09 16:52:47 +01:00
MENU_HALIGN="right"
2020-02-20 01:37:06 +01:00
ITEM_HALIGN="left"
2020-02-11 15:19:56 +01:00
ARROW_STRING=" ⮜ "
2021-01-12 01:28:26 +01:00
JGWIDTH=40
2020-02-23 16:19:32 +01:00
TABS="100"
2021-05-10 23:15:51 +02:00
MENU_PADDING_TOP=$((jgtools_padding + 70))
2021-01-14 19:01:40 +01:00
menu_margin_x=${submenu_spacing:-0}
2021-05-10 23:15:51 +02:00
#panels_topmargin=${panels_topmargin:-0}
#### Compact or full height
if [[ $panels_heightpos == "full" ]]; then
eval $(xdotool getdisplaygeometry --shell)
MENU_HEIGHT_MIN="$HEIGHT"
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
MENU_RADIUS="0"
menu_margin_x="0"
elif [[ $panels_heightpos == "top" ]]; then
MENU_VALIGN="top"
MENU_MARGIN_Y=${panels_topmargin:-0}
elif [[ $panels_heightpos == "bottom" ]]; then
MENU_VALIGN="bottom"
MENU_MARGIN_Y=${panels_topmargin:-0}
else
MENU_VALIGN="center"
fi
2020-01-21 23:00:04 +01:00
2020-02-23 16:19:32 +01:00
case $LANG in
pl*)
TYPE_TO_SEARCH="pisz, aby wyszukać"
SOFT_MANAGEMENT="Zarządzanie oprogramowaniem"
PAMAC_UPDATE="Aktualizacja systemu (Pamac)"
CLI_UPDATE="Aktualizacja systemu (cli)"
PAMAC="Menadżer pakietów - Pamac"
RENEW_KEYS="Odnawianie kluczy"
MIRROR_RANK="Ranking mirrorów"
SETTINGS="Ustawienia"
MCC="Centrum Sterowania Mabox"
SYS_AND_HARDWARE="System i sprzęt"
LOOK_AND_FEEL="Wygląd i zachowanie"
HELP="Pomoc"
SHORTCUTS="Skróty klawiszowe"
ONLINE_RES="Zasoby online"
OTHER="Inne"
SCREENSHOT="Zrzut ekranu"
BACK="wróć"
FAST="Szybko"
ALL="Wszystkie"
GEOIP="Najbliższe"
2020-09-09 20:15:49 +02:00
MSM="Menadżer Ustawień Manjaro"
2020-02-23 16:19:32 +01:00
LOCALE_SETTINGS="Język i formaty"
LANGUAGE_PACKAGES="Pakiety językowe"
KERNEL="Jądro systemowe"
USER_ACCOUNTS="Konta użytkowników"
TIME_DATE="Data i Czas"
KEYBOARD="Ustawienia klawiatury"
HARDWARE="Konfiguracja sprzętowa"
2020-09-09 20:15:49 +02:00
ARANDR="Rozdzielczość ekranu"
2020-09-27 09:51:09 +02:00
SYSINFO_TITLE="Sys info"
2020-09-17 12:16:41 +02:00
SYSINFO="Informacje o systemie"
2020-02-23 16:19:32 +01:00
LXAPPEARANCE="Wystrój i ikony"
NITROGEN="Wybór tapety"
OBCONF="Menadżer konfiguracji OpenBox"
NOTIFYD="Konfiguracja powiadomień"
PREFERRED_APPS="Preferowane aplikacje"
LIGHTDM="Ustawienia Menedżera logowania"
POWER_MNGR="Ustawienia zasilania"
MABOX_DESK_ELEM="Elementy pulpitu Mabox"
TINT2="Panele Tint2"
COMPOSER="Kompozytor"
MABOX_THEMES="Predefiniowane konfiguracje pulpitu"
THEME_MNGR="Menadżer schematów"
2020-08-29 15:40:13 +02:00
UGUIDE_TITLE="Przewodnik Użytkownika Mabox"
2020-08-05 11:34:28 +02:00
UGUIDE=". /usr/share/mb-jgtools/userguide_PL.csv"
2020-02-23 16:19:32 +01:00
;;
es*)
TYPE_TO_SEARCH="Buscar"
SOFT_MANAGEMENT="Agregar/Quitar Software"
PAMAC_UPDATE="Actualizar el sistema(Tienda)"
CLI_UPDATE="Actualizar en la terminal (cli)"
PAMAC="Tienda de software"
RENEW_KEYS="Actualizar atajos de teclado"
MIRROR_RANK="Actualizar repositorios"
SETTINGS="Ajustes"
MCC="Centro de Control Mabox"
SYS_AND_HARDWARE="Sistema y Hardware"
LOOK_AND_FEEL="Apariencia"
HELP="Ayuda"
SHORTCUTS="Atajos del teclado"
ONLINE_RES="Recursos en línea"
OTHER="Otros"
SCREENSHOT="Captura Pantalla"
BACK="atrás"
FAST="Repositorios rápidos"
ALL="Todos los repositorios"
GEOIP="Repositorios locales"
2020-09-09 20:15:49 +02:00
MSM="Gastor de Configuración de Manjaro"
LOCALE_SETTINGS="Ajustes de idioma"
LANGUAGE_PACKAGES="Paquetes de idioma"
KERNEL="Núcleo"
USER_ACCOUNTS="Cuentas de usuario"
TIME_DATE="Hora y Fecha"
KEYBOARD="Ajustes del teclado"
HARDWARE="Configuración Hardware"
2020-09-09 20:15:49 +02:00
ARANDR="Resolución de pantalla"
2020-09-27 09:51:09 +02:00
SYSINFO_TITLE="Resumen sistema"
SYSINFO="Información de sistema"
LXAPPEARANCE="Temas e íconos"
NITROGEN="Fondos de pantalla"
OBCONF="Configuración de Openbox"
NOTIFYD="Notificaciones"
PREFERRED_APPS="Aplicaciones Preferidas"
LIGHTDM="Gestor de Inicio de sesión"
POWER_MNGR="Ajustes de energía"
MABOX_DESK_ELEM="Escritorio Mabox"
TINT2="Paneles Tint2"
COMPOSER="Compositor gráfico"
MABOX_THEMES="Temas Mabox"
THEME_MNGR="Gestor de Temas"
2020-08-29 15:40:13 +02:00
UGUIDE_TITLE="Mabox User Guide"
UGUIDE=". /usr/share/mb-jgtools/userguide.csv"
;;
2020-02-23 16:19:32 +01:00
*)
TYPE_TO_SEARCH="type to search"
SOFT_MANAGEMENT="Software management"
PAMAC_UPDATE="System update (Pamac)"
CLI_UPDATE="System update (cli)"
PAMAC="Pamac"
RENEW_KEYS="Renew keys"
MIRROR_RANK="Mirror ranking"
SETTINGS="Settings"
MCC="Mabox Control Center"
SYS_AND_HARDWARE="System and Hardware"
LOOK_AND_FEEL="Look and Feel"
HELP="Help"
SHORTCUTS="Keyboard Shortcuts"
ONLINE_RES="Online Resources"
OTHER="Other"
SCREENSHOT="Screenshot Tool"
BACK="back"
FAST="Fasttrack"
ALL="All"
GEOIP="Geoip"
2020-09-09 20:15:49 +02:00
MSM="Manjaro Settings Manager"
2020-02-23 16:19:32 +01:00
LOCALE_SETTINGS="Locale Settings"
LANGUAGE_PACKAGES="Language Packages"
KERNEL="Kernel"
USER_ACCOUNTS="User Accounts"
TIME_DATE="Time and Date"
KEYBOARD="Keyboard Settings"
HARDWARE="Hardware Configuration"
2020-09-09 20:15:49 +02:00
ARANDR="Screen resolution"
2020-09-27 09:51:09 +02:00
SYSINFO_TITLE="Sys info"
2020-09-17 12:16:41 +02:00
SYSINFO="System information"
2020-02-23 16:19:32 +01:00
LXAPPEARANCE="Themes and icons"
NITROGEN="Wallpaper"
OBCONF="Openbox Configuration Manager"
NOTIFYD="Notifycations"
PREFERRED_APPS="Preffered Applications"
LIGHTDM="Login Manager Settings"
POWER_MNGR="Power Manager"
MABOX_DESK_ELEM="Mabox Desktop"
TINT2="Tint2 Panel(s)"
COMPOSER="Composer"
MABOX_THEMES="Mabox Themes"
THEME_MNGR="Theme Manager"
2020-08-29 15:40:13 +02:00
UGUIDE_TITLE="Mabox User Guide"
2020-08-05 11:34:28 +02:00
UGUIDE=". /usr/share/mb-jgtools/userguide.csv"
2020-02-23 16:19:32 +01:00
;;
esac
2020-01-21 23:00:04 +01:00
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
2021-05-10 23:15:51 +02:00
@icon,,$((jgtools_padding + 10)),$((jgtools_padding + 10)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
2021-01-19 01:16:01 +01:00
#@text,,$(expr $jgtools_padding + 65),$(expr $jgtools_padding + 10),200,20,4,left,top,${color_sel_fg% *},#111111,<big>$OSNAME $OSVERSION</big> <sup><i>$OSCODE</i></sup>
2021-05-10 23:15:51 +02:00
@text,,$((jgtools_padding + 65)),$((jgtools_padding + 10)),200,20,4,left,top,auto,#111111,<big>$OSNAME $OSVERSION</big> <sup><i>$OSCODE</i></sup>
@text,,$((jgtools_padding + 65)),$((jgtools_padding + 30)),200,20,4,left,top,auto,#444444,<small>$USER@$HOSTNAME</small>
2021-01-14 20:04:25 +01:00
#@icon,,5,$(expr $MENU_HEIGHT_MIN - 180),240,180,4,center,top,,,$BOTTOM_IMG
2021-05-10 23:15:51 +02:00
@search,,$((gtools_padding + 80)),$((jgtools_padding + 50)),292,20,4,left,top,auto,#262626,"""<big></big> <small><i>$TYPE_TO_SEARCH</i></small>"""
2020-01-21 23:00:04 +01:00
2020-02-02 17:51:13 +01:00
. $HOME/.config/mabox/right-prepend.csv
2020-02-03 20:50:31 +01:00
2020-08-29 15:40:13 +02:00
^sep($SETTINGS)
$MCC,mcc,distributor-logo-mabox
^sep()
$SYS_AND_HARDWARE,^root(system),audiocard
$LOOK_AND_FEEL,^root(wyglad),preferences-color
2020-02-23 16:19:32 +01:00
^sep($SOFT_MANAGEMENT)
$PAMAC_UPDATE,pamac-manager --updates,system-upgrade
$CLI_UPDATE,^term(sudo pacman -Syyu),openterm
$PAMAC,pamac-manager,pamac
$RENEW_KEYS,^term(sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring),keysync
$MIRROR_RANK,^root(mirrory),download
2020-01-21 23:00:04 +01:00
2020-02-23 16:19:32 +01:00
^sep($HELP)
2020-08-29 15:40:13 +02:00
$UGUIDE_TITLE,^root(userguide),distributor-logo-mabox
Mabox Forum,exo-open --launch WebBrowser https://forum.maboxlinux.org,distributor-logo-mabox
2021-08-22 12:13:22 +02:00
#$SHORTCUTS,^pipe(jgkeys-pipe),key_bindings
$SHORTCUTS,mbhelper -s,key_bindings
2020-02-23 16:19:32 +01:00
$ONLINE_RES,^root(weblinks),web-browser
2020-01-21 23:00:04 +01:00
2020-02-23 16:19:32 +01:00
^sep($OTHER)
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
2020-02-20 01:37:06 +01:00
. $HOME/.config/mabox/right-append.csv
. $HOME/.config/mabox/exit.csv
2020-01-21 23:00:04 +01:00
^tag(system)
2020-08-29 15:40:13 +02:00
^sep($SETTINGS)
$MCC,mcc,distributor-logo-mabox
2020-02-23 16:19:32 +01:00
^sep($SYS_AND_HARDWARE)
2020-09-09 20:15:49 +02:00
$MSM,manjaro-settings-manager,distributor-logo-manjaro
2020-08-29 15:40:13 +02:00
^sep()
2020-03-01 02:10:22 +01:00
$LOCALE_SETTINGS,manjaro-settings-manager -m msm_locale,chronometer
$LANGUAGE_PACKAGES,manjaro-settings-manager -m msm_language_packages,globe
2020-02-23 16:19:32 +01:00
$KERNEL,manjaro-settings-manager -m msm_kernel,distributor-logo-linux
$USER_ACCOUNTS,manjaro-settings-manager -m msm_users,system-config-users
$TIME_DATE,manjaro-settings-manager -m msm_timedate,system-config-date
$KEYBOARD,manjaro-settings-manager -m msm_keyboard,preferences-desktop-keyboard
$HARDWARE,manjaro-settings-manager -m msm_mhwd,preferences-desktop-peripherals-directory
2020-09-09 20:15:49 +02:00
^sep()
$ARANDR,arandr,monitor
2020-09-27 09:51:09 +02:00
^sep($SYSINFO_TITLE)
2020-09-17 12:16:41 +02:00
$SYSINFO,^pipe(jgsysinfo-pipe),distributor-logo-linux
2020-08-29 15:40:13 +02:00
CPU-X,cpu-x,cpu-x
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-01-21 23:00:04 +01:00
^tag(mirrory)
2020-02-23 16:19:32 +01:00
$FAST <small>pacman-mirrors -f5</small>,^term(sudo pacman-mirrors -f5)
$ALL <small>pacman-mirrors -i -c all</small>,^term(sudo pacman-mirrors -i -c all)
$GEOIP <small>pacman-mirrors -i --geoip</small>,^term(sudo pacman-mirrors -i --geoip)
2020-02-17 17:14:08 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-01-21 23:00:04 +01:00
^tag(wyglad)
2020-08-29 15:40:13 +02:00
. ~/.config/mabox/settings.csv
2020-02-17 17:14:08 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-08-29 15:40:13 +02:00
. ~/.config/mabox/settings_tags.csv
2020-01-21 23:00:04 +01:00
2020-08-29 15:40:13 +02:00
^tag(userguide)
$UGUIDE
^sep()
⮜ $BACK,^back()
2020-01-30 01:02:29 +01:00
^tag(weblinks)
2021-02-06 14:46:30 +01:00
#^sep($ONLINE_RES)
^sep(Mabox Linux)
Mabox Website,exo-open --launch WebBrowser https://maboxlinux.org/,distributor-logo-mabox
Mabox Forum,exo-open --launch WebBrowser https://forum.maboxlinux.org/,distributor-logo-mabox
2020-01-30 01:02:29 +01:00
^sep(Manjaro)
2020-03-06 14:23:50 +01:00
Stable Updates,exo-open --launch WebBrowser https://forum.manjaro.org/c/announcements/stable-updates/,distributor-logo-manjaro
2020-03-07 18:12:14 +01:00
Manjaro Wiki,exo-open --launch WebBrowser https://wiki.manjaro.org,distributor-logo-manjaro
Manjaro Forum,exo-open --launch WebBrowser https://forum.manjaro.org,distributor-logo-manjaro
2021-01-12 01:28:26 +01:00
Branch Compare,exo-open --launch WebBrowser https://manjaro.org/branch-compare/,distributor-logo-manjaro
2020-01-30 01:02:29 +01:00
^sep(ArchLinux)
2020-02-20 01:37:06 +01:00
ArchWiki,exo-open --launch WebBrowser https://wiki.archlinux.org/,distributor-logo-archlinux
2021-01-14 20:04:25 +01:00
Manual pages indexing service,exo-open --launch WebBrowser https://man.archlinux.org/,distributor-logo-archlinux
2020-01-30 01:02:29 +01:00
^sep(Openbox)
2020-02-22 17:01:00 +01:00
OpenBox,exo-open --launch WebBrowser http://openbox.org/wiki/Help:Contents,openbox
OpenBox ArchWiki,exo-open --launch WebBrowser https://wiki.archlinux.org/index.php/Openbox,openbox
2020-03-07 18:12:14 +01:00
^sep(Jgmenu)
Jgmenu homesite,exo-open --launch WebBrowser https://jgmenu.github.io/,jgmenu
Jgmenu GitHub,exo-open --launch WebBrowser https://github.com/johanmalm/jgmenu,jgmenu
2021-01-14 20:04:25 +01:00
^sep(Terminator)
Terminator GitHub,exo-open --launch WebBrowser https://gnome-terminator.github.io/,terminator
Terminator Docs,exo-open --launch WebBrowser https://gnome-terminator.readthedocs.io/en/latest/,terminator
2020-03-07 18:12:14 +01:00
^sep(Tint2)
Tint2 GitLab,exo-open --launch WebBrowser https://gitlab.com/o9000/tint2,tint2
2020-02-22 17:01:00 +01:00
Tint2 ArchWiki,exo-open --launch WebBrowser https://wiki.archlinux.org/index.php/Tint2,tint2
2020-03-07 18:12:14 +01:00
^sep(Conky)
2020-02-22 17:01:00 +01:00
Conky Doc,exo-open --launch WebBrowser http://conky.sourceforge.net/documentation.html,conky
Conky Github,exo-open --launch WebBrowser https://github.com/brndnmtthws/conky/wiki,conky
Conky ArchWiki,exo-open --launch WebBrowser https://wiki.archlinux.org/index.php/Conky,conky
2020-03-07 18:12:14 +01:00
2020-08-05 11:34:28 +02:00
#. $HOME/.config/mabox/online-resources.csv
2020-02-17 17:14:08 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-02-03 20:50:31 +01:00
2020-01-21 23:00:04 +01:00
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
places() {
2021-01-12 15:54:11 +01:00
mb-setvar jgtools_last="\"places\""
2020-01-21 23:00:04 +01:00
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
2021-02-06 14:46:30 +01:00
QNAV=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS} ${QNAV}" EXIT
2020-01-21 23:00:04 +01:00
2020-02-22 17:01:00 +01:00
case $LANG in
pl*)
QUICK_NAV="Szybka nawigacja"
HOME_DIR="Katalog Domowy"
ROOTDIR="Katalog główny"
2021-05-23 10:28:16 +02:00
PIPEMENUS="Narzędzia"
2020-09-17 12:16:41 +02:00
POPINSTALL="Instaluj popularne programy"
SYSINFO="Informacje o systemie"
SHORTCUTS="Skróty klawiszowe"
2021-01-15 13:25:27 +01:00
MENUPANELS="Ustawienia Menu/Paneli"
2021-02-06 14:46:30 +01:00
TINT2SETTINGS="Ustawienia panelu Tint2"
2021-05-10 23:15:51 +02:00
CONKYSETTINGS="Ustawienia Conky"
2021-01-27 12:53:11 +01:00
SSH_CONN="Połącz po SSH"
2021-05-22 01:59:46 +02:00
DESKMNGR="Desktop Session Manager"
DESKTOPS="Pulpity i Okna"
2021-06-01 01:10:06 +02:00
DESKGRID="DesktopGrid"
2021-05-30 12:25:24 +02:00
WALLCHANGER="Tapeta i Blokada Ekranu"
2021-06-01 01:10:06 +02:00
MBHELPER="Paleta komend <b>W-F1</b>"
2020-02-22 17:01:00 +01:00
;;
es*)
2020-08-29 15:40:13 +02:00
QUICK_NAV="Navegación rápida"
HOME_DIR="Carpeta personal"
ROOTDIR="Directorio raíz"
2020-09-27 09:51:09 +02:00
PIPEMENUS="Menu con extras"
2020-09-17 12:16:41 +02:00
POPINSTALL="Instalar Programas populares"
SYSINFO="System information"
SHORTCUTS="Atajos del teclado"
2021-01-15 13:25:27 +01:00
MENUPANELS="Menu/Paneles laterales"
2021-02-06 14:46:30 +01:00
TINT2SETTINGS="Tint2 panel settings"
2021-05-10 23:15:51 +02:00
CONKYSETTINGS="Conky settings"
SSH_CONN="Conexiones SSH"
2021-05-22 01:59:46 +02:00
DESKMNGR="Desktop Session Manager"
DESKTOPS="Desktops and Windows"
DESKGRID="Desktop Grid"
2021-05-30 01:52:39 +02:00
WALLCHANGER="Wallpaper and ScreenLocker"
2021-05-30 12:25:24 +02:00
MBHELPER="Cmd palette (search and run) <b>W-F1</b>"
2020-08-29 15:40:13 +02:00
;;
2020-02-22 17:01:00 +01:00
*)
QUICK_NAV="Quick Navigation"
HOME_DIR="Home Directory"
ROOTDIR="Main Directory"
2021-05-23 10:28:16 +02:00
PIPEMENUS="Mabox Tools"
2020-09-17 12:16:41 +02:00
POPINSTALL="Install popular apps"
SYSINFO="System information"
SHORTCUTS="Keyboard shortcuts"
2021-01-15 13:25:27 +01:00
MENUPANELS="Menu/Sidepanels settings"
2021-02-06 14:46:30 +01:00
TINT2SETTINGS="Tint2 panel settings"
2021-05-10 23:15:51 +02:00
CONKYSETTINGS="Conky settings"
SSH_CONN="SSH connections"
2021-05-22 01:59:46 +02:00
DESKMNGR="Desktop Session Manager"
DESKTOPS="Desktops and Windows"
2021-06-01 01:10:06 +02:00
DESKGRID="DesktopGrid"
2021-05-30 01:52:39 +02:00
WALLCHANGER="Wallpaper and ScreenLocker"
2021-05-30 12:25:24 +02:00
MBHELPER="Cmd palette (search and run) <b>W-F1</b>"
2020-02-22 17:01:00 +01:00
;;
esac
2021-01-12 01:28:26 +01:00
2021-05-10 23:15:51 +02:00
#panels_topmargin=${panels_topmargin:-0}
2021-01-14 19:01:40 +01:00
menu_margin_x=${submenu_spacing:-0}
2021-01-27 12:53:11 +01:00
[ $panels_topmargin == 0 ] && menu_margin_x=0
2021-05-10 23:15:51 +02:00
#### Compact or full height
if [[ $panels_heightpos == "full" ]]; then
2021-01-12 15:54:11 +01:00
eval $(xdotool getdisplaygeometry --shell)
2021-05-10 23:15:51 +02:00
MENU_HEIGHT_MIN="$HEIGHT"
2021-01-12 01:28:26 +01:00
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
2021-05-10 23:15:51 +02:00
MENU_RADIUS="0"
menu_margin_x="0"
elif [[ $panels_heightpos == "top" ]]; then
MENU_VALIGN="top"
MENU_MARGIN_Y=${panels_topmargin:-0}
elif [[ $panels_heightpos == "bottom" ]]; then
MENU_VALIGN="bottom"
MENU_MARGIN_Y=${panels_topmargin:-0}
else
MENU_VALIGN="center"
fi
2021-01-12 01:28:26 +01:00
JGWIDTH=40
2020-03-06 14:23:50 +01:00
jgmenu_icon_size=0
2021-05-10 23:15:51 +02:00
MENU_PADDING_TOP=$((jgtools_padding + 60))
2021-02-06 14:46:30 +01:00
#BOTTOM_IMG=${places_bottom_img:-/usr/share/mb-jgtools/mabox_3D_silver.png}
2020-09-21 17:15:44 +02:00
#if [[ $places_softwarepipe || $places_sysinfopipe || $places_keyspipe ]];then pipeseparator="^sep($PIPEMENUS)";fi
2021-02-06 14:46:30 +01:00
#QUICK NAV
[ -v places_quicknav ] && : || mb-setvar places_quicknav=true
if [ $places_quicknav == true ];then
cat <<EOF > ${QNAV}
^sep($QUICK_NAV)
<tt><big>襁</big></tt> $ROOTDIR,^pipe(jgbrowser /),folder
<tt><big><b>~</b></big></tt> $HOME_DIR,^pipe(jgbrowser),folder-home
<big> </big> $(basename $(xdg-user-dir DOWNLOAD)),^pipe(jgbrowser $(xdg-user-dir DOWNLOAD)),folder-download
<big> </big> $(basename $(xdg-user-dir DOCUMENTS)),^pipe(jgbrowser $(xdg-user-dir DOCUMENTS)),folder-documents
2021-06-09 12:22:59 +02:00
<big>  </big> $(basename $(xdg-user-dir MUSIC)),^pipe(jgbrowser $(xdg-user-dir MUSIC)),folder-music
2021-02-06 14:46:30 +01:00
<big> </big> $(basename $(xdg-user-dir PICTURES)),^pipe(jgbrowser $(xdg-user-dir PICTURES)),folder-pictures
<big> </big> $(basename $(xdg-user-dir VIDEOS)),^pipe(jgbrowser $(xdg-user-dir VIDEOS)),folder-video
EOF
else
QNAV=""
fi
# PIPEMENUS
2021-06-09 12:22:59 +02:00
[ $places_menusettingspipe == true ] && menusettingspipe="<big>襁</big> $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-28 02:47:06 +02:00
[ $places_tint2pipe == true ] && tint2pipe="<big></big> $TINT2SETTINGS,^pipe(jgtint2-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-01-12 01:28:26 +01:00
[ $places_sysinfopipe == true ] && sysinfopipe="<big></big> $SYSINFO,^pipe(jgsysinfo-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-30 12:25:24 +02:00
#[ $places_keyspipe == true ] && keyspipe="<big></big> $SHORTCUTS,^pipe(jgkeys-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-04-16 19:15:47 +02:00
[ $places_sshpipe == true ] && sshpipe="<big></big> $SSH_CONN,^pipe(jgssh -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-22 01:59:46 +02:00
[ $places_softwarepipe == true ] && softwarepipe="<big></big> $POPINSTALL,^pipe(jgsoftware-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-28 02:47:06 +02:00
[[ $places_conkypipe == true || -z ${places_conkypipe} ]] && conkypipe="<big></big> $CONKYSETTINGS,^pipe(jgconky-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2021-06-09 12:22:59 +02:00
[[ $places_jgdeskmngr == true || -z ${places_jgdeskmngr} ]] && jgdeskmngr="<big></big> $DESKMNGR,^pipe(jgdeskmngr -r)" && pipesep="^sep($PIPEMENUS)"
[[ $places_jgdesktops == true || -z ${places_jgdesktops} ]] && jgdesktops="<big></big> $DESKTOPS,^pipe(jgdesktops -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-22 01:59:46 +02:00
[[ $places_jgdeskgrid == true || -z ${places_jgdeskgrid} ]] && jgdeskgrid="<big></big> $DESKGRID,^pipe(jgdeskgrid -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-30 01:52:39 +02:00
[[ $places_jgwallpaperchanger == true || -z ${places_jgwallpaperchanger} ]] && jgwallpaperchanger="<big></big> $WALLCHANGER,^pipe(jgwallpaperchanger -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-28 02:47:06 +02:00
2021-02-06 14:46:30 +01:00
# VBOXES
2021-05-22 01:59:46 +02:00
[[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes=""
2020-01-21 23:00:04 +01:00
2021-02-06 14:46:30 +01:00
mkconfigfile
2020-01-21 23:00:04 +01:00
cat <<EOF > ${MENU_ITEMS}
2021-05-10 23:15:51 +02:00
@icon,,$((jgtools_padding + 10)),$((jgtools_padding + 10)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
2021-05-22 01:59:46 +02:00
#@icon,,10,$((MENU_HEIGHT_MIN - 160)),240,180,4,center,top,,,$BOTTOM_IMG
2021-05-10 23:15:51 +02:00
@text,,$((jgtools_padding + 70)),$((jgtools_padding + 10)),200,20,4,left,top,auto,#111111,<big>$OSNAME $OSVERSION</big> <sup><i>$OSCODE</i></sup>
@text,,$((jgtools_padding + 70)),$((jgtools_padding + 30)),200,20,4,left,top,auto,#444444,<small>$USER@$HOSTNAME</small>
2020-01-21 23:00:04 +01:00
2020-02-07 15:03:27 +01:00
. $HOME/.config/mabox/places-prepend.csv
2021-02-06 14:46:30 +01:00
. ${QNAV}
2020-03-07 18:12:14 +01:00
2020-02-11 15:19:56 +01:00
$(gtkbookmarks)
2020-09-21 17:15:44 +02:00
$pipesep
2021-05-30 12:25:24 +02:00
<big></big> $MBHELPER,mbhelper -s
2021-05-28 02:47:06 +02:00
$menusettingspipe
2021-05-30 01:52:39 +02:00
$jgwallpaperchanger
2021-05-22 01:59:46 +02:00
$jgdesktops
$jgdeskmngr
$jgdeskgrid
2020-09-17 12:16:41 +02:00
$sysinfopipe
2021-01-27 12:53:11 +01:00
$sshpipe
2021-01-17 19:06:09 +01:00
$softwarepipe
2021-02-14 13:39:21 +01:00
$tint2pipe
2021-05-10 23:15:51 +02:00
$conkypipe
2021-01-12 01:28:26 +01:00
2021-02-06 14:46:30 +01:00
${vboxes}
2020-02-07 15:03:27 +01:00
. $HOME/.config/mabox/places-append.csv
2020-01-21 23:00:04 +01:00
EOF
2021-02-06 14:46:30 +01:00
2020-01-21 23:00:04 +01:00
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
mblogout() {
2020-07-22 17:02:26 +02:00
if [[ -n "$1" ]]
then
POSITION_MODE=${1:-pointer}
else
MENU_HALIGN="center"
MENU_VALIGN="center"
continue
fi
2020-01-21 23:00:04 +01:00
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
2020-07-22 17:02:26 +02:00
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS};#wmctrl -k off" EXIT
2020-02-09 16:52:47 +01:00
2020-02-26 15:15:26 +01:00
case $LANG in
2021-01-12 01:28:26 +01:00
pl*) CANCEL="Anuluj";;
es*) CANCEL="Cancelar";;
*) CANCEL="Cancel";;
2020-02-26 15:15:26 +01:00
esac
2021-01-15 11:57:29 +01:00
jgtools_padding=${jgtools_padding:-0}
2021-05-10 23:15:51 +02:00
JGWIDTH=$((jgtools_padding + 348 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 221))
2020-02-20 01:37:06 +01:00
TABS="250"
2020-03-06 14:23:50 +01:00
jgmenu_item_height=30
jgmenu_icon_size=26
#jgmenu_font="Noto Sans Medium 11"
2020-02-01 02:00:57 +01:00
2020-01-21 23:00:04 +01:00
mkconfigfile
2020-07-22 17:02:26 +02:00
#wmctrl -k on
2020-03-03 12:59:50 +01:00
THUMB="$(DISPLAY=:0 scrot -t 340x213 -o $HOME/.config/mabox/mblogout.png -e 'echo $m')"
2020-01-21 23:00:04 +01:00
cat <<EOF > ${MENU_ITEMS}
2021-05-10 23:15:51 +02:00
@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),340,100,4,left,top,,,$THUMB
2021-01-14 19:01:40 +01:00
@icon,,10,10,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
2021-05-10 23:15:51 +02:00
@text,,$((jgtools_padding + 180)),$((jgtools_padding + 170)),220,20,4,left,top,${color_sel_fg% *},${color_sel_bg% *},$OSNAME $OSVERSION <sup> $OSCODE</sup>
@text,,$((jgtools_padding + 180)),$((jgtools_padding + 190)),200,20,4,left,top,${color_norm_fg% *},#DDDDDD,<small>$USER@$HOSTNAME</small>
2020-02-20 18:33:48 +01:00
2020-02-20 01:37:06 +01:00
. $HOME/.config/mabox/exit.csv
2020-01-31 13:54:41 +01:00
^sep()
2021-05-22 13:25:46 +02:00
$CANCEL <small>esc</small>,exit 1,gtk-close
2020-01-21 23:00:04 +01:00
EOF
2020-02-01 02:00:57 +01:00
2020-01-21 23:00:04 +01:00
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
2020-01-28 23:28:23 +01:00
screenshot() {
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
2020-02-22 17:01:00 +01:00
case $LANG in
pl*)
SCRNSHOTS="Zrzuty ekranu"
FULLSCR="Pełny ekran"
ACTIVE_WIN="Aktywne okno"
ACTIVE_WIN_NO_DECOR="Aktywne okno (bez dekoracji)"
SELECTED="Zaznaczony obszar lub okno"
NOW="Teraz"
SEC5="Za 5 sekund"
SEC10="Za 10 sekund"
BACK="wróć"
2020-02-27 01:05:17 +01:00
OPEN_SCR_DIR="Otwórz katalog ze zrzutami ekranu"
2020-02-22 17:01:00 +01:00
CANCEL="Anuluj"
;;
es*)
SCRNSHOTS="Captura Pantalla"
FULLSCR="Pantalla completa"
ACTIVE_WIN="Ventana Activa"
ACTIVE_WIN_NO_DECOR="Ventana Activa (sin decoraciones)"
SELECTED="Seleccionar Área o Ventana"
NOW="Ahora"
SEC5="En 5 segundos"
SEC10="En 10 segundos"
BACK="atrás"
OPEN_SCR_DIR="Abrir carpeta de capturas"
CANCEL="Cancelar"
;;
2020-02-22 17:01:00 +01:00
*)
SCRNSHOTS="Screenshot tool"
FULLSCR="Full screen"
ACTIVE_WIN="Active window"
ACTIVE_WIN_NO_DECOR="Active window (no decorations)"
SELECTED="Selected Area or Window"
NOW="Now"
SEC5="In 5 seconds"
SEC10="In 10 seconds"
BACK="back"
2020-02-27 01:05:17 +01:00
OPEN_SCR_DIR="Open screenshot directory"
2020-02-22 17:01:00 +01:00
CANCEL="Cancel"
;;
esac
2021-01-15 11:57:29 +01:00
jgtools_padding=${jgtools_padding:-0}
2021-05-10 23:15:51 +02:00
JGWIDTH=$((jgtools_padding + 348 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 221))
2020-01-28 23:28:23 +01:00
MENU_HALIGN="center"
MENU_VALIGN="center"
TABS="280"
2020-03-07 18:12:14 +01:00
jgmenu_item_height=28
2020-03-06 14:23:50 +01:00
jgmenu_icon_size=0
2021-01-12 15:54:11 +01:00
#MENU_RADIUS=${RADIUS:-0}
2020-01-28 23:28:23 +01:00
2020-02-27 01:05:17 +01:00
[ -d $(xdg-user-dir PICTURES)/screenshots ] || mkdir -p $(xdg-user-dir PICTURES)/screenshots
2021-02-02 23:08:24 +01:00
IMG="$(xdg-user-dir PICTURES)/screenshots/Mabox_%Y-%m-%d-%H-%M-%s.png"
2020-01-28 23:28:23 +01:00
VIEW="'viewnior $IMG'"
2020-03-03 12:59:50 +01:00
THUMB="$(DISPLAY=:0 scrot -t 340x213 -o $HOME/.config/mabox/jgscrot.png -e 'echo $m')"
2020-01-31 13:54:41 +01:00
2020-01-28 23:28:23 +01:00
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
2021-05-10 23:15:51 +02:00
@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),340,100,4,left,top,,,$THUMB
2020-02-22 17:01:00 +01:00
^sep($SCRNSHOTS)
2020-07-22 17:02:26 +02:00
 $FULLSCR,^root(full)
 $ACTIVE_WIN,^root(window)
 $ACTIVE_WIN_NO_DECOR,^root(borderless)
 $SELECTED,scrot -fs $IMG -e $VIEW
2020-02-22 17:01:00 +01:00
#  Multimonitor, scrot -m $IMG -e $VIEW
2020-02-27 01:05:17 +01:00
^sep()
2020-07-22 17:02:26 +02:00
 $OPEN_SCR_DIR,xdg-open $(xdg-user-dir PICTURES)/screenshots
2020-02-27 01:05:17 +01:00
^sep()
2020-07-22 17:02:26 +02:00
 $CANCEL <small>esc</small>,exit 1
2020-01-28 23:28:23 +01:00
^tag(full)
2020-02-22 17:01:00 +01:00
^sep($FULLSCR )
2020-07-22 17:02:26 +02:00
 $NOW,scrot $IMG -e $VIEW
 $SEC5,scrot -d 5 $IMG -e $VIEW
 $SEC10,scrot -d 10 $IMG -e $VIEW
2020-02-17 19:18:20 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-01-28 23:28:23 +01:00
^tag(window)
2020-02-22 17:01:00 +01:00
^sep($ACTIVE_WIN )
2020-07-22 17:02:26 +02:00
 $NOW,scrot -d 1 -u -b $IMG -e $VIEW
 $SEC5,scrot -d 5 -u -b $IMG -e $VIEW
 $SEC10,scrot -d 10 -u -b $IMG -e $VIEW
2020-02-17 19:18:20 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-01-28 23:28:23 +01:00
^tag(borderless)
2020-02-22 17:01:00 +01:00
^sep($ACTIVE_WIN_NO_DECOR)
2020-07-22 17:02:26 +02:00
 $NOW,scrot -d 1 -u $IMG -e $VIEW
 $SEC5,scrot -d 5 -u $IMG -e $VIEW
 $SEC10,scrot -d 10 -u $IMG -e $VIEW
2020-02-17 19:18:20 +01:00
^sep()
2020-07-26 22:18:43 +02:00
⮜ $BACK,^back()
2020-01-28 23:28:23 +01:00
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
2020-07-22 17:02:26 +02:00
settings() {
2021-01-12 15:54:11 +01:00
mb-setvar jgtools_last="\"settings ipc\""
2020-01-21 23:00:04 +01:00
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
2020-07-22 17:02:26 +02:00
POSITION_MODE=${1:-pointer}
HIDE_BACK_ITEMS=1
2021-01-15 11:57:29 +01:00
MENU_PADDING_TOP=${jgtools_padding:-0}
2021-01-14 19:01:40 +01:00
TABS="90"
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0
2020-08-29 15:40:13 +02:00
#jgmenu_icon_size=20
2020-01-21 23:00:04 +01:00
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
2020-08-29 15:40:13 +02:00
. ~/.config/mabox/settings.csv
. ~/.config/mabox/settings_tags.csv
2020-01-21 23:00:04 +01:00
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
#--------------------------------------------------------------------+
#Color picker, usage: printf $BLD$CUR$RED$BBLU'Hello World!'$DEF |
#-------------------------+--------------------------------+---------+
# Text color | Background color | |
#-----------+-------------+--------------+-----------------+ |
# Base color|Lighter shade| Base color | Lighter shade | |
#-----------+-------------+--------------+-----------------+ |
BLK='\e[30m'; blk='\e[90m'; BBLK='\e[40m'; bblk='\e[100m' #| Black |
RED='\e[31m'; red='\e[91m'; BRED='\e[41m'; bred='\e[101m' #| Red |
GRN='\e[32m'; grn='\e[92m'; BGRN='\e[42m'; bgrn='\e[102m' #| Green |
YLW='\e[33m'; ylw='\e[93m'; BYLW='\e[43m'; bylw='\e[103m' #| Yellow |
BLU='\e[34m'; blu='\e[94m'; BBLU='\e[44m'; bblu='\e[104m' #| Blue |
MGN='\e[35m'; mgn='\e[95m'; BMGN='\e[45m'; bmgn='\e[105m' #| Magenta |
CYN='\e[36m'; cyn='\e[96m'; BCYN='\e[46m'; bcyn='\e[106m' #| Cyan |
WHT='\e[37m'; wht='\e[97m'; BWHT='\e[47m'; bwht='\e[107m' #| White |
#----------------------------------------------------------+---------+
# Effects |
#--------------------------------------------------------------------+
DEF='\e[0m' #Default color and effects |
BLD='\e[1m' #Bold\brighter |
DIM='\e[2m' #Dim\darker |
CUR='\e[3m' #Italic font |
UND='\e[4m' #Underline |
INV='\e[7m' #Inverted |
COF='\e[?25l' #Cursor Off |
CON='\e[?25h' #Cursor On |
#--------------------------------------------------------------------+
case "$1" in
2020-02-12 12:24:04 +01:00
main) main "$2";;
2020-01-21 23:00:04 +01:00
right) right;;
2020-07-22 17:02:26 +02:00
mblogout) mblogout "$2";;
settings) settings "$2";;
2020-01-28 23:28:23 +01:00
screenshot) screenshot;;
2020-07-22 17:02:26 +02:00
places) places;;
2020-01-21 23:00:04 +01:00
*)
echo -e "
2020-01-28 23:28:23 +01:00
${GRN}Kolekcja narzędzi dla Mabox-a stworzonych z pomocą Jgmenu
2020-01-21 23:00:04 +01:00
Użycie:
${DEF} $(basename "$0")${YLW} [${RED} OPCJA${YLW} ]
${GRN} Opcje:
2020-01-28 23:28:23 +01:00
${YLW} >${RED} main ${YLW} -${DEF} main menu - replaces OB menu
2020-07-22 17:02:26 +02:00
${YLW} >${RED} settings ${YLW} -${DEF} settings menu
${YLW} >${RED} right ${YLW} -${DEF} right panel
${YLW} >${RED} places ${YLW} -${DEF} places - left sidepanel
2020-01-21 23:00:04 +01:00
${YLW} >${RED} mblogout ${YLW} -${DEF} run logout script
2020-01-28 23:28:23 +01:00
${YLW} >${RED} screenshot ${YLW} -${DEF} run screenshot script
2020-01-21 23:00:04 +01:00
" >&2
exit 1
;;
esac
exit 0