master
Daniel Napora 2020-07-22 17:02:26 +02:00
parent e6d50c138a
commit d5fd839327
2 changed files with 162 additions and 61 deletions

View File

@ -35,8 +35,8 @@ esac
done done
printf "%b\n" "^sep(<small><i>${DIRECTORY:-/}</i></small>)" printf "%b\n" "^sep(<small><i>${DIRECTORY:-/}</i></small>)"
printf "%b\n" " $OPENDIR,${JGMENU_RESOURCE_OPENER} \"${DIRECTORY:-/}\"" printf "%b\n" " $OPENDIR,${JGMENU_RESOURCE_OPENER} \"${DIRECTORY:-/}\""
printf "%b\n" " $OPENTERM,terminator --working-directory=\"${DIRECTORY:-/}\"" printf "%b\n" " $OPENTERM,terminator --working-directory=\"${DIRECTORY:-/}\""
if [ ${#dirs[@]} -ne 0 ]; then if [ ${#dirs[@]} -ne 0 ]; then
printf "%b\n" "^sep($DIRECTORIES)" printf "%b\n" "^sep($DIRECTORIES)"
printf '%s\n' "${dirs[@]}" printf '%s\n' "${dirs[@]}"

View File

@ -69,9 +69,9 @@ menu_width = $JGWIDTH
menu_height_min = ${MENU_HEIGHT_MIN:-0} menu_height_min = ${MENU_HEIGHT_MIN:-0}
menu_height_max = ${MENU_HEIGHT_MAX:-0} menu_height_max = ${MENU_HEIGHT_MAX:-0}
menu_padding_top = ${MENU_PADDING_TOP:-70} menu_padding_top = ${MENU_PADDING_TOP:-70}
menu_padding_right = ${MENU_PADDING_RIGHT:-10} menu_padding_right = ${MENU_PADDING_RIGHT:-2}
menu_padding_bottom = ${MENU_PADDING_BOTTOM:-10} menu_padding_bottom = ${MENU_PADDING_BOTTOM:-10}
menu_padding_left = ${MENU_PADDING_LEFT:-10} menu_padding_left = ${MENU_PADDING_LEFT:-2}
menu_radius = ${MENU_RADIUS:-0} menu_radius = ${MENU_RADIUS:-0}
menu_valign = ${MENU_VALIGN:-top} menu_valign = ${MENU_VALIGN:-top}
menu_halign = ${MENU_HALIGN:-left} menu_halign = ${MENU_HALIGN:-left}
@ -113,7 +113,6 @@ unset font
#MENU GŁÓWNE #MENU GŁÓWNE
main() { main() {
echo $1;
CONFIG_FILE=$(mktemp) CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp) MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
@ -248,6 +247,7 @@ cat <<EOF > ${MENU_ITEMS}
@icon,,15,10,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png @icon,,15,10,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/distributor-logo-mabox.png
@text,,70,10,200,20,4,left,top,${color_title_fg% *},#111111,<big>$OSNAME $OSVERSION</big> <sup> $OSCODE</sup> @text,,70,10,200,20,4,left,top,${color_title_fg% *},#111111,<big>$OSNAME $OSVERSION</big> <sup> $OSCODE</sup>
@text,,70,30,200,20,4,left,top,#666666,#444444,<small>$USER@$HOSTNAME</small> @text,,70,30,200,20,4,left,top,#666666,#444444,<small>$USER@$HOSTNAME</small>
@icon,,60,$(expr $MENU_HEIGHT_MIN - 153),143,143,4,left,top,,,$HOME/.config/mabox/right.png
@text,,20,50,200,20,4,left,top,#666666,#444444, @text,,20,50,200,20,4,left,top,#666666,#444444,
#@rect,,40,70,262,20,0,left,top,#666666,#262626, #@rect,,40,70,262,20,0,left,top,#666666,#262626,
@text,,84,50,20,20,0,left,top,auto,#222222,<big></big> @text,,84,50,20,20,0,left,top,auto,#222222,<big></big>
@ -392,17 +392,17 @@ cat <<EOF > ${MENU_ITEMS}
. $HOME/.config/mabox/places-prepend.csv . $HOME/.config/mabox/places-prepend.csv
^sep($QUICK_NAV) ^sep($QUICK_NAV)
$ROOTDIR,^pipe(jgbrowser /) $ROOTDIR,^pipe(jgbrowser /)
$HOME_DIR,^pipe(jgbrowser) $HOME_DIR,^pipe(jgbrowser)
$(basename $(xdg-user-dir DESKTOP)),^pipe(jgbrowser $(xdg-user-dir DESKTOP)) $(basename $(xdg-user-dir DESKTOP)),^pipe(jgbrowser $(xdg-user-dir DESKTOP))
$(basename $(xdg-user-dir DOWNLOAD)),^pipe(jgbrowser $(xdg-user-dir DOWNLOAD)) $(basename $(xdg-user-dir DOWNLOAD)),^pipe(jgbrowser $(xdg-user-dir DOWNLOAD))
#$(basename $(xdg-user-dir TEMPLATES)),^pipe(jgbrowser $(xdg-user-dir TEMPLATES)) #$(basename $(xdg-user-dir TEMPLATES)),^pipe(jgbrowser $(xdg-user-dir TEMPLATES))
#  $(basename $(xdg-user-dir PUBLICSHARE)),^pipe(jgbrowser $(xdg-user-dir PUBLICSHARE)) #(basename $(xdg-user-dir PUBLICSHARE)),^pipe(jgbrowser $(xdg-user-dir PUBLICSHARE))
$(basename $(xdg-user-dir DOCUMENTS)),^pipe(jgbrowser $(xdg-user-dir DOCUMENTS)) $(basename $(xdg-user-dir DOCUMENTS)),^pipe(jgbrowser $(xdg-user-dir DOCUMENTS))
$(basename $(xdg-user-dir MUSIC)),^pipe(jgbrowser $(xdg-user-dir MUSIC)) $(basename $(xdg-user-dir MUSIC)),^pipe(jgbrowser $(xdg-user-dir MUSIC))
$(basename $(xdg-user-dir PICTURES)),^pipe(jgbrowser $(xdg-user-dir PICTURES)) $(basename $(xdg-user-dir PICTURES)),^pipe(jgbrowser $(xdg-user-dir PICTURES))
$(basename $(xdg-user-dir VIDEOS)),^pipe(jgbrowser $(xdg-user-dir VIDEOS)) $(basename $(xdg-user-dir VIDEOS)),^pipe(jgbrowser $(xdg-user-dir VIDEOS))
$(gtkbookmarks) $(gtkbookmarks)
. $HOME/.config/mabox/vboxes.csv . $HOME/.config/mabox/vboxes.csv
@ -413,10 +413,17 @@ jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
} }
mblogout() { mblogout() {
if [[ -n "$1" ]]
then
POSITION_MODE=${1:-pointer}
else
MENU_HALIGN="center"
MENU_VALIGN="center"
continue
fi
CONFIG_FILE=$(mktemp) CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp) MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS};wmctrl -k off" EXIT trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS};#wmctrl -k off" EXIT
case $LANG in case $LANG in
pl*) pl*)
@ -428,8 +435,6 @@ case $LANG in
esac esac
JGWIDTH="348" JGWIDTH="348"
MENU_HALIGN="center"
MENU_VALIGN="center"
MENU_PADDING_TOP=221 MENU_PADDING_TOP=221
TABS="250" TABS="250"
jgmenu_item_height=30 jgmenu_item_height=30
@ -439,7 +444,7 @@ MENU_RADIUS=${RADIUS:-0}
mkconfigfile mkconfigfile
wmctrl -k on #wmctrl -k on
THUMB="$(DISPLAY=:0 scrot -t 340x213 -o $HOME/.config/mabox/mblogout.png -e 'echo $m')" THUMB="$(DISPLAY=:0 scrot -t 340x213 -o $HOME/.config/mabox/mblogout.png -e 'echo $m')"
cat <<EOF > ${MENU_ITEMS} cat <<EOF > ${MENU_ITEMS}
@icon,,4,4,340,100,4,left,top,,,$THUMB @icon,,4,4,340,100,4,left,top,,,$THUMB
@ -510,34 +515,34 @@ mkconfigfile
cat <<EOF > ${MENU_ITEMS} cat <<EOF > ${MENU_ITEMS}
@icon,,4,4,340,100,4,left,top,,,$THUMB @icon,,4,4,340,100,4,left,top,,,$THUMB
^sep($SCRNSHOTS) ^sep($SCRNSHOTS)
$FULLSCR,^root(full) $FULLSCR,^root(full)
$ACTIVE_WIN,^root(window) $ACTIVE_WIN,^root(window)
$ACTIVE_WIN_NO_DECOR,^root(borderless) $ACTIVE_WIN_NO_DECOR,^root(borderless)
 $SELECTED,scrot -s $IMG -e $VIEW  $SELECTED,scrot -fs $IMG -e $VIEW
