84 lines
1.9 KiB
Plaintext
84 lines
1.9 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# Get colors from config file
|
||
|
. $HOME/.config/mb-jgmenus/mbjgrc
|
||
|
|
||
|
JGWIDTH="300"
|
||
|
|
||
|
OSNAME=$(lsb_release -d | awk '{print $2}')
|
||
|
OSVERSION=$(lsb_release -r | awk '{print $2}')
|
||
|
OSCODE=$(lsb_release -c | awk '{print $2}')
|
||
|
KERNEL=$(uname -r)
|
||
|
|
||
|
mkconfigfile() {
|
||
|
cat <<EOF > ${CONFIG_FILE}
|
||
|
stay_alive = 0
|
||
|
hide_back_items = 0
|
||
|
terminal_exec = terminator
|
||
|
terminal_args = -e
|
||
|
tabs = 200
|
||
|
menu_margin_x = 0
|
||
|
menu_margin_y = 0
|
||
|
menu_width = $JGWIDTH
|
||
|
menu_height_min = 0
|
||
|
menu_padding_top = 90
|
||
|
menu_padding_right = 10
|
||
|
menu_padding_bottom = 10
|
||
|
menu_padding_left = 10
|
||
|
menu_radius = 0
|
||
|
menu_halign = center
|
||
|
menu_valign = center
|
||
|
|
||
|
item_height = 20
|
||
|
item_halign = left
|
||
|
|
||
|
sep_markup = font="Noto Sans Bold 10" foreground="#FFFFFF"
|
||
|
font = Noto Sans Medium 9
|
||
|
icon_size = 0
|
||
|
|
||
|
color_menu_bg = $COLOR_MENU_BG
|
||
|
color_menu_border = $COLOR_MENU_BORDER
|
||
|
color_norm_bg = $COLOR_NORM_BG
|
||
|
color_norm_fg = $COLOR_NORM_FG
|
||
|
color_sel_bg = $COLOR_SEL_BG
|
||
|
color_sel_fg = $COLOR_SEL_FG
|
||
|
color_sel_border = $COLOR_SEL_BORDER
|
||
|
color_sep_fg = $COLOR_SEP_FG
|
||
|
color_sep_bg = $COLOR_SEP_BG
|
||
|
color_scroll_ind = $COLOR_SCROLL_IND
|
||
|
EOF
|
||
|
}
|
||
|
|
||
|
main() {
|
||
|
CONFIG_FILE=$(mktemp)
|
||
|
MENU_ITEMS=$(mktemp)
|
||
|
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
|
||
|
mkconfigfile
|
||
|
|
||
|
cat <<EOF > ${MENU_ITEMS}
|
||
|
@icon,,10,20,48,48,4,left,top,,,/usr/share/icons/hicolor/48x48/apps/mbcc.png
|
||
|
@text,,70,10,200,20,4,left,top,#EEEEEE,#111111,<big>$OSNAME $OSVERSION $OSCODE</big>
|
||
|
@text,,70,30,200,20,4,left,top,#666666,#444444,<small>Jądro:</small> $KERNEL $HOSTTYPE
|
||
|
@text,,70,50,200,20,4,left,top,#666666,#444444,<small>$USER@$HOSTNAME</small>
|
||
|
Wyloguj,openbox --exit
|
||
|
Uśpij,systemctl suspend
|
||
|
Hibernuj,systemctl hibernate
|
||
|
Rebootuj,systemctl reboot
|
||
|
Wyłącz,systemctl poweroff
|
||
|
Zablokuj ekran, betterlockscreen -l
|
||
|
EOF
|
||
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||
|
}
|
||
|
case "$1" in
|
||
|
main) main;;
|
||
|
*)
|
||
|
echo -e "
|
||
|
kuku
|
||
|
|
||
|
" >&2
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
exit 0
|