mb-jgtools/bin/mb-jgtools

1259 lines
42 KiB
Plaintext
Raw Permalink Normal View History

2022-05-11 01:35:47 +02:00
#!/bin/bash
2020-08-29 15:40:13 +02:00
#
# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox
2024-02-22 11:33:02 +01:00
# Copyright (C) 2019-2024 Daniel Napora <napcok@gmail.com>
2021-01-14 19:01:40 +01:00
2023-05-26 23:03:09 +02:00
on_exit(){
MSG=$(xdotool getmouselocation --shell)
notify-send.sh "Position" "${MSG}"
}
. $HOME/.config/mabox/mabox.conf
2020-02-23 00:51:41 +01:00
jgmenu_theme=${jgmenu_theme:-obtheme}
menu_font_size=${menu_font_size:-9}
menu_font_family=${menu_font_family:-Noto Sans Medium}
jgmenu_font="${menu_font_family} ${menu_font_size}"
2022-05-14 01:43:22 +02:00
# TEMPORARY
[[ -v menu_sep_font_family ]] && : || mb-setvar "menu_sep_font_family='Noto Sans Bold'"
[[ -v menu_sep_font_size ]] && : || mb-setvar menu_sep_font_size=10
[[ -v item_height_factor ]] && : || mb-setvar item_height_factor=200
2023-09-01 23:05:03 +02:00
[[ -v arrow_string ]] && : || mb-setvar "arrow_string=''"
[[ -v arrow_string_left ]] && : || mb-setvar "arrow_string_left=''"
2022-05-11 01:35:47 +02:00
#menu title/sep font
2022-05-14 01:43:22 +02:00
menu_sep_font_size=${menu_sep_font_size:-10}
2022-05-11 01:35:47 +02:00
menu_sep_font_family=${menu_sep_font_family:-Noto Sans Bold}
menu_sep_font="${menu_sep_font_family} ${menu_sep_font_size}"
2022-05-14 01:43:22 +02:00
item_height_factor=${item_height_factor:-200}
2021-10-02 23:57:01 +02:00
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
2023-01-19 01:32:14 +01:00
BOOKMARKS="$HOME/.config/gtk-3.0/bookmarks"
2021-02-06 14:46:30 +01:00
if [[ -s "$BOOKMARKS" ]]; then
case $LANG in
pl*) GTK_BOOKMARKS="Zakładki";;
es*) GTK_BOOKMARKS="Marcadores" ;;
2023-07-23 01:02:35 +02:00
de*) GTK_BOOKMARKS="Lesezeichen" ;;
2021-02-06 14:46:30 +01:00
*) GTK_BOOKMARKS="Bookmarks" ;;
esac
while read -r line
do
2023-07-23 01:02:35 +02:00
case $line in
file*)
2021-02-06 14:46:30 +01:00
uri=$(echo $line | cut -b 8- | cut -d' ' -f1 | sed 's/%20/ /g')
dirs+=(" ${line#* },^pipe(jgbrowser \"${uri}\")")
2023-07-23 01:02:35 +02:00
;;
sftp*)
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
label=$(echo $line | cut -d' ' -f2 | sed 's/%20/ /g')
dirs+=("󰡰 ${label}, pcmanfm -n ${uri}")
;;
smb*)
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
label=$(echo $line | cut -d' ' -f2 | sed 's/%20/ /g')
dirs+=("󰡰 ${label}, pcmanfm -n ${uri}")
;;
esac
2021-02-06 14:46:30 +01:00
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}')
2022-11-09 23:12:22 +01:00
#OSCODE=$(lsb_release -c | awk '{print $2}')
OSCODE=$(grep CODENAME /etc/lsb-release |cut -d '=' -f2)
2020-01-21 23:00:04 +01:00
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
2022-04-17 00:36:25 +02:00
item_height = $((menu_font_size*item_height_factor/100))
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}
2022-05-09 01:11:05 +02:00
item_margin_y = ${item_margin_y:-1}
2020-02-16 19:40:48 +01:00
item_radius = ${item_radius:-2}
item_border = ${item_border:-0}
2023-09-02 00:59:46 +02: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
2022-05-11 01:35:47 +02:00
sep_markup = font='${menu_sep_font:-${jgmenu_font}}'
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}
2022-04-17 00:36:25 +02:00
2023-09-01 23:05:03 +02:00
icon_size = $((icons*menu_font_size*item_height_factor/100))
2022-04-17 00:36:25 +02:00
icon_norm_alpha = 70
icon_sel_alpha = 100
2022-05-11 01:35:47 +02:00
2022-06-05 11:41:36 +02:00
icon_text_spacing = $((iconmargin+8))
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
2021-10-02 23:57:01 +02:00
case $jgmenu_theme in
default)
;;
obtheme)
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")
if [ ! -f "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc" ]; then
obtheme2jgmenu
fi
cat "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc" >> $CONFIG_FILE
;;
*)
cat "$HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc" >> $CONFIG_FILE
;;
esac
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-09-12 18:36:25 +02:00
trap "rm -f ${CONFIG_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
2023-05-03 15:58:42 +02:00
2021-01-27 12:53:11 +01:00
panels_topmargin=0
2021-01-14 19:01:40 +01:00
case $LANG in
2021-01-27 12:53:11 +01:00
pl*) TYPE_TO_SEARCH="Pisz aby Wyszukać"
2021-09-12 18:36:25 +02:00
APPS="Programy"
2021-11-10 09:56:09 +01:00
KEYS="Skróty klawiszowe"
2021-09-12 18:36:25 +02:00
SCREENSHOT="Zrzut ekranu"
LOCKSCR="Zablokuj ekran"
2021-11-10 09:56:09 +01:00
EXIT="Wyjście..."
2021-09-12 18:36:25 +02:00
HELP="Pomoc"
UGUIDE="Przewodnik Mabox (online)"
SETTINGS="ustawienia"
;;
2021-01-27 12:53:11 +01:00
es*) TYPE_TO_SEARCH="Buscar"
2021-09-12 18:36:25 +02:00
APPS="Aplicationes"
KEYS="Atajos del teclado"
SCREENSHOT="Capturar Pantalla"
LOCKSCR="Bloquear pantalla"
EXIT="Salir..."
HELP="Ayuda"
UGUIDE="Mabox User Guide (online)"
SETTINGS="settings";;
2023-07-28 12:38:04 +02:00
de*)
TYPE_TO_SEARCH="Tippe für Suche"
APPS="Programme"
KEYS="Tastenkombinationen"
SCREENSHOT="Bildschirmfoto"
LOCKSCR="Sperrbildschirm"
EXIT="Verlassen..."
2023-09-16 18:44:51 +02:00
HELP="Hilfe"
2023-07-28 12:38:04 +02:00
UGUIDE="Mabox Users Guide (online)"
SETTINGS="settings";;
2021-01-27 12:53:11 +01:00
*) TYPE_TO_SEARCH="Type to Search"
2021-09-12 18:36:25 +02:00
APPS="Applications"
KEYS="Keybindings"
SCREENSHOT="Screenshot"
LOCKSCR="Lock screen"
EXIT="Exit..."
HELP="Help"
UGUIDE="Mabox Users Guide (online)"
SETTINGS="settings";;
2021-01-14 19:01:40 +01:00
esac
2023-05-03 15:58:42 +02:00
# Search field
if [[ $search_field = "false" ]];then
MENU_PADDING_TOP=${jgtools_padding}
SEARCH_TEXT=""
SEARCH_FIELD=""
else
MENU_PADDING_TOP=$((jgtools_padding + 24))
SEARCH_TEXT="@text,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),150,20,0,left,top,auto,#000000,<span size='large'></span>"
SEARCH_FIELD="@search,,$((jgtools_padding + 38)),$((jgtools_padding + 4)),150,20,2,left,top,auto,#000000 0,<i>$TYPE_TO_SEARCH</i>"
fi
2021-01-27 12:53:11 +01:00
#apps_in_submenu=true
2021-09-12 18:36:25 +02:00
rm -f ~/.config/jgmenu/append.csv
2021-01-27 12:53:11 +01:00
if [[ $apps_in_submenu == true ]]
then
2021-09-12 18:36:25 +02:00
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
2023-05-03 15:58:42 +02:00
${SEARCH_TEXT}
${SEARCH_FIELD}
2023-05-10 23:47:50 +02:00
2021-09-12 18:36:25 +02:00
. ~/.config/mabox/favorites.csv
2021-11-05 21:55:03 +01:00
$APPS,^checkout(apps),applications-other
2021-09-12 18:36:25 +02:00
. ~/.config/mabox/mainmenu_below_apps.csv
^sep()
$KEYS, mbhelper -s,key_bindings
^sep()
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
^sep()
$LOCKSCR,mbscreenlocker,system-lock-screen
^sep()
$EXIT,mb-jgtools mblogout,system-shutdown
^tag($SETTINGS)
. ~/.config/mabox/settings.csv
^sep($HELP)
$UGUIDE,^checkout(userguide),distributor-logo-mabox
2022-12-07 23:04:36 +01:00
Mabox Forum,xdg-open https://forum.maboxlinux.org/,distributor-logo-mabox
2021-09-12 18:36:25 +02:00
^tag(userguide)
. /usr/share/mb-jgtools/userguide.csv
. ~/.config/mabox/settings_tags.csv
2021-11-05 21:55:03 +01:00
^tag(apps)
2021-09-12 18:36:25 +02:00
EOF
2021-01-27 12:53:11 +01:00
else
2021-01-14 19:01:40 +01:00
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
2023-05-03 15:58:42 +02:00
${SEARCH_TEXT}
${SEARCH_FIELD}
2023-05-10 23:47:50 +02:00
2021-01-14 19:01:40 +01:00
. ~/.config/mabox/favorites.csv
EOF
2021-09-12 18:36:25 +02:00
cat <<EOF > $HOME/.config/jgmenu/append.csv
. ~/.config/mabox/mainmenu_below_apps.csv
2022-04-10 22:24:48 +02:00
^sep()
$KEYS, mbhelper -s,key_bindings
^sep()
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
^sep()
$LOCKSCR,mbscreenlocker,system-lock-screen
^sep()
$EXIT,mb-jgtools mblogout,system-shutdown
2021-09-12 18:36:25 +02:00
^tag($SETTINGS)
. ~/.config/mabox/settings.csv
^sep($HELP)
$UGUIDE,^checkout(userguide),distributor-logo-mabox
2022-12-07 23:04:36 +01:00
MaboxForum,xdg-open https://forum.maboxlinux.org/,distributor-logo-mabox
2021-09-12 18:36:25 +02:00
^tag(userguide)
. /usr/share/mb-jgtools/userguide.csv
. ~/.config/mabox/settings_tags.csv
EOF
fi
2021-01-14 19:01:40 +01:00
2020-03-06 14:23:50 +01:00
2022-06-05 11:41:36 +02:00
[[ "$jgmenu_use_icons" == "false" ]] && icons=0 iconmargin=0 || icons=1 iconmargin=2
2020-01-28 23:28:23 +01:00
mkconfigfile
2020-03-06 14:23:50 +01:00
2024-02-27 10:46:11 +01:00
CACHE_DIR="$HOME/.cache/mmenu"
mkdir -p ${CACHE_DIR}
XDG_CACHE_HOME=${CACHE_DIR} jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
2023-05-26 23:03:09 +02:00
#trap 'on_exit' EXIT
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)
2022-09-20 21:15:55 +02:00
RHEAD=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS} ${RHEAD}" 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"
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"
2023-05-03 15:58:42 +02:00
SETTINGS_MENU="Konfiguracja Mabox"
2020-02-23 16:19:32 +01:00
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"
2022-09-20 21:15:55 +02:00
FINISHED=" Finished! Press ENTER to quit"
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"
2023-05-03 15:58:42 +02:00
SETTINGS_MENU="Mabox Config"
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"
2022-09-20 21:15:55 +02:00
FINISHED=" Finished! Press ENTER to quit"
;;
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"
2023-05-03 15:58:42 +02:00
SETTINGS_MENU="Mabox Config"
2020-02-23 16:19:32 +01:00
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"
2022-09-20 21:15:55 +02:00
FINISHED=" Finished! Press ENTER to quit"
2020-02-23 16:19:32 +01:00
;;
esac
2022-06-05 11:41:36 +02:00
[ $jgmenu_use_icons == false ] && icons=0 iconmargin=0 || icons=1 iconmargin=2
2020-01-21 23:00:04 +01:00
2022-09-20 21:15:55 +02:00
if [ $panels_heightpos == "full" ]; then
2023-01-19 01:32:14 +01:00
2022-09-20 21:15:55 +02:00
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
2023-01-19 01:32:14 +01:00
THUMBDIR="$HOME/.cache/colorizer/thumbs"
mkdir -p ${THUMBDIR}
NAME=${WALLPATH////_}
if [[ "${NAME}" =~ ^_home_.* ]]; then
n=${#HOME}
((n++))
NAME=${NAME:${n}}
fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
2022-12-06 23:16:02 +01:00
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 152))
2022-09-20 21:15:55 +02:00
cat <<EOF > ${RHEAD}
2022-12-06 23:16:02 +01:00
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
@rect,,$((jgtools_padding + 0)),$((jgtools_padding + 14)),270,22,0,left,top,#222222 20,#222222 70,
@text,,$((jgtools_padding + 100)),$((jgtools_padding + 10)),200,30,0,left,top,#EEEEEE ,${WINCLR},<span size='10400' font_family='Ubuntu'><b>$OSNAME</b> Linux <b>$OSVERSION</b> <i>$OSCODE</i></span>
2022-12-30 16:15:47 +01:00
#@icon,,$((jgtools_padding + 2)),$((jgtools_padding + 2)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
2022-12-06 23:16:02 +01:00
@rect,,$((jgtools_padding + 0)),$((jgtools_padding + 120)),160,22,2,left,top,#222222 50,#222222 80,
@search,,$((jgtools_padding + 8)),$((jgtools_padding + 120)),292,20,4,left,top,#EEEEEE,##EEEEEE,"""<big></big> <span size='10400' font_family='Ubuntu'><i>$TYPE_TO_SEARCH</i></span>"""
2022-09-20 21:15:55 +02:00
EOF
else
cat <<EOF > ${RHEAD}
2022-12-30 16:15:47 +01:00
#@icon,,$((jgtools_padding + 2)),$((jgtools_padding + 10)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
2021-11-05 21:55:03 +01:00
@text,,$((jgtools_padding + 56)),$((jgtools_padding + 10)),200,20,4,left,top,auto,#111111,<big>$OSNAME $OSVERSION</big> <sup><i>$OSCODE</i></sup>
@text,,$((jgtools_padding + 56)),$((jgtools_padding + 30)),200,20,4,left,top,auto,#444444,<small>$USER@$HOSTNAME</small>
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>"""
2022-09-20 21:15:55 +02:00
EOF
fi
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
. ${RHEAD}
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)
2023-05-03 15:58:42 +02:00
#$MCC,mcc,mcc,distributor-logo-mabox
#^sep()
$SETTINGS_MENU,^root(msettings),mbcc
2020-08-29 15:40:13 +02:00
$SYS_AND_HARDWARE,^root(system),audiocard
2020-02-23 16:19:32 +01:00
^sep($SOFT_MANAGEMENT)
$PAMAC_UPDATE,pamac-manager --updates,system-upgrade
2024-02-22 11:33:02 +01:00
$CLI_UPDATE,mb-cli update,openterm
2020-02-23 16:19:32 +01:00
$PAMAC,pamac-manager,pamac
2022-09-20 21:15:55 +02:00
$RENEW_KEYS,^term(sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring;read -p "${FINISHED}"),keysync
2020-02-23 16:19:32 +01:00
$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
2022-12-07 23:04:36 +01:00
Mabox Forum,xdg-open 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
2023-09-01 23:05:03 +02:00
${arrow_string_left} $BACK,^back()
2020-01-21 23:00:04 +01:00
^tag(mirrory)
2024-02-22 11:33:02 +01:00
$FAST <small>pacman-mirrors -f5</small>,mb-cli mirrors
$ALL <small>pacman-mirrors -i -c all</small>,mb-cli mirrors_all
$GEOIP <small>pacman-mirrors -i --geoip</small>,mb-cli mirrors_geo
2020-02-17 17:14:08 +01:00
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $BACK,^back()
2020-01-21 23:00:04 +01:00
2023-05-03 15:58:42 +02:00
^tag(msettings)
2020-08-29 15:40:13 +02:00
. ~/.config/mabox/settings.csv
2020-02-17 17:14:08 +01:00
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $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()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $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)
2022-12-07 23:04:36 +01:00
Mabox Website,xdg-open https://maboxlinux.org/,distributor-logo-mabox
Mabox Forum,xdg-open https://forum.maboxlinux.org/,distributor-logo-mabox
Mabox Manual,xdg-open https://manual.maboxlinux.org/,distributor-logo-mabox
Donate,xdg-open https://ko-fi.com/maboxlinux,application-community
2020-01-30 01:02:29 +01:00
^sep(Manjaro)
2022-12-07 23:04:36 +01:00
Stable Updates,xdg-open https://forum.manjaro.org/c/announcements/stable-updates/,distributor-logo-manjaro
Manjaro Wiki,xdg-open https://wiki.manjaro.org,distributor-logo-manjaro
Manjaro Forum,xdg-open https://forum.manjaro.org,distributor-logo-manjaro
Branch Compare,xdg-open https://packages.manjaro.org/,distributor-logo-manjaro
2021-01-12 01:28:26 +01:00
2020-01-30 01:02:29 +01:00
^sep(ArchLinux)
2022-12-07 23:04:36 +01:00
ArchWiki,xdg-open https://wiki.archlinux.org/,distributor-logo-archlinux
Manual pages indexing service,xdg-open https://man.archlinux.org/,distributor-logo-archlinux
2020-01-30 01:02:29 +01:00
^sep(Openbox)
2022-12-07 23:04:36 +01:00
OpenBox,xdg-open http://openbox.org/wiki/Help:Contents,openbox
OpenBox ArchWiki,xdg-open https://wiki.archlinux.org/index.php/Openbox,openbox
2020-03-07 18:12:14 +01:00
^sep(Jgmenu)
2022-12-07 23:04:36 +01:00
Jgmenu homesite,xdg-open https://jgmenu.github.io/,jgmenu
Jgmenu GitHub,xdg-open https://github.com/johanmalm/jgmenu,jgmenu
2021-01-14 20:04:25 +01:00
^sep(Terminator)
2022-12-07 23:04:36 +01:00
Terminator GitHub,xdg-open https://gnome-terminator.github.io/,terminator
Terminator Docs,xdg-open https://gnome-terminator.readthedocs.io/en/latest/,terminator
2021-01-14 20:04:25 +01:00
2020-03-07 18:12:14 +01:00
^sep(Tint2)
2022-12-07 23:04:36 +01:00
Tint2 GitLab,xdg-open https://gitlab.com/o9000/tint2,tint2
Tint2 ArchWiki,xdg-open https://wiki.archlinux.org/index.php/Tint2,tint2
2020-03-07 18:12:14 +01:00
^sep(Conky)
2022-12-07 23:04:36 +01:00
Conky Website,xdg-open http://conky.cc,conky
Conky Github,xdg-open https://github.com/brndnmtthws/conky/wiki,conky
Conky ArchWiki,xdg-open 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()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $BACK,^back()
2020-02-03 20:50:31 +01:00
2020-01-21 23:00:04 +01:00
EOF
2024-02-27 10:46:11 +01:00
CACHE_DIR="$HOME/.cache/mrightpanel"
mkdir -p ${CACHE_DIR}
XDG_CACHE_HOME=${CACHE_DIR} jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
2020-01-21 23:00:04 +01:00
}
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)
2022-09-20 21:15:55 +02:00
LHEAD=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS} ${QNAV} ${LHEAD}" 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"
2024-03-13 13:16:36 +01:00
SUPERCLICK="SuperClick"
2021-08-31 22:53:52 +02:00
WALLCHANGER="Tapeta"
LOCKSCREEN="Blokada Ekranu"
2021-09-01 10:54:32 +02:00
MBHELPER="Paleta komend (<b>super+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"
2024-03-13 13:16:36 +01:00
SUPERCLICK="SuperClick"
2021-08-31 22:53:52 +02:00
WALLCHANGER="Wallpaper"
LOCKSCREEN="Screen Locker"
2021-09-01 10:54:32 +02:00
MBHELPER="Cmd palette (<b>super-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"
2024-03-13 13:16:36 +01:00
SUPERCLICK="SuperClick"
2021-08-31 22:53:52 +02:00
WALLCHANGER="Wallpaper"
LOCKSCREEN="Screen Locker"
2021-09-01 10:54:32 +02:00
MBHELPER="Cmd palette (<b>super-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
2022-04-17 02:28:49 +02:00
icons=0
iconmargin=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)
2022-12-16 22:33:26 +01:00
<tt><big></big></tt> $ROOTDIR,^pipe(jgbrowser /),folder
<tt><big></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
<big> </big> $(basename $(xdg-user-dir MUSIC)),^pipe(jgbrowser $(xdg-user-dir MUSIC)),folder-music
<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
2021-02-06 14:46:30 +01:00
EOF
else
QNAV=""
fi
# PIPEMENUS
2023-05-26 23:03:09 +02:00
[ $places_menusettingspipe == true ] && menusettingspipe="<big>󰍜</big> $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2022-12-16 22:33:26 +01:00
[ $places_tint2pipe == true ] && tint2pipe="<big></big> $TINT2SETTINGS,^pipe(jgtint2-pipe -r)" && pipesep="^sep($PIPEMENUS)"
2023-05-26 23:03:09 +02: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)"
2022-12-16 22:33:26 +01:00
[ $places_sshpipe == true ] && sshpipe="<big></big> $SSH_CONN,^pipe(jgssh -r)" && pipesep="^sep($PIPEMENUS)"
[ $places_softwarepipe == true ] && softwarepipe="<big></big> $POPINSTALL,^pipe(jgsoftware-pipe -r)" && pipesep="^sep($PIPEMENUS)"
[[ $places_conkypipe == true || -z ${places_conkypipe} ]] && conkypipe="<big></big> $CONKYSETTINGS,^pipe(jgconky-pipe -r)" && pipesep="^sep($PIPEMENUS)"
[[ $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)"
2024-03-13 13:16:36 +01:00
[[ $places_jgdeskgrid == true || -z ${places_jgdeskgrid} ]] && jgdeskgrid="<big></big> $SUPERCLICK,^pipe(jgdeskgrid -r)" && pipesep="^sep($PIPEMENUS)"
2022-12-16 22:33:26 +01:00
[[ $places_jgwallpaperchanger == true || -z ${places_jgwallpaperchanger} ]] && jgwallpaperchanger="<big></big> $WALLCHANGER,^pipe(jgwallpaperchanger -r)" && pipesep="^sep($PIPEMENUS)"
[[ $places_jglockscreen == true || -z ${places_jglockscreen} ]] && jglockscreen="<big></big> $LOCKSCREEN,^pipe(jglockscreen -r)" && pipesep="^sep($PIPEMENUS)"
2021-05-28 02:47:06 +02:00
2021-02-06 14:46:30 +01:00
# VBOXES
2022-04-10 21:54:13 +02:00
if [[ -x "$(command -v VBoxManage)" ]]; then
[[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes=""
fi
2022-09-20 21:15:55 +02:00
if [ $panels_heightpos == "full" ]; then
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
2023-01-19 01:32:14 +01:00
THUMBDIR="$HOME/.cache/colorizer/thumbs"
mkdir -p ${THUMBDIR}
NAME=${WALLPATH////_}
if [[ "${NAME}" =~ ^_home_.* ]]; then
n=${#HOME}
((n++))
NAME=${NAME:${n}}
fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
2022-12-06 23:16:02 +01:00
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 152))
2022-09-20 21:15:55 +02:00
cat <<EOF > ${LHEAD}
2022-12-06 23:16:02 +01:00
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
2022-12-30 16:15:47 +01:00
#@icon,,$((jgtools_padding - 6)),$((jgtools_padding - 6)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
2022-12-06 23:16:02 +01:00
@rect,,$((jgtools_padding + 0)),$((jgtools_padding + 122)),240,22,0,left,top,#222222 20,#222222 70,
@text,,$((jgtools_padding + 68)),$((jgtools_padding + 118)),180,30,0,left,top,#EEEEEE ,${WINCLR},<span size='10400' font_family='Ubuntu'><b>$OSNAME</b> Linux <b>$OSVERSION</b> <i>$OSCODE</i></span>
2022-09-20 21:15:55 +02:00
#@text,,$((jgtools_padding + 62)),$((jgtools_padding + 30)),180,20,4,left,top,#222222,#444444,<small>$USER@$HOSTNAME</small>
EOF
else
cat <<EOF > ${LHEAD}
@icon,,$((jgtools_padding + 2)),$((jgtools_padding + 10)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
@text,,$((jgtools_padding + 62)),$((jgtools_padding + 10)),200,20,4,left,top,auto,#111111,<big>$OSNAME $OSVERSION</big> <sup><i>$OSCODE</i></sup>
@text,,$((jgtools_padding + 62)),$((jgtools_padding + 30)),200,20,4,left,top,auto,#444444,<small>$USER@$HOSTNAME</small>
EOF
fi
2021-02-06 14:46:30 +01:00
mkconfigfile
2020-01-21 23:00:04 +01:00
cat <<EOF > ${MENU_ITEMS}
2022-09-20 21:15:55 +02:00
. ${LHEAD}
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
2022-12-16 22:33:26 +01: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-08-31 22:53:52 +02:00
$jglockscreen
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
2022-04-10 21:54:13 +02: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() {
2023-07-23 01:02:35 +02:00
jgmenu_icon_theme="Numix-Circle"
2020-07-22 17:02:26 +02:00
if [[ -n "$1" ]]
then
POSITION_MODE=${1:-pointer}
else
MENU_HALIGN="center"
MENU_VALIGN="center"
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
2023-08-16 22:30:07 +02:00
pl*) CANCEL="Anuluj"
SWITCHUSER="Przełącz użytkownika"
SWITCHTO="Przełącz na..."
NEWSESS="Nowa sesja jako..."
;;
es*) CANCEL="Cancelar"
SWITCHUSER="Switch user"
SWITCHTO="Switch to..."
NEWSESS="New session as..."
;;
*) CANCEL="Cancel"
SWITCHUSER="Switch user"
SWITCHTO="Switch to..."
NEWSESS="New session as..."
;;
2020-02-26 15:15:26 +01:00
esac
2021-01-15 11:57:29 +01:00
jgtools_padding=${jgtools_padding:-0}
2023-08-02 19:06:02 +02:00
#JGWIDTH=$((jgtools_padding + 348 + jgtools_padding))
#MENU_PADDING_TOP=$((jgtools_padding + 221))
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 152))
TABS="200"
2022-04-17 02:28:49 +02:00
icons=1
2022-06-05 11:41:36 +02:00
iconmargin=2
2022-04-24 19:13:34 +02:00
item_height_factor=300
#jgmenu_font="Noto Sans Medium 11"
2020-02-01 02:00:57 +01:00
2020-01-21 23:00:04 +01:00
mkconfigfile
2023-08-16 22:30:07 +02:00
if pgrep -f /usr/bin/lightdm >/dev/null
then
ALLUSERS=( $(getent passwd {1000..1010}|cut -d: -f1) )
if [[ ${#ALLUSERS[@]} -gt 1 ]];then
SESSIONS=( $(dm-tool list-seats|grep UserName|cut -d"'" -f2) )
SW+=("^sep()" "$SWITCHUSER,^checkout(users),system-switch-user")
SW2+=("^tag(users)")
if [[ ${#SESSIONS[@]} -gt 1 ]];then
SW2+=("^sep($SWITCHTO)")
for usess in "${SESSIONS[@]}";do
[[ "$usess" != "$USER" ]] && SW2+=("$usess, dm-tool switch-to-user $usess,system-switch-user")
done
fi
for element in "${SESSIONS[@]}";do
ALLUSERS=(${ALLUSERS[@]/*${element}*/})
done
if [[ ${#ALLUSERS[@]} -gt 0 ]];then
SW2+=("^sep($NEWSESS)")
for u in "${ALLUSERS[@]}";do
SW2+=("$u,dm-tool switch-to-user $u,system-switch-user")
done
fi
fi
fi
2020-01-21 23:00:04 +01:00
2020-07-22 17:02:26 +02:00
#wmctrl -k on
2023-08-02 19:06:02 +02:00
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
THUMBDIR="$HOME/.cache/colorizer/thumbs"
mkdir -p ${THUMBDIR}
NAME=${WALLPATH////_}
if [[ "${NAME}" =~ ^_home_.* ]]; then
n=${#HOME}
((n++))
NAME=${NAME:${n}}
fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
2020-01-21 23:00:04 +01:00
cat <<EOF > ${MENU_ITEMS}
2023-08-02 19:06:02 +02:00
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,$THUMB
2023-08-16 22:30:07 +02:00
@rect,,$((jgtools_padding + 0)),$((jgtools_padding + 120)),270,22,2,left,top,#222222 50,#222222 80,
@text,,$((jgtools_padding + 8)),$((jgtools_padding + 120)),292,20,4,left,top,#EEEEEE,##EEEEEE,"""<span size='10400' font_family='Ubuntu'>$USER @ $HOSTNAME</span>"""
@icon,,224,108,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
2020-02-20 18:33:48 +01:00
2020-02-20 01:37:06 +01:00
. $HOME/.config/mabox/exit.csv
2023-08-16 22:30:07 +02:00
$(printf '%s\n' "${SW[@]}")
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
2023-08-16 22:30:07 +02:00
$(printf '%s\n' "${SW2[@]}")
2020-01-21 23:00:04 +01:00
EOF
2024-02-27 10:46:11 +01:00
CACHE_DIR="$HOME/.cache/mblogout"
mkdir -p ${CACHE_DIR}
XDG_CACHE_HOME=${CACHE_DIR} jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
2020-01-21 23:00:04 +01:00
}
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"
2023-06-06 22:16:52 +02:00
SEC15="Za 15 sekund"
2020-02-22 17:01:00 +01:00
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"
2022-10-01 01:41:08 +02:00
SCRNREC="Nagrywanie pulpitu"
FULLREC="Pełny ekran"
AREA="Obszar lub okno"
2022-12-12 01:02:50 +01:00
SETTINGS="Ustawienia"
SCROTSETTINGS="Zrzuty ekranu"
EXTENSION="Typ obrazka (rozszerzenie)"
VIDEOSETTINGS="Ustawienia nagrywania"
2022-10-01 01:41:08 +02:00
AUDIO="Dźwięk"
FORMAT="Kontener (rozszerzenie)"
FRAMERATE="Klatki na sekundę (fps)"
REC_AUDIO="Nagrywaj dźwięk"
NO_AUDIO="Bez dźwięku"
OPEN_REC_DIR="Otwórz katalog z nagraniami"
2022-10-01 19:57:01 +02:00
EDIT_CONF_FILE="Edytuj plik konfiguracyjny"
;;
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"
2023-06-06 22:16:52 +02:00
SEC15="En 15 segundos"
BACK="atrás"
OPEN_SCR_DIR="Abrir carpeta de capturas"
CANCEL="Cancelar"
2022-10-01 20:35:44 +02:00
SCRNREC="Grabador Captura Pantalla"
FULLREC="Pantalla Completa "
AREA="Área seleccionada o Ventana"
2022-12-12 01:02:50 +01:00
SETTINGS="Ajustes"
SCROTSETTINGS="Screenshot settings"
EXTENSION="File type (extension)"
2022-10-01 20:35:44 +02:00
VIDEOSETTINGS="Ajustes de Grabación"
2022-10-01 09:27:00 +02:00
AUDIO="Audio"
2022-10-01 20:35:44 +02:00
FORMAT="Formato de archivo (extension)"
FRAMERATE="Velocidad de cuadros (fps)"
REC_AUDIO="Grabar con Audio"
NO_AUDIO="Grabar sin Audio"
OPEN_REC_DIR="Abrir carpeta de grabaciones"
EDIT_CONF_FILE="Editar configuración"
;;
2020-02-22 17:01:00 +01:00
*)
2022-10-01 01:41:08 +02:00
SCRNSHOTS="Screenshot"
2020-02-22 17:01:00 +01:00
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"
2023-06-06 22:16:52 +02:00
SEC15="In 15 seconds"
2020-02-22 17:01:00 +01:00
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"
2022-10-01 01:41:08 +02:00
SCRNREC="Screen recording"
FULLREC="Full screen "
AREA="Selected Area or Window"
2022-12-12 01:02:50 +01:00
SETTINGS="Settings"
SCROTSETTINGS="Screenshot settings"
EXTENSION="File type (extension)"
2022-10-01 01:41:08 +02:00
VIDEOSETTINGS="Recording settings"
AUDIO="Audio"
FORMAT="Container (file extension)"
FRAMERATE="Framerate (fps)"
REC_AUDIO="Record Audio"
NO_AUDIO="No Audio"
OPEN_REC_DIR="Open recordings dir"
2022-10-01 19:57:01 +02:00
EDIT_CONF_FILE="Edit config file"
2020-02-22 17:01:00 +01:00
;;
esac
2021-01-15 11:57:29 +01:00
jgtools_padding=${jgtools_padding:-0}
2021-11-05 21:55:03 +01:00
POSITION_MODE=${1:-fixed}
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"
2022-04-17 02:28:49 +02:00
icons=0
iconmargin=0
2022-04-24 19:13:34 +02:00
item_height_factor=300
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
2020-01-28 23:28:23 +01:00
2020-01-31 13:54:41 +01:00
2022-10-01 01:41:08 +02:00
# Video recordings
CNF_FILE="$HOME"/.config/mabox/mb-screenrec.conf
if [ ! -f $CNF_FILE ]; then
cat <<EOF > ${CNF_FILE}
# Container (file extension): webm,mp4 or mkv
container=webm
# Record Audio? yes or no
record_audio=no
#Framerate (frames per second)
framerate=30
2022-12-12 01:02:50 +01:00
# Screenshot file type/extension
image_extension=webp
2022-10-01 01:41:08 +02:00
EOF
fi
. "$CNF_FILE"
2022-12-12 01:02:50 +01:00
EXT=${image_extension:-png}
IMG="$(xdg-user-dir PICTURES)/screenshots/Mabox_$(date +'%Y%m%d-%H-%M-%S').${EXT}"
VIEW="'viewnior $IMG'"
THUMB="$(DISPLAY=:0 scrot -t 340x213 -o $HOME/.config/mabox/jgscrot.png -e 'echo $m')"
2022-10-01 01:41:08 +02:00
if [ "$record_audio" == "yes" ];then
case "$LANG" in
2022-12-06 23:16:02 +01:00
pl*) AUD="dźwięk";;
2022-10-01 01:41:08 +02:00
*) AUD="audio";;
esac
else
case "$LANG" in
2022-12-06 23:16:02 +01:00
pl*) AUD="cisza";;
*) AUD="noaudio";;
2022-10-01 01:41:08 +02:00
esac
fi
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
2022-12-12 01:02:50 +01:00
^sep($SCRNSHOTS <small>($EXT)</small>)
2020-07-22 17:02:26 +02:00
 $FULLSCR,^root(full)
 $ACTIVE_WIN,^root(window)
 $ACTIVE_WIN_NO_DECOR,^root(borderless)
2023-06-06 22:16:52 +02:00
 $SELECTED,^root(selected)
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
2022-12-12 01:02:50 +01:00
^sep($SCRNREC <small>($container ${AUD} $framerate fps)</small>)
2022-10-01 01:41:08 +02:00
 $FULLREC,mb-screenrec -f
 $AREA,mb-screenrec -a
^sep()
 $OPEN_REC_DIR,xdg-open $(xdg-user-dir VIDEOS)/Recordings
2022-12-12 01:02:50 +01:00
^sep()
 $SETTINGS,^checkout(settings)
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
2023-06-06 22:16:52 +02:00
 $SEC15,scrot -d 15 $IMG -e $VIEW
2020-02-17 19:18:20 +01:00
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $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
2023-06-06 22:16:52 +02:00
 $SEC15,scrot -d 15 -u -b $IMG -e $VIEW
2020-02-17 19:18:20 +01:00
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $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
2023-06-06 22:16:52 +02:00
 $SEC15,scrot -d 15 -u $IMG -e $VIEW
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $BACK,^back()
2023-06-06 22:16:52 +02:00
^tag(selected)
^sep($SELECTED)
 $NOW,"""maim -s -l -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}"""
 $SEC5,"""maim -s -l --delay=5 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}"""
 $SEC10,"""maim -s -l --delay=10 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}"""
 $SEC15,"""maim -s -l --delay=15 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}"""
2020-02-17 19:18:20 +01:00
^sep()
2023-09-01 23:05:03 +02:00
${arrow_string_left} $BACK,^back()
2022-12-12 01:02:50 +01:00
^tag(settings)
^sep($SCROTSETTINGS)
$EXTENSION [ <b>${EXT}</b> ],^checkout(imgext)
2022-10-01 01:41:08 +02:00
^sep($VIDEOSETTINGS)
$AUDIO [ <b>${AUD}</b> ],^checkout(audio)
$FORMAT [ <b>${container}</b> ],^checkout(format)
$FRAMERATE [ <b>${framerate}</b> ],^checkout(framerate)
2022-10-01 19:57:01 +02:00
^sep()
 $EDIT_CONF_FILE,xdg-open $CNF_FILE
2022-12-12 01:02:50 +01:00
^tag(imgext)
^sep($EXTENSION)
WebP (.webp),mb-setvar image_extension=webp ${CNF_FILE};mb-jgtools screenshot ipc
PNG (.png),mb-setvar image_extension=png ${CNF_FILE};mb-jgtools screenshot ipc
JPG (.jpg),mb-setvar image_extension=jpg ${CNF_FILE};mb-jgtools screenshot ipc
2022-10-01 01:41:08 +02:00
^tag(audio)
^sep($AUDIO)
$REC_AUDIO,mb-setvar record_audio=yes ${CNF_FILE};mb-jgtools screenshot ipc
$NO_AUDIO,mb-setvar record_audio=no ${CNF_FILE};mb-jgtools screenshot ipc
^tag(format)
^sep($FORMAT)
webm,mb-setvar container=webm ${CNF_FILE};mb-jgtools screenshot ipc
mkv,mb-setvar container=mkv ${CNF_FILE};mb-jgtools screenshot ipc
mp4,mb-setvar container=mp4 ${CNF_FILE};mb-jgtools screenshot ipc
^tag(framerate)
^sep($FRAMERATE)
30,mb-setvar framerate=30 ${CNF_FILE};mb-jgtools screenshot ipc
25,mb-setvar framerate=25 ${CNF_FILE};mb-jgtools screenshot ipc
24,mb-setvar framerate=24 ${CNF_FILE};mb-jgtools screenshot ipc
2022-10-01 19:57:01 +02:00
15,mb-setvar framerate=15 ${CNF_FILE};mb-jgtools screenshot ipc
10,mb-setvar framerate=10 ${CNF_FILE};mb-jgtools screenshot ipc
2020-01-28 23:28:23 +01:00
EOF
2022-12-12 01:02:50 +01:00
cat "${MENU_ITEMS}"
2020-01-28 23:28:23 +01:00
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"
2022-06-05 11:41:36 +02:00
[ $jgmenu_use_icons == false ] && icons=0 iconmargin=0 || icons=1 iconmargin=2
2020-08-29 15:40:13 +02:00
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";;
2021-11-05 21:55:03 +01:00
screenshot) screenshot "$2";;
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