#  Multimonitor, scrot -m $IMG -e $VIEW #  Multimonitor, scrot -m $IMG -e $VIEW
^sep() ^sep()
$OPEN_SCR_DIR,xdg-open $(xdg-user-dir PICTURES)/screenshots $OPEN_SCR_DIR,xdg-open $(xdg-user-dir PICTURES)/screenshots
^sep() ^sep()
$CANCEL <small>esc</small>,exit 1 $CANCEL <small>esc</small>,exit 1
^tag(full) ^tag(full)
^sep($FULLSCR ) ^sep($FULLSCR )
$NOW,scrot $IMG -e $VIEW $NOW,scrot $IMG -e $VIEW
$SEC5,scrot -d 5 $IMG -e $VIEW $SEC5,scrot -d 5 $IMG -e $VIEW
$SEC10,scrot -d 10 $IMG -e $VIEW $SEC10,scrot -d 10 $IMG -e $VIEW
^sep() ^sep()
 $BACK,^back()  $BACK,^back()
^tag(window) ^tag(window)
^sep($ACTIVE_WIN ) ^sep($ACTIVE_WIN )
$NOW,scrot -d 1 -u -b $IMG -e $VIEW $NOW,scrot -d 1 -u -b $IMG -e $VIEW
$SEC5,scrot -d 5 -u -b $IMG -e $VIEW $SEC5,scrot -d 5 -u -b $IMG -e $VIEW
$SEC10,scrot -d 10 -u -b $IMG -e $VIEW $SEC10,scrot -d 10 -u -b $IMG -e $VIEW
^sep() ^sep()
 $BACK,^back()  $BACK,^back()
