This commit is contained in:
Daniel Napora 2020-01-28 23:28:23 +01:00
parent a48237e851
commit 54a48b2dd2

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Get colors from config file
. $HOME/.config/mb-jgtools/mb-jgtools.colorrc
#. $HOME/.config/mb-jgtools/mb-jgtools.colorrc
JGWIDTH="322"
@ -16,8 +16,10 @@ KERNEL=$(uname -r)
mkconfigfile() {
cat <<EOF > ${CONFIG_FILE}
position_mode = ${POSITION_MODE:-fixed}
csv_cmd = lx
stay_alive = 0
hide_back_items = 0
hide_back_items = ${HIDE_BACK_ITEMS:-0}
terminal_exec = terminator
terminal_args = -e
tabs = ${TABS:-240}
@ -26,11 +28,11 @@ menu_margin_y = 0
menu_width = $JGWIDTH
menu_height_min = ${MENU_HEIGHT_MIN:-0}
menu_height_max = ${MENU_HEIGHT_MAX:-0}
menu_padding_top = 90
menu_padding_right = 10
menu_padding_bottom = 10
menu_padding_left = 10
menu_radius = 0
menu_padding_top = ${MENU_PADDING_TOP:-90}
menu_padding_right = ${MENU_PADDING_RIGHT:-10}
menu_padding_bottom = ${MENU_PADDING_BOTTOM:-10}
menu_padding_left = ${MENU_PADDING_LEFT:-10}
menu_radius = ${MENU_RADIUS:-0}
menu_valign = ${MENU_VALIGN:-top}
menu_halign = ${MENU_HALIGN:-0}
@ -41,21 +43,46 @@ columns = ${COLUMNS:-1}
sep_markup = font="Noto Sans Bold 10" foreground="#FFFFFF"
font = ${FONT:-Noto Sans Medium 9}
icon_size = 0
icon_size = ${ICON_SIZE:-0}
color_menu_bg = ${COLOR_MENU_BG:-#222222 90}
color_menu_border = ${COLOR_MENU_BORDER:-#2f9b85 100}
color_norm_bg = ${COLOR_NORM_BG:-#262626 100}
color_norm_bg = ${COLOR_NORM_BG:-#000000 0}
color_norm_fg = ${COLOR_NORM_FG:-#CCCCCC 100}
color_sel_bg = ${COLOR_SEL_BG:-#169f6f 80}
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:-#2f9b85 100}
color_sep_fg = ${COLOR_SEP_FG:-#4D4D4D 100}
color_sep_bg = ${COLOR_SEP_BG:-#262626 100}
color_scroll_ind = ${COLOR_SCROLL_IND:-#504e65 100}
EOF
}
#MENU GŁÓWNE
main() {
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
POSITION_MODE=pointer
HIDE_BACK_ITEMS=1
MENU_PADDING_TOP=30
MENU_PADDING_RIGHT=0
MENU_PADDING_BOTTOM=0
MENU_PADDING_LEFT=0
JGWIDTH=0
ITEM_HEIGHT=20
ICON_SIZE=16
MENU_RADIUS=10
mkconfigfile
#jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
}
# PANEL PO PRAWEJ AKTUALIZACE-USTAWIENIA-POMOC
right() {
CONFIG_FILE=$(mktemp)
@ -91,8 +118,10 @@ cat <<EOF > ${MENU_ITEMS}
^sep(Pomoc)
Skróty klawiszowe,^root(shortcuts)
Skróty klawiszowe,^root(shortcuts)
^sep(Inne)
 Zrzut ekranu,mb-jgtools screenshot
^sep(Wyjście)
@ -194,7 +223,7 @@ MENU_VALIGN="center"
TABS="280"
ITEM_HEIGHT="40"
FONT="Noto Sans Medium 12"
MENU_RADIUS=20
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
@ -208,11 +237,63 @@ cat <<EOF > ${MENU_ITEMS}
 Uruchom ponownie,systemctl reboot
 Wyłącz,systemctl poweroff
 Zablokuj ekran, betterlockscreen -l
 Anuluj <span fgcolor="#222222" bgcolor="#BBBBBB" size="x-small"> <sup>esc</sup> </span>,exit 1
 Anuluj <small>esc</small>,exit 1
EOF
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
#Lokalne zmienne;
JGWIDTH="340"
MENU_PADDING_TOP=10
MENU_HALIGN="center"
MENU_VALIGN="center"
TABS="280"
ITEM_HEIGHT="25"
FONT="Noto Sans Medium 10"
MENU_RADIUS=10
IMG="$(xdg-user-dir PICTURES)/Mabox_%Y-%m-%d-%H:%M:%s.png"
VIEW="'viewnior $IMG'"
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
^sep(Zrzut ekranu)
 Pełny ekran,^root(full)
 Aktywne okno,^root(window)
 Aktywne okno (bez dekoracji),^root(borderless)
 Zaznaczony obszar lub okno,scrot -s $IMG -e $VIEW
 Multimonitor, scrot -m $IMG -e $VIEW
^sep()
 Anuluj <small>esc</small>,exit 1
^tag(full)
^sep(Pełny ekran )
 Teraz,scrot $IMG -e $VIEW
 Za 5 sekund,scrot -d 5 $IMG -e $VIEW
 Za 10 sekund,scrot -d 10 $IMG -e $VIEW
 wróć,^back()
^tag(window)
^sep(Aktywne Okno )
 Teraz,scrot -d 1 -u -b $IMG -e $VIEW
 Za 5 sekund,scrot -d 5 -u -b $IMG -e $VIEW
 Za 10 sekund,scrot -d 10 -u -b $IMG -e $VIEW
 wróć,^back()
^tag(borderless)
^sep(Aktywne Okno - bez dekoracji)
 Teraz,scrot -d 1 -u $IMG -e $VIEW
 Za 5 sekund,scrot -d 5 -u $IMG -e $VIEW
 Za 10 sekund,scrot -d 10 -u $IMG -e $VIEW
 wróć,^back()
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
panels() {
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
@ -241,6 +322,7 @@ cat <<EOF > ${MENU_ITEMS}
 coś tu będzie,
 System panel,mb-jgtools right
 Wylogowanie,mb-jgtools mblogout
Zrzuty ekranu,mb-jgtools screenshot
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
@ -275,23 +357,27 @@ CON='\e[?25h' #Cursor On |
#--------------------------------------------------------------------+
case "$1" in
main) main;;
right) right;;
mblogout) mblogout;;
places) places;;
screenshot) screenshot;;
panels) panels;;
*)
echo -e "
${GRN}Kolekcja narzędzi dla Mabox-a stworzonych na bazie Jgmenu
${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} panels ${YLW} -${DEF} all panel access
${YLW} >${RED} right ${YLW} -${DEF} run right panel
${YLW} >${RED} places ${YLW} -${DEF} places menu
${YLW} >${RED} mblogout ${YLW} -${DEF} run logout script
${YLW} >${RED} screenshot ${YLW} -${DEF} run screenshot script
" >&2
exit 1
;;