95 lines
2.8 KiB
Bash
Executable File
95 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Get colors from config file
|
|
. $HOME/.config/mb-jgmenus/mbjgrc
|
|
|
|
JGWIDTH="280"
|
|
|
|
SCREENHEIGHT=$(xdpyinfo | awk '/^ +dimensions/ {print $2}' | cut -d 'x' -f2)
|
|
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 = $SCREENHEIGHT
|
|
menu_padding_top = 90
|
|
menu_padding_right = 10
|
|
menu_padding_bottom = 10
|
|
menu_padding_left = 10
|
|
menu_radius = 0
|
|
nmenu_halign = left
|
|
menu_valign = top
|
|
|
|
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>
|
|
^sep()
|
|
^sep(Szybka nawigacja)
|
|
^sep()
|
|
Katalog główny,^pipe(jgmenu_run ob --cmd='obbrowser /'
|
|
Katalog domowy,^pipe(jgmenu_run ob --cmd='obbrowser $HOME'
|
|
^sep()
|
|
$(basename $(xdg-user-dir DESKTOP)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir DESKTOP)"
|
|
$(basename $(xdg-user-dir DOWNLOAD)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir DOWNLOAD)"
|
|
$(basename $(xdg-user-dir TEMPLATES)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir TEMPLATES)"
|
|
$(basename $(xdg-user-dir PUBLICSHARE)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir PUBLICSHARE)"
|
|
$(basename $(xdg-user-dir DOCUMENTS)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir DOCUMENTS)"
|
|
$(basename $(xdg-user-dir MUSIC)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir MUSIC)"
|
|
$(basename $(xdg-user-dir PICTURES)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir PICTURES)"
|
|
$(basename $(xdg-user-dir VIDEOS)),^pipe(jgmenu_run ob --cmd="obbrowser $(xdg-user-dir VIDEOS)"
|
|
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
|