^tag(borderless) ^tag(borderless)
^sep($ACTIVE_WIN_NO_DECOR) ^sep($ACTIVE_WIN_NO_DECOR)
$NOW,scrot -d 1 -u $IMG -e $VIEW $NOW,scrot -d 1 -u $IMG -e $VIEW
$SEC5,scrot -d 5 -u $IMG -e $VIEW $SEC5,scrot -d 5 -u $IMG -e $VIEW
$SEC10,scrot -d 10 -u $IMG -e $VIEW $SEC10,scrot -d 10 -u $IMG -e $VIEW
^sep() ^sep()
 $BACK,^back()  $BACK,^back()
EOF EOF
@ -545,35 +550,131 @@ jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
} }
panels() { settings() {
CONFIG_FILE=$(mktemp) CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp) MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
POSITION_MODE=${1:-pointer}
HIDE_BACK_ITEMS=1
MENU_PADDING_TOP=0
MENU_PADDING_RIGHT=0
MENU_PADDING_BOTTOM=0
MENU_PADDING_LEFT=0
jgmenu_icon_size=0
#Lokalne zmienne; case $LANG in
JGWIDTH="300" pl*)
MENU_HALIGN="center" TYPE_TO_SEARCH="pisz, aby wyszukać"
MENU_VALIGN="center" SOFT_MANAGEMENT="Zarządzanie oprogramowaniem"
MENU_HEIGHT_MIN="210" PAMAC_UPDATE="Aktualizacja systemu (Pamac)"
#MENU_HEIGHT_MAX="210" CLI_UPDATE="Aktualizacja systemu (cli)"
TABS="280" PAMAC="Menadżer pakietów - Pamac"
ITEM_HEIGHT="50" RENEW_KEYS="Odnawianie kluczy"
font="Noto Sans Medium 10" MIRROR_RANK="Ranking mirrorów"
COLUMNS="1" SETTINGS="Ustawienia"
MCC="Centrum Sterowania Mabox"
SYS_AND_HARDWARE="System i sprzęt"
LOOK_AND_FEEL="Wygląd i zachowanie"
HELP="Pomoc"
SHORTCUTS="Skróty klawiszowe"
ONLINE_RES="Zasoby online"
OTHER="Inne"
SCREENSHOT="Zrzut ekranu"
BACK="wróć"
FAST="Szybko"
ALL="Wszystkie"
GEOIP="Najbliższe"
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"
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"
SIZE="Rozmiar Menu i SidePaneli"
TINY="malutki"
SMALL="mały"
NORMAL="normalny"
BIG="duży"
HUGE="wielki"
;;
*)
TYPE_TO_SEARCH="type to search"
SOFT_MANAGEMENT="Software management"
PAMAC_UPDATE="System update (Pamac)"
CLI_UPDATE="System update (cli)"
PAMAC="Pamac"
RENEW_KEYS="Renew keys"
MIRROR_RANK="Mirror ranking"
SETTINGS="Settings"
MCC="Mabox Control Center"
SYS_AND_HARDWARE="System and Hardware"
LOOK_AND_FEEL="Look and Feel"
HELP="Help"
SHORTCUTS="Keyboard Shortcuts"
ONLINE_RES="Online Resources"
OTHER="Other"
SCREENSHOT="Screenshot Tool"
BACK="back"
FAST="Fasttrack"
ALL="All"
GEOIP="Geoip"
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"
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"
SIZE="Menu/Sidepanels Size"
TINY="tiny"
SMALL="small"
NORMAL="normal"
BIG="big"
HUGE="huge"
;;
esac
mkconfigfile mkconfigfile
cat <<EOF > ${MENU_ITEMS} cat <<EOF > ${MENU_ITEMS}
@icon,,10,20,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png ^sep( MENU USTAWIEŃ )
@text,,70,10,220,20,4,left,top,#EEEEEE,#111111,$OSNAME $OSVERSION <sup> $OSCODE</sup> $SIZE,^checkout(menusize),applications-development
@text,,70,30,240,20,4,left,top,#666666,#444444,<small>$USER@$HOSTNAME</small> Conky,^pipe(jgmenu_run ob --cmd=mabox-conky-pipemenu),desktop-effects
@text,,70,50,200,20,4,left,top,#666666,#444444,<i>Panele dla Maboxa</i> $TINT2,^pipe(jgmenu_run ob --cmd=mabox-tint2-pipemenu),tint2conf
$COMPOSER,^pipe(jgmenu_run ob --cmd=mabox-compositor),compton
 Szybka nawigacja,mb-jgtools places ^tag(menusize)
 System panel,mb-jgtools right ^sep($SIZE)
 Menu główne,mb-jgtools main <small><small>$TINY</small></small>,cat /usr/share/mb-jgtools/tiny > ~/.config/mabox/jgmenusize.conf && mb-jgtools right
 Zrzuty ekranu,mb-jgtools screenshot <small>$SMALL</small>,cat /usr/share/mb-jgtools/small > ~/.config/mabox/jgmenusize.conf && mb-jgtools right
 Wylogowanie,mb-jgtools mblogout $NORMAL,cat /usr/share/mb-jgtools/normal > ~/.config/mabox/jgmenusize.conf && mb-jgtools right
