1925 lines
73 KiB
Bash
Executable File
1925 lines
73 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox
|
|
# Copyright (C) 2019-2026 Daniel Napora <danieln@maboxlinux.org>
|
|
|
|
|
|
on_exit(){
|
|
MSG=$(xdotool getmouselocation --shell)
|
|
notify-send.sh "Position" "${MSG}"
|
|
}
|
|
|
|
. $HOME/.config/mabox/mabox.conf
|
|
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}"
|
|
|
|
# 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
|
|
[[ -v arrow_string ]] && : || mb-setvar "arrow_string=''"
|
|
[[ -v arrow_string_left ]] && : || mb-setvar "arrow_string_left=''"
|
|
#menu title/sep font
|
|
menu_sep_font_size=${menu_sep_font_size:-10}
|
|
menu_sep_font_family=${menu_sep_font_family:-Noto Sans Bold}
|
|
menu_sep_font="${menu_sep_font_family} ${menu_sep_font_size}"
|
|
item_height_factor=${item_height_factor:-200}
|
|
|
|
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
|
[ -z $jgmenu_use_borders ] && menu_border=0
|
|
|
|
|
|
gtkbookmarks() {
|
|
if [ $places_bookmarks == true ]; then
|
|
if [ -f "$HOME/.config/gtk-3.0/bookmarks" ];then
|
|
BOOKMARKS="$HOME/.config/gtk-3.0/bookmarks"
|
|
else
|
|
BOOKMARKS="$HOME/.gtk-bookmarks"
|
|
fi
|
|
if [[ -s "$BOOKMARKS" ]]; then
|
|
case $LANG in
|
|
pl*) GTK_BOOKMARKS="Zakładki";;
|
|
es*) GTK_BOOKMARKS="Marcadores" ;;
|
|
de*) GTK_BOOKMARKS="Lesezeichen" ;;
|
|
*) GTK_BOOKMARKS="Bookmarks" ;;
|
|
esac
|
|
while read -r line
|
|
do
|
|
case $line in
|
|
file*)
|
|
uri=$(echo $line | cut -b 8- | cut -d' ' -f1 | sed 's/%20/ /g')
|
|
label=$(echo $line | cut -d' ' -f2-4 | sed 's/%20/ /g')
|
|
dirs+=(" ${label},^pipe(jgbrowser \"${uri}\" -b)")
|
|
#dirs+=(" ${line#* },^pipe(jgbrowser \"${uri}\" -b)")
|
|
;;
|
|
sftp*|ssh*)
|
|
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
|
|
label=$(echo $line | cut -d' ' -f2-4 | sed 's/%20/ /g')
|
|
dirs+=(" ${label}, pcmanfm -n ${uri}")
|
|
;;
|
|
ftp*)
|
|
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
|
|
label=$(echo $line | cut -d' ' -f2-4 | 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-4 | sed 's/%20/ /g')
|
|
dirs+=(" ${label}, pcmanfm -n ${uri}")
|
|
;;
|
|
esac
|
|
done <"$BOOKMARKS"
|
|
printf "%b\n" "^sep($GTK_BOOKMARKS)"
|
|
printf '%s\n' "${dirs[@]}"
|
|
fi
|
|
else
|
|
printf ""
|
|
fi
|
|
}
|
|
|
|
# TABS FOR LEFT SIDEPANEL
|
|
tabs(){
|
|
AREA_CFG="$HOME/.config/areaclick.conf"
|
|
case $LANG in
|
|
pl*)
|
|
_DESKTOPS="Pulpity"
|
|
_ADD_DESKTOP="<b>Dodaj nowy</b> pulpit"
|
|
_REMOVE_LAST="<b>Usuń ostatni</b> pulpit"
|
|
_CURSOR="Kursor"
|
|
_DESK_SERVICES="Usługi pulpitu"
|
|
_TINT2="<b>Panel</b> tint2"
|
|
_CONKY="Sesja <b>Conky</b>"
|
|
_PICOM="<b>Picom</b> kompozytor"
|
|
_RUNNING="(wł)"
|
|
_STOPPED="(wył)"
|
|
_MONITORBLANK="<b>Wygaszanie</b> monitora"
|
|
_ON="(wł)"
|
|
_OFF="(wył)"
|
|
_WMTWEAKS="Ulepszenia Menadżera Okien"
|
|
_SHOW_DESK="Pokaż pulpit - lewy klik"
|
|
_SWITCH_DESK="Zmień pulpit - kółko myszy"
|
|
_FOCUS="Fokus podąża za myszą"
|
|
_AREACLICK="AreaClick"
|
|
_AREA_DESC="klikalne rogi i krawędzie ekranu"
|
|
_ABOUT_AREACLICK="O AreaClick"
|
|
_AREA_WIDTH="rozmiar obszaru"
|
|
_EDIT_AREACONF="Edytuj <i>areaclick.conf</i>"
|
|
_RESET_AREACONF="Resetuj plik konfiguracyjny"
|
|
_RESET_SURE="Na pewno?"
|
|
_RESET_YES="Tak, resetuj"
|
|
_WM_MARGIN="Marginesy Openbox"
|
|
_OBCONF_MARG="ObConf -> Marginesy"
|
|
_SET_ALL_MARG="ustaw wszystkie na:"
|
|
_CONKY_CLICK="Klikalne Conky"
|
|
_C_LCLICK="<b>własne akcje</b> po <i>lewy klik</i>"
|
|
_C_RCLICK="<b>menu kontekstowe</b> po <i>prawy klik</i>"
|
|
_C_SIMPLIFIEDMENU="<b>uproszczone</b> menu kontekstowe"
|
|
_TOOLS="Narzędzia"
|
|
_WALLMENU="Menu <b>Tapet</b>"
|
|
_CONKY_MANAGER="<b>Manadżer</b> widżetów <b>Conky</b>"
|
|
_FONTS="Ustawienia <b>Czcionek</b>"
|
|
_PANEL_SETTINGS="Ustawienia <b>Panelu</b>"
|
|
_ADV_PROFILE="Zaawansowane"
|
|
_PROFILE="Profil"
|
|
_PRO_MABOX="pełne możliwości <i>domyślny</i>"
|
|
_PRO_BASIC="uproszczony <i>dla początkujących</i>"
|
|
_SIDE_LEFT="Lewy Panel Boczny"
|
|
_SIDE_RIGHT="Prawy Panel Boczny"
|
|
_BOOKMARKS="Zakładki"
|
|
_VBOXES="Maszyny Wirtualne (VirtualBox)"
|
|
_MABOX_TOOLS="Narzędzia Maboxa"
|
|
|
|
_ALLMENU_SETTINGS="Globalne ustawienia menu"
|
|
_FONTS="Czcionki"
|
|
_FONT_FAMILY="Czcionka"
|
|
_EDIT_FAVFONTS="Edytuj listę ulubionych fontów"
|
|
_FONT_SIZE="Rozmiar czcionki"
|
|
_ITEM_FONT="Element"
|
|
_TITLE_FONT="Tytuł/Separator"
|
|
_INCREASE="Powiększ"
|
|
_DECREASE="Pomniejsz"
|
|
_LINEHEIGHT="Wysokość elementu menu"
|
|
_FONT_CUSTOM="Wybierz czcionkę i rozmiar..."
|
|
|
|
_COLOR_SCHEME="Motyw kolorystyczny"
|
|
_CHOOSE="Wybierz"
|
|
_RANDTHEME="Losowy"
|
|
_FEATURES="Możliwości"
|
|
_CUSTOM_COMMANDS="Własne Komendy"
|
|
_IN_MAIN="w Menu Głównym"
|
|
_EDIT="Edytuj"
|
|
_FAVORITES="Ulubione"
|
|
_BELOW_APPS="Pod aplikacjami"
|
|
_RESET_MAIN="Resetuj menu główne"
|
|
_IN_LEFT="w Lewym Panelu Bocznym"
|
|
_TOP="Góra"
|
|
_BOTTOM="Dół"
|
|
_IN_RIGHT="w Prawym Panelu Bocznym"
|
|
_RESET="Resetuj"
|
|
_MAINMENU_SETTINGS="Menu Główne"
|
|
_SEARCH_FIELD="Pole wyszukiwania"
|
|
_APPS_SUB="Aplikacje w podmenu"
|
|
_ICONS="pokaż Ikony"
|
|
_ICON_SET="Zestaw Ikon"
|
|
_INSTALL="Instaluj"
|
|
_ADVANCED="Zaawansowane"
|
|
;;
|
|
*)
|
|
_DESKTOPS="Desktops"
|
|
_ADD_DESKTOP="<b>Add new</b> desktop"
|
|
_REMOVE_LAST="<b>Remove last</b> desktop"
|
|
_CURSOR="Cursor"
|
|
_DESK_SERVICES="Desktop services"
|
|
_TINT2="<b>Panel</b> tint2"
|
|
_CONKY="<b>Conky</b> session"
|
|
_PICOM="<b>Picom</b> compositor"
|
|
_RUNNING="(running)"
|
|
_STOPPED="(stopped)"
|
|
_MONITORBLANK="Monitor <b>blanking</b>"
|
|
_ON="(on)"
|
|
_OFF="(off)"
|
|
_WMTWEAKS="Window Manager tweaks"
|
|
_SHOW_DESK="Show Desktop on <i>left click</i>"
|
|
_SWITCH_DESK="Switch Desktop on <i>mousewheel</i>"
|
|
_FOCUS="Focus follow Mouse"
|
|
_AREACLICK="AreaClick"
|
|
_AREA_DESC="clickable screen corners and edges"
|
|
_ABOUT_AREACLICK="About AreaClick"
|
|
_AREA_WIDTH="click area size"
|
|
_EDIT_AREACONF="Edit <i>areaclick.conf</i>"
|
|
_RESET_AREACONF="Reset config to defaults"
|
|
_RESET_SURE="Are you sure?"
|
|
_RESET_YES="Yes, reset to defaults"
|
|
_WM_MARGIN="Openbox Margin"
|
|
_OBCONF_MARG="ObConf -> Margins"
|
|
_SET_ALL_MARG="set all margins to:"
|
|
_CONKY_CLICK="Conky click actions"
|
|
_C_LCLICK="run <b>custom actions</b> on <i>Left-click</i>"
|
|
_C_RCLICK="show <b>context menu</b> on <i>Right-click</i>"
|
|
_C_SIMPLIFIEDMENU="<b>simplified</b> context menu"
|
|
_TOOLS="Tools"
|
|
_WALLMENU="<b>Wallpaper</b> Menu"
|
|
_CONKY_MANAGER="<b>Conky</b> Widget <b>Manager</b>"
|
|
_FONTS="<b>Fonts</b> settings"
|
|
_PANEL_SETTINGS="<b>Panel</b> settings"
|
|
_ADV_PROFILE="Advanced"
|
|
_PROFILE="Desktop Profile"
|
|
_PRO_MABOX="full featured <i>distro default</i>"
|
|
_PRO_BASIC="simplified <i>(for beginners)</i>"
|
|
|
|
_SIDE_LEFT="Left Side Panel"
|
|
_SIDE_RIGHT="Right Side Panel"
|
|
_BOOKMARKS="Bookmarks"
|
|
_VBOXES="Virtual Machines"
|
|
_MABOX_TOOLS="Mabox Tools"
|
|
|
|
|
|
_ALLMENU_SETTINGS="Global menu settings"
|
|
_FONTS="Menu Fonts"
|
|
_FONT_FAMILY="Font Family"
|
|
_EDIT_FAVFONTS="Edit favorited fonts list"
|
|
_FONT_SIZE="Font Size"
|
|
_ITEM_FONT="Item"
|
|
_TITLE_FONT="Title/Separator"
|
|
_INCREASE="Increase"
|
|
_DECREASE="Decrease"
|
|
_LINEHEIGHT="Item height"
|
|
_FONT_CUSTOM="Select custom font and size..."
|
|
|
|
_COLOR_SCHEME="Color Scheme"
|
|
_CHOOSE="Choose"
|
|
_RANDTHEME="Random"
|
|
_FEATURES="Features"
|
|
_CUSTOM_COMMANDS="Custom Commands"
|
|
_IN_MAIN="in Main Menu"
|
|
_EDIT="Edit"
|
|
_FAVORITES="Favorites"
|
|
_BELOW_APPS="Below apps"
|
|
_RESET_MAIN="Reset mainmenu"
|
|
_IN_LEFT="in Left Side Panel"
|
|
_TOP="Top"
|
|
_BOTTOM="Bottom"
|
|
_IN_RIGHT="in Right Side Panel"
|
|
_RESET="Reset"
|
|
_MAINMENU_SETTINGS="Main Menu"
|
|
_SEARCH_FIELD="Search Field"
|
|
_APPS_SUB="Apps in submenu"
|
|
_ICONS="Show Icons"
|
|
_ICON_SET="Icon set"
|
|
_INSTALL="Install"
|
|
_ADVANCED="Advanced"
|
|
;;
|
|
esac
|
|
|
|
|
|
out+=("^tag(commands)")
|
|
out+=("^sep($_MY_COMMANDS)")
|
|
out+=(". $HOME/.config/mabox/places-prepend.csv")
|
|
out+=("^sep()")
|
|
out+=("<small> $_EDIT_OWN_COMMANDS</small>,xdg-open $HOME/.config/mabox/places-prepend.csv")
|
|
out+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left},^back()")
|
|
|
|
out+=("^tag(desktop)")
|
|
out+=("^sep($_DESKTOP_SETTINGS)")
|
|
desktops=$(wmctrl -d |wc -l)
|
|
|
|
out+=("$_DESKTOPS <b>[ ${desktops} ]</b>,^checkout(desks)")
|
|
out2+=("^tag(desks)")
|
|
out2+=("^sep($_DESKTOPS)")
|
|
out2+=(" $_ADD_DESKTOP,obxml desktops $((desktops+1));$me desktop")
|
|
[[ "$desktops" -gt "1" ]] && out2+=(" $_REMOVE_LAST,obxml desktops $((desktops-1));$me desktop")
|
|
|
|
out+=("^sep()")
|
|
out+=("<big> </big> $_CURSOR,^pipe(jgcursor)")
|
|
if command -v kitty >/dev/null 2>&1
|
|
then
|
|
out+=("Quick Access Terminal (<b>F12</b>),^checkout(qterm)")
|
|
out2+=("^tag(qterm)")
|
|
out2+=("^sep(Quick Access Terminal)")
|
|
[[ "$quick_terminal" == "kitty" ]] && out2+=("<big>${ron}</big> kitty") || out2+=("<big>${roff}</big> kitty,mb-setvar quick_terminal=kitty;$me desktop")
|
|
[[ "$quick_terminal" != "kitty" ]] && out2+=("<big>${ron}</big> terminator") || out2+=("<big>${roff}</big> terminator,mb-setvar quick_terminal=terminator;$me desktop")
|
|
fi
|
|
out+=("^sep($_TOOLS)")
|
|
out+=("$_PANEL_SETTINGS,jgtint2-pipe -s")
|
|
out+=("<big></big> $_FONTS,colorizer-fonts -s")
|
|
out+=("<big></big> $_CONKY_MANAGER,colorizer-conky -s")
|
|
out+=("<big></big> $_WALLMENU,jgwallpaperchanger -s")
|
|
out+=("<big></big> $PICOMSETTINGS,jgpicom-pipe -s")
|
|
out+=("^sep($_DESK_SERVICES)")
|
|
|
|
if pidof conky &>/dev/null; then
|
|
out+=("<big>${cbon}</big> $_CONKY <i>$_ON</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - c</small> </span>,conky_toggle;$me desktop")
|
|
else
|
|
out+=("<big>${cboff}</big> $_CONKY <i>$_OFF</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - c</small> </span>,conky_toggle;$me desktop")
|
|
fi
|
|
if pidof picom &>/dev/null; then
|
|
out+=("<big>${cbon}</big> $_PICOM <i>$_ON</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - p</small> </span>,compton_toggle;$me desktop")
|
|
else
|
|
out+=("<big>${cboff}</big> $_PICOM <i>$_OFF</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - p</small> </span>,compton_toggle;$me desktop")
|
|
fi
|
|
if pidof tint2 &>/dev/null;then
|
|
out+=("<big>${cbon}</big> $_TINT2 <i>$_ON</i>,tint2_toggle;$me desktop")
|
|
else
|
|
out+=("<big>${cboff}</big> $_TINT2 <i>$_OFF</i>,mb-tint2-session &>/dev/null;$me desktop")
|
|
fi
|
|
out+=("^sep()")
|
|
# MONITOR BLANKING
|
|
if (xset q|grep --quiet "DPMS is Enabled");then
|
|
out+=("<big></big> $_MONITORBLANK <i>$_ON</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - A - b</small> </span>,noblank;$me desktop")
|
|
else
|
|
out+=("<big></big> $_MONITORBLANK <i>$_OFF</i> <span bgcolor='#333333' color='#d3d3d3'> <small> - A - b</small> </span> ,noblank;$me desktop")
|
|
fi
|
|
|
|
# DESKTOP MOUSE ACTIONS
|
|
mousewheel=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Up"]/a:action/a:to' $HOME/.config/openbox/rc.xml)
|
|
focus=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:focus/a:followMouse' $HOME/.config/openbox/rc.xml)
|
|
areaclick=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/a:command' $HOME/.config/openbox/rc.xml)
|
|
|
|
|
|
|
|
# AREACLICK
|
|
if [[ "${areaclick}" == "areaclick" ]]; then
|
|
if source ~/.config/areaclick.conf ;then
|
|
if [[ "${sidearea}" -gt "0" ]];then
|
|
out+=("<big>${cbon}</big> <b>$_AREACLICK</b> (<i>$_AREA_WIDTH</i>: <b>${sidearea}px</b>),^checkout(sparea)")
|
|
else
|
|
out+=("<big>${cboff}</big> <b>$_AREACLICK</b> <i>$_STOPPED</i>,^checkout(sparea)")
|
|
fi
|
|
out2+=("^tag(sparea)")
|
|
out2+=("^sep(AreaClick)")
|
|
out2+=("^sep(<small><i>$_AREA_DESC</i></small>)")
|
|
#out2+=("$ABOUT_AREACLICK,mb-docs areaclick")
|
|
out2+=("^sep($_AREA_WIDTH (px))")
|
|
[[ "${sidearea}" == "0" ]] && out2+=("<big>${ron}</big> <b>0</b> (disabled),areaclick area 0;$me desktop") || out2+=("<big>${roff}</big> 0 (disable),areaclick area 0;$me desktop")
|
|
out2+=("^sep()")
|
|
[[ "${sidearea}" == "2" ]] && out2+=("<big>${ron}</big> <b>2px</b>,areaclick area 2;$me desktop") || out2+=("<big>${roff}</big> 2px,areaclick area 2;$me desktop")
|
|
[[ "${sidearea}" == "10" ]] && out2+=("<big>${ron}</big> <b>10px</b>,areaclick area 10;$me desktop") || out2+=("<big>${roff}</big> 10px,areaclick area 10;$me desktop")
|
|
[[ "${sidearea}" == "60" ]] && out2+=("<big>${ron}</big> <b>60px</b>,areaclick area 60;$me desktop") || out2+=("<big>${roff}</big> 60px,areaclick area 60;$me desktop")
|
|
[[ "${sidearea}" == "100" ]] && out2+=("<big>${ron}</big> <b>100px</b>,areaclick area 80;$me desktop") || out2+=("<big>${roff}</big> 100px,areaclick area 100;$me desktop")
|
|
[[ "${sidearea}" == "200" ]] && out2+=("<big>${ron}</big> <b>200px</b>,areaclick area 200;$me desktop") || out2+=("<big>${roff}</big> 200px,areaclick area 200;$me desktop")
|
|
out2+=("^sep()")
|
|
out2+=("$_EDIT_AREACONF,areaclick editconf")
|
|
out2+=("^sep()")
|
|
out2+=("$_RESET_AREACONF,^checkout(spreseta)")
|
|
out3+=("^tag(spreseta)")
|
|
out3+=("^sep($_RESET_SURE)")
|
|
out3+=("\"\"\"$_RESET_YES\"\"\", areaclick reset;$me desktop")
|
|
|
|
out2+=("^sep($_WM_MARGIN)")
|
|
m_top=$(obxml sel /a:openbox_config/a:margins/a:top)
|
|
m_bottom=$(obxml sel /a:openbox_config/a:margins/a:bottom)
|
|
m_left=$(obxml sel /a:openbox_config/a:margins/a:top)
|
|
m_right=$(obxml sel /a:openbox_config/a:margins/a:top)
|
|
out2+=("^sep(<big></big> <small>$m_left</small> <big></big> <small>$m_top</small> <small>$m_bottom</small> <big></big> <small>$m_right</small> <big></big>")
|
|
#out2+=("$OBCONF_MARG,obconf")
|
|
out2+=("^sep(<i>$_SET_ALL_MARG</i>)")
|
|
out2+=("0,obxml margin all 0;$me desktop")
|
|
out2+=("^sep()")
|
|
out2+=("1px,obxml margin all 1;$me desktop")
|
|
out2+=("2px,obxml margin all 2;$me desktop")
|
|
out2+=("4px,obxml margin all 4;$me desktop")
|
|
out2+=("8px,obxml margin all 8;$me desktop")
|
|
out2+=("16px,obxml margin all 16;$me desktop")
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
out+=("^sep($_CONKY_CLICK)")
|
|
[[ "${conky_leftclick}" == "off" ]] && out+=("<big>${cboff}</big> $_C_LCLICK,mb-setvar conky_leftclick=on;$me desktop") || out+=("<big>${cbon}</big> $_C_LCLICK,mb-setvar conky_leftclick=off;$me desktop")
|
|
[[ "${conky_rightclick}" == "off" ]] && out+=("<big>${cboff}</big> $_C_RCLICK,mb-setvar conky_rightclick=on;$me desktop") || out+=("<big>${cbon}</big> $_C_RCLICK,mb-setvar conky_rightclick=off;$me desktop")
|
|
out+=("^sep()")
|
|
[[ "${conky_basicmode}" == "on" ]] && out+=("<big>${cbon}</big> $_C_SIMPLIFIEDMENU,mb-setvar conky_basicmode=off;$me desktop") || out+=("<big>${cboff}</big> $_C_SIMPLIFIEDMENU,mb-setvar conky_basicmode=on;$me desktop")
|
|
|
|
out+=("^sep($_WMTWEAKS)")
|
|
if [[ "${areaclick}" != "areaclick" ]]; then
|
|
lclick=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/@name' $HOME/.config/openbox/rc.xml)
|
|
if [[ ! -z "$lclick" ]];then
|
|
[[ "$lclick" = "none" ]] && out+=("<big>${cboff}</big> $_SHOW_DESK,obxml show_desk on;$me desktop") || out+=("<big>${cbon}</big> $_SHOW_DESK,obxml show_desk off;$me desktop")
|
|
fi
|
|
else
|
|
if source ~/.config/areaclick.conf ;then
|
|
[[ "${cmd_center}" == "show_desktop" ]] && out+=("<big>${cbon}</big> $_SHOW_DESK,mb-setvar cmd_center=none $AREA_CFG;$me desktop") || out+=("<big>${cboff}</big> $_SHOW_DESK,mb-setvar cmd_center=show_desktop $AREA_CFG;$me desktop")
|
|
fi
|
|
fi
|
|
|
|
|
|
if [[ ! -z "$mousewheel" ]];then
|
|
[[ "$mousewheel" = "none" ]] && out+=("<big>${cboff}</big> $_SWITCH_DESK,obxml switch_desk on;$me desktop") || out+=("<big>${cbon}</big> $_SWITCH_DESK,obxml switch_desk off;$me desktop")
|
|
fi
|
|
[[ "$focus" = "no" ]] && out+=("<big>${cboff}</big> $_FOCUS,obxml focus_follow_mouse on;$me desktop") || out+=("<big>${cbon}</big> $_FOCUS,obxml focus_follow_mouse off;$me desktop")
|
|
|
|
out+=("^sep($_ADV_PROFILE)")
|
|
profile=${profile:-mabox}
|
|
out+=("$_PROFILE [ <b>${profile}</b> ],^checkout(profil)")
|
|
out2+=("^tag(profil)")
|
|
out2+=("^sep($_PROFILE)")
|
|
[[ "${profile}" == "mabox" ]] && out2+=("<big>${ron}</big> <b>mabox</b>: $_PRO_MABOX,$me desktop") || out2+=("<big>${roff}</big> <b>mabox</b>: $_PRO_MABOX,mabox-profile mabox;$me desktop")
|
|
[[ "${profile}" == "basic" ]] && out2+=("<big>${ron}</big> <b>basic</b>: $_PRO_BASIC,$me desktop") || out2+=("<big>${roff}</big> <b>basic</b>: $_PRO_BASIC,mabox-profile basic;$me desktop")
|
|
|
|
out+=("<big></big> Mabox <b>Colorizer</b> (gui),ycolorizer")
|
|
out+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left},^back()")
|
|
|
|
|
|
out+=("^tag(docs)")
|
|
out+=("^sep($_DOCS)")
|
|
case $LANG in
|
|
pl*)
|
|
out+=("<big></big> Mabox <b>Colorizer</b> GUI,ycolorizer")
|
|
out+=("<big></big> Poznaj SuperClick,jgdeskgrid -s")
|
|
out+=("^sep(Tutoriale (online))")
|
|
out+=("Wprowadzenie do Maboxa (5 min),xdg-open https://pl.maboxlinux.org/krotkie-wprowadzenie-do-pulpitu-maboxa/")
|
|
out+=("Przewodnik Użytkownika 2026 <span bgcolor='${warn_bgcolor}' fgcolor='${warn_fgcolor}'> nowy! </span>,xdg-open https://pl.maboxlinux.org/przewodnik-uzytkownika/wprowadzenie-do-mabox-linux/")
|
|
out+=("^sep(WWW)")
|
|
out+=(" Forum dyskusyjne,xdg-open https://forum.maboxlinux.org")
|
|
out+=(" Strona www,xdg-open https://maboxlinux.org")
|
|
out+=(" Manual,xdg-open https://manual.maboxlinux.org")
|
|
out+=(" Developer Blog,xdg-open https://blog.maboxlinux.org")
|
|
out+=("^sep()")
|
|
out+=(" Mabox na Distrowatch,xdg-open https://distrowatch.com/table.php?distribution=mabox")
|
|
out+=("^sep(Media społecznościowe)")
|
|
out+=(" Reddit,xdg-open https://old.reddit.com/r/MaboxLinux/")
|
|
out+=(" Youtube,xdg-open https://www.youtube.com/c/MaboxLinux")
|
|
out+=(" Odysee,xdg-open https://odysee.com/@mabox-linux:8")
|
|
out+=(" Facebook,xdg-open https://facebook.com/maboxlinux/")
|
|
out+=(" Twitter,xdg-open https://twitter.com/MaboxLinux/")
|
|
out+=(" Discord,xdg-open https://discord.com/invite/kFAuuh8GEw")
|
|
out+=("^sep(Lubisz Maboxa?)")
|
|
out+=("<span color='red'></span> Wesprzyj jego rozwój,xdg-open https://maboxlinux.org/donate/")
|
|
;;
|
|
*)
|
|
out+=("<big></big> Mabox <b>Colorizer</b> GUI,ycolorizer")
|
|
out+=("<big></big> SuperClick Trainer,jgdeskgrid -s")
|
|
out+=("^sep(Tutorials (online))")
|
|
out+=("5 min intro to Mabox Desktop,xdg-open https://blog.maboxlinux.org/a-quick-5-minutes-intro-to-mabox-desktop/")
|
|
out+=("Mabox User Guide 2026 <span bgcolor='${warn_bgcolor}' fgcolor='${warn_fgcolor}'> new! </span>,xdg-open https://maboxlinux.org/users-guide/introduction-to-mabox-linux-desktop/")
|
|
out+=("^sep(WWW)")
|
|
out+=(" Community forum,xdg-open https://forum.maboxlinux.org")
|
|
out+=(" Website,xdg-open https://maboxlinux.org")
|
|
out+=(" Manual,xdg-open https://manual.maboxlinux.org")
|
|
out+=(" Developer Blog,xdg-open https://blog.maboxlinux.org")
|
|
out+=("^sep()")
|
|
out+=(" Mabox on Distrowatch,xdg-open https://distrowatch.com/table.php?distribution=mabox")
|
|
out+=("^sep(Social media)")
|
|
out+=(" Reddit,xdg-open https://old.reddit.com/r/MaboxLinux/")
|
|
out+=(" Youtube,xdg-open https://www.youtube.com/c/MaboxLinux")
|
|
out+=(" Odysee,xdg-open https://odysee.com/@mabox-linux:8")
|
|
out+=(" Facebook,xdg-open https://facebook.com/maboxlinux/")
|
|
out+=(" Twitter,xdg-open https://twitter.com/MaboxLinux/")
|
|
out+=(" Discord,xdg-open https://discord.com/invite/kFAuuh8GEw")
|
|
out+=("^sep(Do you like Mabox?)")
|
|
out+=("<span color='red'></span> Support Mabox,xdg-open https://maboxlinux.org/donate/")
|
|
;;
|
|
esac
|
|
|
|
out+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left},^back()")
|
|
|
|
out+=("^tag(menus)")
|
|
out+=("^sep($_SIDE_LEFT)")
|
|
[[ $places_quicknav == false ]] && out+=("<big>${cboff}</big> $QUICK_NAV,mb-setvar places_quicknav=true;$me menus") || out+=("<big>${cbon}</big> $QUICK_NAV,mb-setvar places_quicknav=false;$me menus")
|
|
[[ $places_bookmarks == false ]] && out+=("<big>${cboff}</big> $_BOOKMARKS,mb-setvar places_bookmarks=true;$me menus") || out+=("<big>${cbon}</big> $_BOOKMARKS,mb-setvar places_bookmarks=false;$me menus")
|
|
if [[ -x "$(command -v VBoxManage)" ]]; then
|
|
[[ $places_vboxes == false ]] && out+=("<big>${cboff}</big> $_VBOXES,mb-setvar places_vboxes=true;$me menus") || out+=("<big>${cbon}</big> $_VBOXES,mb-setvar places_vboxes=false;$me menus")
|
|
fi
|
|
[[ $places_maboxtools == false ]] && out+=("<big>${cboff}</big> $_MABOX_TOOLS,mb-setvar places_maboxtools=true;$me menus") || out+=("<big>${cbon}</big> $_MABOX_TOOLS,mb-setvar places_maboxtools=false;$me menus")
|
|
out+=("^sep()")
|
|
out+=(" $_CUSTOM_COMMANDS ($_TOP), xdg-open $HOME/.config/mabox/places-prepend.csv")
|
|
out+=(" $_CUSTOM_COMMANDS ($_BOTTOM), xdg-open $HOME/.config/mabox/places-append.csv")
|
|
out+=("^sep()")
|
|
out+=("$_RESET $_CUSTOM_COMMANDS,^checkout(splccommands)")
|
|
out2+=("^tag(splccommands)")
|
|
out2+=("^sep($_RESET $_CUSTOM_COMMANDS)")
|
|
out2+=("^sep(<small>$_IN_LEFT</small>)")
|
|
out2+=("$_RESET,mb-reset leftpanel")
|
|
|
|
|
|
out+=("^sep($_MAINMENU_SETTINGS)")
|
|
|
|
[[ $search_field = "false" ]] && out+=("<big>${cboff}</big> $_SEARCH_FIELD,mb-setvar search_field=true;$me menus")||out+=("<big>${cbon}</big> $_SEARCH_FIELD,mb-setvar search_field=false;$me menus")
|
|
[[ $apps_in_submenu == "true" ]] && out+=("<big>${cbon}</big> $_APPS_SUB,mb-setvar apps_in_submenu=false;$me menus") || out+=("<big>${cboff}</big> $_APPS_SUB,mb-setvar apps_in_submenu=true;$me menus")
|
|
if [[ $jgmenu_use_icons == "true" ]];then
|
|
out+=("<big>${cbon}</big> $_ICONS,mb-setvar jgmenu_use_icons=false;$me menus")
|
|
out+=("$_ICON_SET [ <b>$jgmenu_icon_theme</b> ],^checkout(mmicons)")
|
|
out2+=("^tag(mmicons)")
|
|
out2+=("^sep($_ICON_SET)")
|
|
out2+=("Numix Square,mb-setvar jgmenu_icon_theme=Numix-Square;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
out2+=("Numix Circle,mb-setvar jgmenu_icon_theme=Numix-Circle;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
if [ -d /usr/share/icons/Papirus ];then
|
|
out2+=("Papirus,mb-setvar jgmenu_icon_theme=Papirus;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
else
|
|
out2+=("$_INSTALL Papirus icons, pamac-installer papirus-icon-theme")
|
|
fi
|
|
if [ -d /usr/share/icons/BeautyLine ];then
|
|
out2+=("BeautyLine,mb-setvar jgmenu_icon_theme=BeautyLine;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
else
|
|
out2+=("$_INSTALL BeautyLine icons, pamac-installer beautyline")
|
|
fi
|
|
if [ -d /usr/share/icons/BeautySolar ];then
|
|
out2+=("BeautySolar,mb-setvar jgmenu_icon_theme=BeautySolar;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
else
|
|
out2+=("$_INSTALL BeautySolar icons, pamac-installer beautysolar-icon-theme")
|
|
fi
|
|
if [ -d /usr/share/icons/Sardi-Arc ];then
|
|
out2+=("^sep()")
|
|
out2+=("Sardi,mb-setvar jgmenu_icon_theme=Sardi;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
out2+=("Sardi-Orb-Colora,mb-setvar jgmenu_icon_theme=Sardi-Orb-Colora;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
out2+=("Sardi-Flat,mb-setvar jgmenu_icon_theme=Sardi-Flat;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
out2+=("Sardi-Flexible,mb-setvar jgmenu_icon_theme=Sardi-Flexible;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
out2+=("Sardi-Mono,mb-setvar jgmenu_icon_theme=Sardi-Mono;mb-setvar jgmenu_use_icons=true;$me menus")
|
|
else
|
|
out2+=("^sep()")
|
|
out2+=("$_INSTALL Sardi icons, pamac-installer sardi-icons")
|
|
fi
|
|
else
|
|
out+=("<big>${cboff}</big> $_ICONS,mb-setvar jgmenu_use_icons=true;$me menus menus")
|
|
fi
|
|
|
|
out+=("^sep()")
|
|
out+=(" $_CUSTOM_COMMANDS ($_FAVORITES), xdg-open $HOME/.config/mabox/favorites.csv")
|
|
out+=(" $_CUSTOM_COMMANDS ($_BELOW_APPS), xdg-open $HOME/.config/mabox/mainmenu_below_apps.csv")
|
|
out+=("$_RESET $_CUSTOM_COMMANDS,^checkout(ccommands)")
|
|
out2+=("^tag(ccommands)")
|
|
out2+=("^sep($_RESET $_CUSTOM_COMMANDS)")
|
|
out2+=("^sep(<small>$_IN_MAIN</small>)")
|
|
out2+=("$_RESET,mb-reset mainmenu")
|
|
|
|
out+=("^sep($_SIDE_RIGHT)")
|
|
#out2+=("^sep(<small>$_IN_RIGHT</small>)")
|
|
out+=(" $_CUSTOM_COMMANDS ($_TOP), xdg-open $HOME/.config/mabox/right-prepend.csv")
|
|
out+=(" $_CUSTOM_COMMANDS ($_BOTTOM), xdg-open $HOME/.config/mabox/right-append.csv")
|
|
out+=("^sep()")
|
|
out+=("$_RESET $_CUSTOM_COMMANDS,^checkout(sprccommands)")
|
|
out2+=("^tag(sprccommands)")
|
|
out2+=("^sep($_RESET $_CUSTOM_COMMANDS)")
|
|
out2+=("^sep(<small>$_IN_RIGHT</small>)")
|
|
out2+=("$_RESET,mb-reset rightpanel")
|
|
|
|
out+=("^sep($_ALLMENU_SETTINGS)")
|
|
out+=("$_CHOOSE $_COLOR_SCHEME ,mb-jgtools mstylesel")
|
|
# FONTS
|
|
out+=("^sep($_FONTS)")
|
|
out+=("<big></big> $_TITLE_FONT [ <b>$menu_sep_font_family $menu_sep_font_size</b> ],^checkout(sptitlefont)")
|
|
out+=("<big></big> $_ITEM_FONT [ <b>$menu_font_family $menu_font_size</b> ],^checkout(spitemfont)")
|
|
out+=("$_LINEHEIGHT [<b>$((item_height_factor / 2))%</b>],^checkout(splineheight)")
|
|
|
|
out2+=("^tag(spitemfont)")
|
|
out2+=("^sep($_ITEM_FONT)")
|
|
out2+=("<big></big> $_FONT_CUSTOM,mb-setfont menu_item;$me")
|
|
out2+=("^sep()")
|
|
|
|
if [ -f "$HOME/.config/mabox/fonts.list" ];then
|
|
mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list)
|
|
else
|
|
mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list)
|
|
cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/
|
|
fi
|
|
|
|
if [ "${#favfonts[@]}" -gt 0 ];then
|
|
out2+=("^sep($_FONT_FAMILY)")
|
|
for fon in "${favfonts[@]}";do
|
|
[[ "$menu_font_family" == "$fon" ]] && out2+=("<big>${ron}</big> <span font_family=\"${fon}\">${fon}</span>,$me menus") || out2+=("<big>${roff}</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_font_family='${fon}'\";$me menus")
|
|
done
|
|
fi
|
|
out2+=("^sep()")
|
|
out2+=("<small> $_EDIT_FAVFONTS</small>,geany ~/.config/mabox/fonts.list")
|
|
out2+=("^sep($_FONT_SIZE)")
|
|
out2+=("<big></big> $_INCREASE <b>$((menu_font_size+1)) px</b>,mb-setvar menu_font_size=$((menu_font_size+1));$me menus")
|
|
out2+=("<big></big> $_DECREASE <b>$((menu_font_size-1)) px</b>,mb-setvar menu_font_size=$((menu_font_size-1));$me menus")
|
|
out2+=("^sep()")
|
|
sizes=(14 13 12 11 10 9 8)
|
|
for i in "${sizes[@]}"
|
|
do
|
|
[[ "$menu_font_size" == "$i" ]] && out2+=("<big>${ron}</big> <b>$i px</b>,$me") || out2+=("<big>${roff}</big> $i px,mb-setvar menu_font_size=$i;$me menus")
|
|
done
|
|
|
|
|
|
out2+=("^tag(sptitlefont)")
|
|
out2+=("^sep($_TITLE_FONT)")
|
|
out2+=("<big></big> $_FONT_CUSTOM,mb-setfont menu_sep;$me menus")
|
|
out2+=("^sep()")
|
|
|
|
if [ "${#favfonts[@]}" -gt 0 ];then
|
|
out2+=("^sep($_FONT_FAMILY)")
|
|
for fon in "${favfonts[@]}";do
|
|
[[ "$menu_sep_font_family" == "$fon" ]] && out2+=("<big>${ron}</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>${roff}</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_sep_font_family='${fon}'\";$me menus")
|
|
done
|
|
fi
|
|
out2+=("^sep()")
|
|
out2+=("<small> $_EDIT_FAVFONTS</small>,geany ~/.config/mabox/fonts.list")
|
|
out2+=("^sep($_FONT_SIZE)")
|
|
out2+=("<big></big> $_INCREASE <b>$((menu_sep_font_size+1)) px</b>,mb-setvar menu_sep_font_size=$((menu_sep_font_size+1));$me menus")
|
|
out2+=("<big></big> $_DECREASE <b>$((menu_sep_font_size-1)) px</b>,mb-setvar menu_sep_font_size=$((menu_sep_font_size-1));$me menus")
|
|
out2+=("^sep()")
|
|
sizes=(14 13 12 11 10 9 8)
|
|
for i in "${sizes[@]}"
|
|
do
|
|
[[ "$menu_sep_font_size" == "$i" ]] && out2+=("<big>${ron}</big> <b>$i px</b>,$me menus") || out2+=("<big>${roff}</big> $i px,mb-setvar menu_sep_font_size=$i;$me menus")
|
|
done
|
|
|
|
out2+=("^tag(splineheight)")
|
|
for i in 160 180 200 240 280 320 400; do
|
|
[[ "${item_height_factor}" == "$i" ]] && out2+=("<big>${ron}</big> <b>$((i / 2))%</b>,$me menus") || out2+=("<big>${roff}</big> $((i / 2))%,mb-setvar item_height_factor=${i};$me menus")
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
out+=("^sep($_ADVANCED)")
|
|
out+=("<big></big> Menu Colorizer,colorizer-menus -s")
|
|
|
|
|
|
|
|
out+=("^sep()")
|
|
out+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left},^back()")
|
|
|
|
printf '%s\n' "${out[@]}"
|
|
printf '%s\n' "${out2[@]}"
|
|
}
|
|
|
|
WEBBROWSER="exo-open --launch WebBrowser"
|
|
|
|
OSNAME=$(lsb_release -d | awk '{print $2}')
|
|
OSVERSION=$(lsb_release -r | awk '{print $2}')
|
|
#OSCODE=$(lsb_release -c | awk '{print $2}')
|
|
OSCODE=$(grep CODENAME /etc/lsb-release |cut -d '=' -f2)
|
|
|
|
. /usr/share/mb-jgtools/jgtools.inc
|
|
|
|
#MENU GŁÓWNE
|
|
main() {
|
|
#mb-setvar jgtools_last="\"main ipc\""
|
|
|
|
CONFIG_FILE=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE}" EXIT
|
|
|
|
POSITION_MODE=${1:-pointer}
|
|
case "$1" in
|
|
top)
|
|
MENU_HALIGN=center
|
|
MENU_VALIGN=top
|
|
;;
|
|
center)
|
|
MENU_HALIGN=center
|
|
MENU_VALIGN=center;;
|
|
*):;;
|
|
esac
|
|
MENU_MARGIN_Y=80
|
|
|
|
#HIDE_BACK_ITEMS=1
|
|
|
|
panels_topmargin=0
|
|
case $LANG in
|
|
pl*) TYPE_TO_SEARCH="pisz aby wyszukać"
|
|
APPS="Programy"
|
|
KEYS="Skróty klawiszowe"
|
|
SCREENSHOT="Zrzut ekranu"
|
|
WALLMENU="Ustaw tapetę"
|
|
LOCKSCR="Zablokuj ekran"
|
|
EXIT="Wyjście..."
|
|
HELP="Pomoc"
|
|
UGUIDE="Przewodnik Mabox (online)"
|
|
SETTINGS="ustawienia"
|
|
;;
|
|
es*) TYPE_TO_SEARCH="Buscar"
|
|
APPS="Aplicationes"
|
|
KEYS="Atajos del teclado"
|
|
WALLMENU="Wallpaper..."
|
|
SCREENSHOT="Capturar Pantalla"
|
|
LOCKSCR="Bloquear pantalla"
|
|
EXIT="Salir..."
|
|
HELP="Ayuda"
|
|
UGUIDE="Mabox User Guide (online)"
|
|
SETTINGS="settings";;
|
|
de*)
|
|
TYPE_TO_SEARCH="Tippe für Suche"
|
|
APPS="Programme"
|
|
KEYS="Tastenkombinationen"
|
|
WALLMENU="Wallpaper..."
|
|
SCREENSHOT="Bildschirmfoto"
|
|
LOCKSCR="Sperrbildschirm"
|
|
EXIT="Verlassen..."
|
|
HELP="Hilfe"
|
|
UGUIDE="Mabox Users Guide (online)"
|
|
SETTINGS="settings";;
|
|
*) TYPE_TO_SEARCH="Type to Search"
|
|
APPS="Applications"
|
|
KEYS="Keybindings"
|
|
WALLMENU="Wallpaper..."
|
|
SCREENSHOT="Screenshot"
|
|
LOCKSCR="Lock screen"
|
|
EXIT="Exit..."
|
|
HELP="Help"
|
|
UGUIDE="Mabox Users Guide (online)"
|
|
SETTINGS="settings";;
|
|
esac
|
|
|
|
# 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,$TYPE_TO_SEARCH"
|
|
fi
|
|
|
|
#apps_in_submenu=true
|
|
rm -f ~/.config/jgmenu/append.csv
|
|
if [[ $apps_in_submenu == true ]]
|
|
then
|
|
|
|
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
|
|
${SEARCH_TEXT}
|
|
${SEARCH_FIELD}
|
|
|
|
. ~/.config/mabox/favorites.csv
|
|
$APPS,^checkout(apps),applications-other
|
|
. ~/.config/mabox/mainmenu_below_apps.csv
|
|
^sep()
|
|
$KEYS,mb-kb --gui,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
|
|
|
|
#^tag(userguide)
|
|
#. /usr/share/mb-jgtools/userguide.csv
|
|
|
|
. ~/.config/mabox/settings_tags.csv
|
|
^tag(apps)
|
|
EOF
|
|
else
|
|
|
|
cat <<EOF > $HOME/.config/jgmenu/prepend.csv
|
|
${SEARCH_TEXT}
|
|
${SEARCH_FIELD}
|
|
|
|
. ~/.config/mabox/favorites.csv
|
|
EOF
|
|
|
|
cat <<EOF > $HOME/.config/jgmenu/append.csv
|
|
. ~/.config/mabox/mainmenu_below_apps.csv
|
|
^sep()
|
|
$KEYS,mb-kb --gui,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
|
|
|
|
|
|
#^tag(userguide)
|
|
#. /usr/share/mb-jgtools/userguide.csv
|
|
|
|
. ~/.config/mabox/settings_tags.csv
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
[[ "$jgmenu_use_icons" == "false" ]] && icons=0 iconmargin=0 || icons=1 iconmargin=8
|
|
mkconfigfile
|
|
|
|
CACHE_DIR="$HOME/.cache/mmenu"
|
|
mkdir -p ${CACHE_DIR}
|
|
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
|
XDG_CACHE_HOME=${CACHE_DIR} jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
|
|
#trap 'on_exit' EXIT
|
|
}
|
|
|
|
# PANEL PO PRAWEJ AKTUALIZACE-USTAWIENIA-POMOC
|
|
right() {
|
|
#mb-setvar jgtools_last="\"right\""
|
|
|
|
CONFIG_FILE=$(mktemp)
|
|
MENU_ITEMS=$(mktemp)
|
|
RHEAD=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS} ${RHEAD}" EXIT
|
|
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0
|
|
#BOTTOM_IMG=${right_bottom_img:-/usr/share/mb-jgtools/mabox_3D_gold.png}
|
|
MENU_HALIGN="right"
|
|
ITEM_HALIGN="left"
|
|
JGWIDTH=40
|
|
TABS="100"
|
|
MENU_PADDING_TOP=$((jgtools_padding + 70))
|
|
menu_margin_x=${submenu_spacing:-0}
|
|
#panels_topmargin=${panels_topmargin:-0}
|
|
#### Compact or full height
|
|
if [[ $panels_heightpos == "full" ]]; then
|
|
eval $(xdotool getdisplaygeometry --shell)
|
|
MENU_HEIGHT_MAX="$((HEIGHT - 80))"
|
|
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
|
|
MENU_RADIUS="0"
|
|
menu_margin_x="0"
|
|
MENU_MARGIN_Y=40
|
|
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
|
|
|
|
case $LANG in
|
|
pl*)
|
|
TYPE_TO_SEARCH="pisz, aby wyszukać"
|
|
_MY_COMMANDS="Moje polecenia"
|
|
_EDIT_OWN_COMMANDS="Edytuj własne komendy"
|
|
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"
|
|
SETTINGS_MENU="Konfiguracja 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"
|
|
MSM="Menadżer Ustawień Manjaro"
|
|
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"
|
|
ARANDR="Rozdzielczość ekranu"
|
|
SYSINFO_TITLE="Sys info"
|
|
SYSINFO="Informacje o systemie"
|
|
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"
|
|
UGUIDE_TITLE="Przewodnik Użytkownika Mabox"
|
|
UGUIDE=". /usr/share/mb-jgtools/userguide_PL.csv"
|
|
FINISHED=" Zakończono! Wciśnij ENTER by wyjść"
|
|
_MENU_SETTINGS="ustawienia menu"
|
|
;;
|
|
es*)
|
|
TYPE_TO_SEARCH="Buscar"
|
|
_MY_COMMANDS="My commands"
|
|
_EDIT_OWN_COMMANDS="Edit own commands"
|
|
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"
|
|
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"
|
|
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"
|
|
ARANDR="Resolución de pantalla"
|
|
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"
|
|
UGUIDE_TITLE="Mabox User Guide"
|
|
UGUIDE=". /usr/share/mb-jgtools/userguide.csv"
|
|
FINISHED=" Finished! Press ENTER to quit"
|
|
_MENU_SETTINGS="menu settings"
|
|
;;
|
|
*)
|
|
TYPE_TO_SEARCH="type to search"
|
|
_MY_COMMANDS="My commands"
|
|
_EDIT_OWN_COMMANDS="Edit own commands"
|
|
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"
|
|
SETTINGS_MENU="Mabox Config"
|
|
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"
|
|
MSM="Manjaro Settings Manager"
|
|
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"
|
|
ARANDR="Screen resolution"
|
|
SYSINFO_TITLE="Sys info"
|
|
SYSINFO="System information"
|
|
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"
|
|
UGUIDE_TITLE="Mabox User Guide"
|
|
UGUIDE=". /usr/share/mb-jgtools/userguide.csv"
|
|
FINISHED=" Finished! Press ENTER to quit"
|
|
_MENU_SETTINGS="menu settings"
|
|
;;
|
|
esac
|
|
|
|
[ $jgmenu_use_icons == false ] && icons=0 iconmargin=0 || icons=1 iconmargin=8
|
|
|
|
|
|
if [ $panels_heightpos == "full" ]; then
|
|
|
|
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | 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
|
|
|
|
|
|
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
|
MENU_PADDING_TOP=$((jgtools_padding + 152))
|
|
cat <<EOF > ${RHEAD}
|
|
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
|
@rect,,$((jgtools_padding + 2)),$((jgtools_padding + 14)),266,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>
|
|
#@icon,,$((jgtools_padding + 2)),$((jgtools_padding + 2)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
|
|
@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),160,22,0,left,top,#222222 50,#222222 80,
|
|
@search,,$((jgtools_padding + 8)),$((jgtools_padding + 120)),292,20,4,left,top,#EEEEEE,##EEEEEE,""" $TYPE_TO_SEARCH"""
|
|
EOF
|
|
else
|
|
cat <<EOF > ${RHEAD}
|
|
#@icon,,$((jgtools_padding + 2)),$((jgtools_padding + 10)),48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
|
|
@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>
|
|
@search,,$((gtools_padding + 80)),$((jgtools_padding + 50)),292,20,4,left,top,auto,#262626,""" $TYPE_TO_SEARCH"""
|
|
EOF
|
|
fi
|
|
|
|
mkconfigfile
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
. ${RHEAD}
|
|
$_MY_COMMANDS,^root(commands),openbox
|
|
|
|
|
|
^sep($SETTINGS)
|
|
#$MCC,mcc,mcc,distributor-logo-mabox
|
|
#^sep()
|
|
$SETTINGS_MENU,^root(msettings),mbcc
|
|
$SYS_AND_HARDWARE,^root(system),audiocard
|
|
|
|
^sep($SOFT_MANAGEMENT)
|
|
$PAMAC_UPDATE,pamac-manager --updates,system-upgrade
|
|
$CLI_UPDATE,mb-cli update,openterm
|
|
$PAMAC,pamac-manager,pamac
|
|
$RENEW_KEYS,^term(sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring;read -p "${FINISHED}"),keysync
|
|
$MIRROR_RANK,^root(mirrory),download
|
|
|
|
^sep($HELP)
|
|
|
|
$UGUIDE_TITLE,^root(userguide),distributor-logo-mabox
|
|
Mabox Forum,xdg-open https://forum.maboxlinux.org,distributor-logo-mabox
|
|
#$SHORTCUTS,^pipe(jgkeys-pipe),key_bindings
|
|
$SHORTCUTS,mb-kb --gui,key_bindings
|
|
$ONLINE_RES,^root(weblinks),web-browser
|
|
|
|
^sep($OTHER)
|
|
$SCREENSHOT,mb-jgtools screenshot,emblem-photos
|
|
|
|
. $HOME/.config/mabox/right-append.csv
|
|
. $HOME/.config/mabox/exit.csv
|
|
^sep()
|
|
<small> $_MENU_SETTINGS</small>,mb-jgtools places menus,preferences-desktop-theme
|
|
^tag(commands)
|
|
^sep($_MY_COMMANDS)
|
|
. $HOME/.config/mabox/right-prepend.csv
|
|
^sep()
|
|
<small> $_EDIT_OWN_COMMANDS</small>,xdg-open $HOME/.config/mabox/right-prepend.csv
|
|
${arrow_string_left} ${arrow_string_left},^back()
|
|
|
|
|
|
^tag(system)
|
|
^sep($SETTINGS)
|
|
$MCC,mcc,distributor-logo-mabox
|
|
^sep($SYS_AND_HARDWARE)
|
|
$MSM,manjaro-settings-manager,distributor-logo-manjaro
|
|
^sep()
|
|
$LOCALE_SETTINGS,manjaro-settings-manager -m msm_locale,chronometer
|
|
$LANGUAGE_PACKAGES,manjaro-settings-manager -m msm_language_packages,globe
|
|
$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
|
|
^sep()
|
|
$ARANDR,arandr,monitor
|
|
^sep($SYSINFO_TITLE)
|
|
$SYSINFO,^pipe(jgsysinfo-pipe),distributor-logo-linux
|
|
${arrow_string_left} $BACK,^back()
|
|
|
|
^tag(mirrory)
|
|
$FAST <small>pacman-mirrors -f5</small>,mb-cli mirrors
|
|
$ALL <small>pacman-mirrors -i -c all</small>,mb-cli mirrors_all
|
|
^sep()
|
|
${arrow_string_left} $BACK,^back()
|
|
|
|
^tag(msettings)
|
|
. ~/.config/mabox/settings.csv
|
|
^sep()
|
|
${arrow_string_left} $BACK,^back()
|
|
. ~/.config/mabox/settings_tags.csv
|
|
|
|
^tag(userguide)
|
|
$UGUIDE
|
|
^sep()
|
|
${arrow_string_left} $BACK,^back()
|
|
^tag(weblinks)
|
|
#^sep($ONLINE_RES)
|
|
^sep(Mabox Linux)
|
|
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
|
|
^sep(Manjaro)
|
|
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
|
|
|
|
^sep(ArchLinux)
|
|
ArchWiki,xdg-open https://wiki.archlinux.org/,distributor-logo-archlinux
|
|
Manual pages indexing service,xdg-open https://man.archlinux.org/,distributor-logo-archlinux
|
|
^sep(Openbox)
|
|
OpenBox,xdg-open https://openbox.org/help/Contents,openbox
|
|
OpenBox ArchWiki,xdg-open https://wiki.archlinux.org/index.php/Openbox,openbox
|
|
^sep(Jgmenu)
|
|
Jgmenu homesite,xdg-open https://jgmenu.github.io/,jgmenu
|
|
Jgmenu GitHub,xdg-open https://github.com/johanmalm/jgmenu,jgmenu
|
|
|
|
^sep(Terminator)
|
|
Terminator GitHub,xdg-open https://gnome-terminator.github.io/,terminator
|
|
Terminator Docs,xdg-open https://gnome-terminator.readthedocs.io/en/latest/,terminator
|
|
|
|
^sep(Tint2)
|
|
Tint2 GitLab,xdg-open https://gitlab.com/o9000/tint2,tint2
|
|
Tint2 ArchWiki,xdg-open https://wiki.archlinux.org/index.php/Tint2,tint2
|
|
^sep(Conky)
|
|
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
|
|
|
|
^sep()
|
|
${arrow_string_left} $BACK,^back()
|
|
|
|
EOF
|
|
|
|
CACHE_DIR="$HOME/.cache/mrightpanel"
|
|
mkdir -p ${CACHE_DIR}
|
|
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
|
XDG_CACHE_HOME=${CACHE_DIR} jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|
}
|
|
|
|
places() {
|
|
#mb-setvar jgtools_last="\"places\""
|
|
me="mb-jgtools places"
|
|
places_maboxtools=${places_maboxtools:-true}
|
|
|
|
|
|
case "$1" in
|
|
commands)option="--checkout=commands";;
|
|
docs)option="--checkout=docs";;
|
|
desktop)option="--checkout=desktop";;
|
|
menus)option="--checkout=menus";;
|
|
*)option="";;
|
|
esac
|
|
|
|
|
|
CONFIG_FILE=$(mktemp)
|
|
MENU_ITEMS=$(mktemp)
|
|
QNAV=$(mktemp)
|
|
MTOOLS=$(mktemp)
|
|
LHEAD=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS} ${QNAV} ${LHEAD}" EXIT
|
|
|
|
case $LANG in
|
|
pl*)
|
|
_MY_COMMANDS="Moje polecenia"
|
|
_DOCS="Pomoc i Dokumentacja"
|
|
_DESKTOP_SETTINGS="Ustawienia Pulpitu Mabox"
|
|
_MENU_SETTINGS="Ustawienia Menu"
|
|
QUICK_NAV="Szybka nawigacja"
|
|
HOME_DIR="Katalog Domowy"
|
|
ROOTDIR="Katalog główny"
|
|
PIPEMENUS="Narzędzia"
|
|
_CONFIG_FONTS="Konfiguruj <b>Czcionki</b>"
|
|
POPINSTALL="Instaluj popularne programy"
|
|
SYSINFO="Informacje o systemie"
|
|
SHORTCUTS="Skróty klawiszowe"
|
|
MENUPANELS="Ustawienia Menu/Paneli"
|
|
TINT2SETTINGS="Ustawienia panelu Tint2"
|
|
PICOMSETTINGS="Ustawienia Picom"
|
|
CONKYSETTINGS="Zarządzaj Conky"
|
|
_COLORIZER="Mabox <b>Colorizer</b>"
|
|
SSH_CONN="Połącz po SSH"
|
|
DESKMNGR="Desktop Session Manager"
|
|
DESKTOPS="Pulpity i Okna"
|
|
SUPERCLICK="SuperClick"
|
|
WALLCHANGER="Tapety i stylizacja pulpitu"
|
|
_MUSIC_SOUND_MENU="Menu Muzyka & Dźwięki"
|
|
LOCKSCREEN="Blokada Ekranu"
|
|
MBHELPER="Paleta komend"
|
|
_EDIT_OWN_COMMANDS="Edytuj własne komendy"
|
|
_MENU_SETTINGS="ustawienia menu"
|
|
;;
|
|
es*)
|
|
_MY_COMMANDS="My Commands"
|
|
_DOCS="Docs & Helpers"
|
|
_DESKTOP_SETTINGS="Mabox Desktop Settings"
|
|
_MENU_SETTINGS="Menu Settings"
|
|
QUICK_NAV="Navegación rápida"
|
|
HOME_DIR="Carpeta personal"
|
|
ROOTDIR="Directorio raíz"
|
|
PIPEMENUS="Menu con extras"
|
|
_CONFIG_FONTS="Configure <b>Fonts</b>"
|
|
POPINSTALL="Instalar Programas populares"
|
|
SYSINFO="System information"
|
|
SHORTCUTS="Atajos del teclado"
|
|
MENUPANELS="Menu/Paneles laterales"
|
|
TINT2SETTINGS="Tint2 panel settings"
|
|
PICOMSETTINGS="Picom compositor settings"
|
|
CONKYSETTINGS="Conky Manager"
|
|
_COLORIZER="Mabox <b>Colorizer</b>"
|
|
SSH_CONN="Conexiones SSH"
|
|
DESKMNGR="Desktop Session Manager"
|
|
DESKTOPS="Desktops and Windows"
|
|
SUPERCLICK="SuperClick"
|
|
WALLCHANGER="Wallpaper & Desktop <b>styling</b>"
|
|
_MUSIC_SOUND_MENU="Music & Sound menu"
|
|
LOCKSCREEN="Screen Locker"
|
|
MBHELPER="Cmd palette"
|
|
_EDIT_OWN_COMMANDS="Edit own commands"
|
|
_MENU_SETTINGS="menu settings"
|
|
;;
|
|
*)
|
|
_MY_COMMANDS="My Commands"
|
|
_DOCS="Docs & Helpers"
|
|
_DESKTOP_SETTINGS="Mabox Desktop Settings"
|
|
_MENU_SETTINGS="Menu Settings"
|
|
QUICK_NAV="Quick Navigation"
|
|
HOME_DIR="Home Directory"
|
|
ROOTDIR="Main Directory"
|
|
PIPEMENUS="Mabox Tools"
|
|
_CONFIG_FONTS="Configure <b>Fonts</b>"
|
|
POPINSTALL="Install popular apps"
|
|
SYSINFO="System information"
|
|
SHORTCUTS="Keyboard shortcuts"
|
|
MENUPANELS="Menu/Sidepanels settings"
|
|
TINT2SETTINGS="Tint2 panel settings"
|
|
PICOMSETTINGS="Picom compositor settings"
|
|
CONKYSETTINGS="Conky Manager"
|
|
_COLORIZER="Mabox <b>Colorizer</b>"
|
|
SSH_CONN="SSH connections"
|
|
DESKMNGR="Desktop Session Manager"
|
|
DESKTOPS="Desktops and Windows"
|
|
SUPERCLICK="SuperClick"
|
|
WALLCHANGER="Wallpaper & Desktop <b>styling</b>"
|
|
_MUSIC_SOUND_MENU="Music & Sound menu"
|
|
LOCKSCREEN="Screen Locker"
|
|
MBHELPER="Cmd palette"
|
|
_EDIT_OWN_COMMANDS="Edit own commands"
|
|
_MENU_SETTINGS="menu settings"
|
|
;;
|
|
esac
|
|
|
|
|
|
#panels_topmargin=${panels_topmargin:-0}
|
|
|
|
menu_margin_x=${submenu_spacing:-0}
|
|
[ $panels_topmargin == 0 ] && menu_margin_x=0
|
|
#### Compact or full height
|
|
if [[ $panels_heightpos == "full" ]]; then
|
|
eval $(xdotool getdisplaygeometry --shell)
|
|
MENU_HEIGHT_MAX="$((HEIGHT - 88))"
|
|
MENU_RADIUS="0"
|
|
menu_margin_x="0"
|
|
MENU_MARGIN_Y=44
|
|
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
|
|
|
|
TABS=200
|
|
JGWIDTH=40
|
|
icons=0
|
|
iconmargin=0
|
|
#MENU_PADDING_TOP=$((jgtools_padding + 60))
|
|
#BOTTOM_IMG=${places_bottom_img:-/usr/share/mb-jgtools/mabox_3D_silver.png}
|
|
#if [[ $places_softwarepipe || $places_sysinfopipe || $places_keyspipe ]];then pipeseparator="^sep($PIPEMENUS)";fi
|
|
|
|
#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></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
|
|
EOF
|
|
else
|
|
QNAV=""
|
|
fi
|
|
|
|
[ -v places_maboxtools ] && : || mb-setvar places_maboxtools=true
|
|
if [ "${places_maboxtools}" == "true" ];then
|
|
places_softwarepipe=${places_softwarepipe:-true}
|
|
places_jgdeskmngr=${places_jgdeskmngr:-true}
|
|
|
|
#[ $places_menusettingspipe == true ] && menusettingspipe="<big></big> $MENUPANELS,^pipe(jgmenusettings-pipe -r)" && pipesep="^sep($PIPEMENUS)"
|
|
#[ $places_sysinfopipe == true ] && sysinfopipe="<big></big> $SYSINFO,^pipe(jgsysinfo-pipe -r)" && pipesep="^sep($PIPEMENUS)"
|
|
[ $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_jgdeskmngr == true || -z ${places_jgdeskmngr} ]] && jgdeskmngr="<big></big> $DESKMNGR,^pipe(jgdeskmngr -r)" && pipesep="^sep($PIPEMENUS)"
|
|
[[ $places_jgdeskgrid == true || -z ${places_jgdeskgrid} ]] && jgdeskgrid="<big></big> $SUPERCLICK,jgdeskgrid -s" && pipesep="^sep($PIPEMENUS)"
|
|
[[ $places_jglockscreen == true || -z ${places_jglockscreen} ]] && jglockscreen="<big></big> $LOCKSCREEN,^pipe(jglockscreen -r)" && pipesep="^sep($PIPEMENUS)"
|
|
cat <<EOF > ${MTOOLS}
|
|
$pipesep
|
|
$softwarepipe
|
|
^sep()
|
|
$jgdeskgrid
|
|
$jglockscreen
|
|
$jgdeskmngr
|
|
$sshpipe
|
|
#<big></big> $_MUSIC_SOUND_MENU,mb-music -s
|
|
#$sysinfopipe
|
|
#<big></big> $MBHELPER <span bgcolor="#333333" color="#d3d3d3"> <small> + F1</small> </span>,mbhelper -s
|
|
#$menusettingspipe
|
|
^sep()
|
|
<big></big> $_COLORIZER,ycolorizer
|
|
EOF
|
|
else
|
|
MTOOLS=""
|
|
fi
|
|
|
|
|
|
|
|
# VBOXES
|
|
if [[ -x "$(command -v VBoxManage)" ]]; then
|
|
[[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes=""
|
|
fi
|
|
if [ $panels_heightpos == "full" ]; then
|
|
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | 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
|
|
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
|
MENU_PADDING_TOP=$((jgtools_padding + 152))
|
|
cat <<EOF > ${LHEAD}
|
|
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
|
|
|
@rect,,$((jgtools_padding + 2)),$((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>
|
|
#@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
|
|
|
|
mkconfigfile
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
. ${LHEAD}
|
|
<big></big> $_MY_COMMANDS,^root(commands)
|
|
<big></big> $_DOCS,^root(docs)
|
|
<big></big> $_DESKTOP_SETTINGS,^root(desktop)
|
|
#<big></big> $_MENU_SETTINGS,^root(menus)
|
|
#. $HOME/.config/mabox/places-prepend.csv
|
|
. ${QNAV}
|
|
|
|
$(gtkbookmarks)
|
|
. ${MTOOLS}
|
|
|
|
|
|
${vboxes}
|
|
. $HOME/.config/mabox/places-append.csv
|
|
<small> $_MENU_SETTINGS</small>,^root(menus)
|
|
$(tabs)
|
|
EOF
|
|
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} ${option} 2>/dev/null
|
|
}
|
|
|
|
mblogout() {
|
|
jgmenu_icon_theme="Numix-Circle"
|
|
if [[ -n "$1" ]]
|
|
then
|
|
POSITION_MODE=${1:-pointer}
|
|
else
|
|
MENU_HALIGN="center"
|
|
MENU_VALIGN="center"
|
|
fi
|
|
CONFIG_FILE=$(mktemp)
|
|
MENU_ITEMS=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS};#wmctrl -k off" EXIT
|
|
|
|
case $LANG in
|
|
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..."
|
|
;;
|
|
esac
|
|
jgtools_padding=${jgtools_padding:-0}
|
|
#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"
|
|
icons=1
|
|
iconmargin=12
|
|
item_height_factor=300
|
|
#jgmenu_font="Noto Sans Medium 11"
|
|
|
|
mkconfigfile
|
|
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
|
|
|
|
#wmctrl -k on
|
|
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | 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
|
|
|
|
# system uptime
|
|
UPT="$(uptime -p)"
|
|
UPT="${UPT/up /}"
|
|
UPT="${UPT/ day?/d}"
|
|
UPT="${UPT/ hour?/h}"
|
|
UPT="${UPT/ minute?/m}"
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,$THUMB
|
|
@rect,,$((jgtools_padding + 140)),$((jgtools_padding + 4)),128,20,2,left,top,#222222 50,#222222 80,
|
|
@text,,$((jgtools_padding + 148)),$((jgtools_padding + 4)),122,20,4,left,top,#EEEEEE,##EEEEEE,"""<span size='9200' font_family='Ubuntu'><i>uptime $UPT</i></span>"""
|
|
@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),262,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
|
|
@icon,,220,100,48,48,4,left,top,,,$HOME/.icons/mabox-logo-square.svg
|
|
|
|
. $HOME/.config/mabox/exit.csv
|
|
$(printf '%s\n' "${SW[@]}")
|
|
^sep()
|
|
$CANCEL <small>esc</small>,exit 1,gtk-close
|
|
$(printf '%s\n' "${SW2[@]}")
|
|
EOF
|
|
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
|
|
}
|
|
|
|
screenshot() {
|
|
CONFIG_FILE=$(mktemp)
|
|
MENU_ITEMS=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
|
|
|
|
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"
|
|
SEC15="Za 15 sekund"
|
|
BACK="wróć"
|
|
OPEN_SCR_DIR="Otwórz katalog ze zrzutami ekranu"
|
|
OPTIMIZE_IMG="Optymalizacja obrazków (online)"
|
|
CANCEL="Anuluj"
|
|
SCRNREC="Nagrywanie pulpitu"
|
|
FULLREC="Pełny ekran"
|
|
AREA="Obszar lub okno"
|
|
SETTINGS="Ustawienia"
|
|
SCROTSETTINGS="Zrzuty ekranu"
|
|
EXTENSION="Typ obrazka (rozszerzenie) dla zrzutu ekranu"
|
|
VIDEOSETTINGS="Ustawienia nagrywania"
|
|
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"
|
|
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"
|
|
SEC15="En 15 segundos"
|
|
BACK="atrás"
|
|
OPEN_SCR_DIR="Abrir carpeta de capturas"
|
|
OPTIMIZE_IMG="Optimize images (online)"
|
|
CANCEL="Cancelar"
|
|
SCRNREC="Grabador Captura Pantalla"
|
|
FULLREC="Pantalla Completa "
|
|
AREA="Área seleccionada o Ventana"
|
|
SETTINGS="Ajustes"
|
|
SCROTSETTINGS="Screenshot settings"
|
|
EXTENSION="File type (extension) for screenshot"
|
|
VIDEOSETTINGS="Ajustes de Grabación"
|
|
AUDIO="Audio"
|
|
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"
|
|
;;
|
|
*)
|
|
SCRNSHOTS="Screenshot"
|
|
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"
|
|
SEC15="In 15 seconds"
|
|
BACK="back"
|
|
OPEN_SCR_DIR="Open screenshot directory"
|
|
OPTIMIZE_IMG="Optimize images (online)"
|
|
CANCEL="Cancel"
|
|
SCRNREC="Screen recording"
|
|
FULLREC="Full screen "
|
|
AREA="Selected Area or Window"
|
|
SETTINGS="Settings"
|
|
SCROTSETTINGS="Screenshot settings"
|
|
EXTENSION="File type (extension) for screenshot"
|
|
VIDEOSETTINGS="Desktop 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"
|
|
EDIT_CONF_FILE="Edit config file"
|
|
;;
|
|
esac
|
|
jgtools_padding=${jgtools_padding:-0}
|
|
POSITION_MODE=${1:-fixed}
|
|
JGWIDTH=$((jgtools_padding + 348 + jgtools_padding))
|
|
MENU_PADDING_TOP=$((jgtools_padding + 221))
|
|
MENU_HALIGN="center"
|
|
MENU_VALIGN="center"
|
|
TABS="280"
|
|
icons=0
|
|
iconmargin=0
|
|
item_height_factor=300
|
|
|
|
#MENU_RADIUS=${RADIUS:-0}
|
|
|
|
[ -d $(xdg-user-dir PICTURES)/screenshots ] || mkdir -p $(xdg-user-dir PICTURES)/screenshots
|
|
|
|
|
|
|
|
# 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=mkv
|
|
# Record Audio? yes or no
|
|
record_audio=no
|
|
#Framerate (frames per second)
|
|
framerate=60
|
|
# Screenshot file type/extension
|
|
image_extension=jpg
|
|
EOF
|
|
fi
|
|
. "$CNF_FILE"
|
|
|
|
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 -M 0 -o $HOME/.config/mabox/jgscrot.png -e 'echo $m')"
|
|
|
|
if [ "$record_audio" == "yes" ];then
|
|
case "$LANG" in
|
|
pl*) AUD="dźwięk";;
|
|
*) AUD="audio";;
|
|
esac
|
|
else
|
|
case "$LANG" in
|
|
pl*) AUD="cisza";;
|
|
*) AUD="noaudio";;
|
|
esac
|
|
fi
|
|
mkconfigfile
|
|
|
|
out+=("^sep($SCRNSHOTS <small>[$EXT]</small>)")
|
|
out+=(" <big></big> $FULLSCR,^root(full)")
|
|
out+=(" <big></big> $ACTIVE_WIN,^root(window)")
|
|
out+=(" <big></big> $ACTIVE_WIN_NO_DECOR,^root(borderless)")
|
|
out+=(" <big></big> $SELECTED,^root(selected)")
|
|
|
|
# Multimonitor, scrot -m $IMG -e $VIEW
|
|
out+=("^sep()")
|
|
out+=(" <big></big> $OPEN_SCR_DIR,xdg-open $(xdg-user-dir PICTURES)/screenshots")
|
|
out+=("^sep()")
|
|
out+=(" <big></big> $OPTIMIZE_IMG <big></big>,xdg-open https://squoosh.app")
|
|
|
|
|
|
out+=("^sep($SCRNREC <small>[$container ${AUD} $framerate fps]</small>)")
|
|
out+=(" <big></big> $FULLREC,mb-screenrec -f")
|
|
out+=(" <big></big> $AREA,mb-screenrec -a")
|
|
out+=("^sep()")
|
|
|
|
out+=(" <big></big> $OPEN_REC_DIR,xdg-open $(xdg-user-dir VIDEOS)/Recordings")
|
|
|
|
out+=("^sep()")
|
|
out+=(" <big></big> $SETTINGS,^root(settings)")
|
|
|
|
#out+=("^sep()")
|
|
#out+=(" $CANCEL <small>esc</small>,exit 1")
|
|
out+=("^tag(full)")
|
|
out+=("^sep($FULLSCR )")
|
|
out+=(" <big></big> $NOW,maim $IMG;viewnior ${IMG}")
|
|
out+=(" <big></big> $SEC5,maim -d 5 $IMG;viewnior ${IMG}")
|
|
out+=(" <big></big> $SEC10,maim -d 10 $IMG;viewnior ${IMG}")
|
|
out+=(" <big></big> $SEC15,maim -d 15 $IMG;viewnior ${IMG}")
|
|
out+=("^sep()")
|
|
out+=(" <big>${arrow_string_left}</big> $BACK,^back()")
|
|
out+=("^tag(window)")
|
|
out+=("^sep($ACTIVE_WIN )")
|
|
out+=(" <big></big> $NOW,scrot -d 1 -u -b $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC5,scrot -d 5 -u -b $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC10,scrot -d 10 -u -b $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC15,scrot -d 15 -u -b $IMG -e $VIEW")
|
|
out+=("^sep()")
|
|
out+=(" <big>${arrow_string_left}</big> $BACK,^back()")
|
|
out+=("^tag(borderless)")
|
|
out+=("^sep($ACTIVE_WIN_NO_DECOR)")
|
|
out+=(" <big></big> $NOW,scrot -d 1 -u $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC5,scrot -d 5 -u $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC10,scrot -d 10 -u $IMG -e $VIEW")
|
|
out+=(" <big></big> $SEC15,scrot -d 15 -u $IMG -e $VIEW")
|
|
out+=("^sep()")
|
|
out+=(" <big>${arrow_string_left}</big> $BACK,^back()")
|
|
out+=("^tag(selected)")
|
|
out+=("^sep($SELECTED)")
|
|
out+=(" <big></big> $NOW,\"\"\"maim -s -l -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}\"\"\"")
|
|
out+=(" <big></big> $SEC5,\"\"\"maim -s -l --delay=5 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}\"\"\"")
|
|
out+=(" <big></big> $SEC10,\"\"\"maim -s -l --delay=10 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}\"\"\"")
|
|
out+=(" <big></big> $SEC15,\"\"\"maim -s -l --delay=15 -b 3 --color=0.3,0.4,0.6,0.4 ${IMG};viewnior ${IMG}\"\"\"")
|
|
out+=("^sep()")
|
|
out+=(" <big>${arrow_string_left}</big> $BACK,^back()")
|
|
|
|
|
|
out+=("^tag(settings)")
|
|
out+=("^sep($EXTENSION)")
|
|
[[ "${EXT}" == "webp" ]] && out+=("<big>${ron}</big> <b>WebP (.webp)</b>,mb-setvar image_extension=webp ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> WebP (.webp),mb-setvar image_extension=webp ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${EXT}" == "png" ]] && out+=("<big>${ron}</big> <b>PNG (.png)</b>,mb-setvar image_extension=png ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> PNG (.png),mb-setvar image_extension=png ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${EXT}" == "jpg" ]] && out+=("<big>${ron}</big> <b>JPG (.jpg)</b>,mb-setvar image_extension=jpg ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> JPG (.jpg),mb-setvar image_extension=jpg ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
out+=("^sep($VIDEOSETTINGS)")
|
|
[[ "${AUD}" == "audio" ]] && out+=("<big>${cbon}</big> $REC_AUDIO,mb-setvar record_audio=no ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${cboff}</big> $REC_AUDIO,mb-setvar record_audio=yes ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
out+=("$FORMAT [ <b>${container}</b> ],^checkout(format)")
|
|
out+=("$FRAMERATE [ <b>${framerate}</b> ],^checkout(framerate)")
|
|
out+=("^sep()")
|
|
out+=(" <big></big> $EDIT_CONF_FILE,xdg-open $CNF_FILE")
|
|
out+=(" <big>${arrow_string_left}</big> $BACK,^back()")
|
|
|
|
out+=("^tag(format)")
|
|
out+=("^sep($FORMAT)")
|
|
[[ "$container" == "webm" ]] && out+=("<big>${ron}</big> <b>WebM</b>,mb-setvar container=webm ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> WebM,mb-setvar container=webm ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "$container" == "mkv" ]] && out+=("<big>${ron}</big> <b>MKV</b>,mb-setvar container=mkv ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> MKV,mb-setvar container=mkv ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "$container" == "mp4" ]] && out+=("<big>${ron}</big> <b>MP4</b>,mb-setvar container=mp4 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> MP4,mb-setvar container=mp4 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
out+=("^tag(framerate)")
|
|
out+=("^sep($FRAMERATE)")
|
|
[[ "${framerate}" == "60" ]] && out+=("<big>${ron}</big> <b>60</b>,mb-setvar framerate=60 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 60,mb-setvar framerate=60 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${framerate}" == "30" ]] && out+=("<big>${ron}</big> <b>30</b>,mb-setvar framerate=30 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 30,mb-setvar framerate=30 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${framerate}" == "25" ]] && out+=("<big>${ron}</big> <b>25</b>,mb-setvar framerate=25 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 25,mb-setvar framerate=25 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${framerate}" == "24" ]] && out+=("<big>${ron}</big> <b>24</b>,mb-setvar framerate=24 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 24,mb-setvar framerate=24 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${framerate}" == "15" ]] && out+=("<big>${ron}</big> <b>15</b>,mb-setvar framerate=15 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 15,mb-setvar framerate=15 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
[[ "${framerate}" == "10" ]] && out+=("<big>${ron}</big> <b>10</b>,mb-setvar framerate=10 ${CNF_FILE};mb-jgtools screenshot ipc") || out+=("<big>${roff}</big> 10,mb-setvar framerate=10 ${CNF_FILE};mb-jgtools screenshot ipc")
|
|
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),340,100,4,left,top,,,$THUMB
|
|
|
|
$(printf '%s\n' "${out[@]}")
|
|
|
|
EOF
|
|
#cat "${MENU_ITEMS}"
|
|
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|
}
|
|
|
|
|
|
settings() {
|
|
#mb-setvar jgtools_last="\"settings ipc\""
|
|
|
|
CONFIG_FILE=$(mktemp)
|
|
MENU_ITEMS=$(mktemp)
|
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
|
|
POSITION_MODE=${1:-pointer}
|
|
HIDE_BACK_ITEMS=1
|
|
MENU_PADDING_TOP=${jgtools_padding:-0}
|
|
|
|
TABS="90"
|
|
[ $jgmenu_use_icons == false ] && icons=0 iconmargin=0 || icons=1 iconmargin=8
|
|
|
|
mkconfigfile
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
. ~/.config/mabox/settings.csv
|
|
. ~/.config/mabox/settings_tags.csv
|
|
|
|
EOF
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|
}
|
|
mstylesel(){
|
|
case $LANG in
|
|
pl*)
|
|
_RANDTHEME="Losowy"
|
|
_JASKIER="Jaskier <i>(domyślny)</i>"
|
|
_ISTREDD="Istredd <i>(stary)</i>"
|
|
_GREYBIRD="GreyBird <i>(prosty)</i>"
|
|
_SCHEME_SEL="Wybierz motyw menu"
|
|
_COLOR_SCHEMES="Wszystkie Motywy"
|
|
;;
|
|
*)
|
|
_RANDTHEME="Random"
|
|
_JASKIER="Jaskier <i>(default)</i>"
|
|
_ISTREDD="Istredd <i>(old)</i>"
|
|
_GREYBIRD="GreyBird <i>(basic)</i>"
|
|
_SCHEME_SEL="Menu theme selector"
|
|
_COLOR_SCHEMES="All color schemes"
|
|
;;
|
|
esac
|
|
last="${1}"
|
|
me="mb-jgtools mstylesel"
|
|
out+=("${arrow_string_left} ${arrow_string_left} ,mb-jgtools places menus")
|
|
out+=("^sep($_SCHEME_SEL)")
|
|
randfile=$(ls /usr/share/mb-jgtools/jgobthemes/*colorrc| shuf -n 1)
|
|
th="${randfile##*/}"
|
|
|
|
out+=(" $_RANDTHEME,jgctl applyoldscheme ${randfile};$me ${th%.*}")
|
|
out+=("^sep()")
|
|
out+=("$_JASKIER,jgctl applyscheme sys 5;$me Jaskier")
|
|
out+=("$_GREYBIRD,jgctl applyscheme sys 7;$me Greybird")
|
|
out+=("$_ISTREDD,jgctl applyscheme sys 2;$me Istredd")
|
|
#out+=("$_RANDTHEME,jgctl randomscheme;$me")
|
|
#out+=("_TWEAKS,^root(tweaks)")
|
|
out+=("^sep($_COLOR_SCHEMES)")
|
|
for item in /usr/share/mb-jgtools/jgobthemes/*colorrc; do
|
|
theme="${item##*/}"
|
|
#notify-send.sh "th" "$item"
|
|
out+=("${theme%.*},jgctl applyoldscheme ${item};$me ${theme%.*}")
|
|
done
|
|
#out+=("^tag(tweaks)")
|
|
#out+=("^sep(Tweaks)")
|
|
#out+=("jgctl color_norm_bg 5,$me $last")
|
|
#out+=("back,^back()")
|
|
|
|
menu_margin_x=${submenu_spacing:-0}
|
|
eval $(xdotool getdisplaygeometry --shell)
|
|
MENU_HEIGHT_MAX="$((HEIGHT - 80))"
|
|
MENU_RADIUS="0"
|
|
menu_margin_x="0"
|
|
MENU_MARGIN_Y=40
|
|
|
|
TABS=200
|
|
JGWIDTH=40
|
|
icons=0
|
|
iconmargin=0
|
|
|
|
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | 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
|
|
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
|
MENU_PADDING_TOP=$((jgtools_padding + 152))
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
|
|
|
@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),160,22,0,left,top,#222222 50,#222222 80,
|
|
@search,,$((jgtools_padding + 8)),$((jgtools_padding + 120)),292,20,4,left,top,#EEEEEE,##EEEEEE,""" $TYPE_TO_SEARCH ${last}"""
|
|
|
|
$(printf '%s\n' "${out[@]}")
|
|
EOF
|
|
mkconfigfile
|
|
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} ${option} 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
|
|
main) main "$2";;
|
|
right) right;;
|
|
mblogout) mblogout "$2";;
|
|
settings) settings "$2";;
|
|
screenshot) screenshot "$2";;
|
|
places) places "$2";;
|
|
mstylesel) mstylesel "$2";;
|
|
*)
|
|
echo -e "
|
|
${GRN}Kolekcja narzędzi dla Mabox-a stworzonych z pomocą Jgmenu
|
|
|
|
Użycie:
|
|
${DEF} $(basename "$0")${YLW} [${RED} OPCJA${YLW} ]
|
|
|
|
${GRN} Opcje:
|
|
|
|
${YLW} >${RED} main ${YLW} -${DEF} main menu - replaces OB menu
|
|
${YLW} >${RED} settings ${YLW} -${DEF} settings menu
|
|
${YLW} >${RED} right ${YLW} -${DEF} right panel
|
|
${YLW} >${RED} places ${YLW} -${DEF} places - left sidepanel
|
|
${YLW} >${RED} mblogout ${YLW} -${DEF} run logout script
|
|
${YLW} >${RED} screenshot ${YLW} -${DEF} run screenshot script
|
|
" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|