<big>$BIG</big>,cat /usr/share/mb-jgtools/big > ~/.config/mabox/jgmenusize.conf && mb-jgtools right
<big><big>$HUGE</big></big>,cat /usr/share/mb-jgtools/huge > ~/.config/mabox/jgmenusize.conf && mb-jgtools right
EOF EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
} }
@ -609,10 +710,10 @@ CON='\e[?25h' #Cursor On |
case "$1" in case "$1" in
main) main "$2";; main) main "$2";;
right) right;; right) right;;
mblogout) mblogout;; mblogout) mblogout "$2";;
places) places;; settings) settings "$2";;
screenshot) screenshot;; screenshot) screenshot;;
panels) panels;; places) places;;
*) *)
echo -e " echo -e "
${GRN}Kolekcja narzędzi dla Mabox-a stworzonych z pomocą Jgmenu ${GRN}Kolekcja narzędzi dla Mabox-a stworzonych z pomocą Jgmenu
@ -623,9 +724,9 @@ ${DEF} $(basename "$0")${YLW} [${RED} OPCJA${YLW} ]
${GRN} Opcje: ${GRN} Opcje:
${YLW} >${RED} main ${YLW} -${DEF} main menu - replaces OB menu ${YLW} >${RED} main ${YLW} -${DEF} main menu - replaces OB menu
${YLW} >${RED} panels ${YLW} -${DEF} all panel access ${YLW} >${RED} settings ${YLW} -${DEF} settings menu
${YLW} >${RED} right ${YLW} -${DEF} run right panel ${YLW} >${RED} right ${YLW} -${DEF} right panel
${YLW} >${RED} places ${YLW} -${DEF} places menu ${YLW} >${RED} places ${YLW} -${DEF} places - left sidepanel
${YLW} >${RED} mblogout ${YLW} -${DEF} run logout script ${YLW} >${RED} mblogout ${YLW} -${DEF} run logout script
${YLW} >${RED} screenshot ${YLW} -${DEF} run screenshot script ${YLW} >${RED} screenshot ${YLW} -${DEF} run screenshot script
" >&2 " >&2