This commit is contained in:
Daniel Napora 2021-01-12 15:54:11 +01:00
parent ac43f738b4
commit 306dfe9edd
2 changed files with 29 additions and 36 deletions

View File

@ -1,11 +1,13 @@
#!/bin/bash
# jgtile - jgmenu simple gui for winfuncs tile script
# Copyright (C) 2020 napcok <napcok@gmail.com>
. /usr/bin/pipemenu-standalone.cfg
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
ICONDIR="/usr/share/mb-jgtools/jgtile"
MENU_PADDING_TOP=0
MENU_PADDING_TOP=8
MENU_HALIGN="center"
MENU_VALIGN="center"
#JGWIDTH=175

View File

@ -2,22 +2,8 @@
#
# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox
# Copyright (C) 2019-2021 Daniel Napora <napcok@gmail.com>
mb-setvar jgtools_last="\"$*\""
#mb-setvar jgtools_last="\"$*\""
. $HOME/.config/mabox/mabox.conf
## TEMPORARY SETTINGS MENU FIX
if [ -z "$menu_font_family" ]; then
case $LANG in
pl*) rsync -a /usr/share/mabox/lang/pl/.config/mabox/settings* $HOME/.config/mabox/ ;;
es*) rsync -a /usr/share/mabox/lang/es/.config/mabox/settings* $HOME/.config/mabox/ ;;
*) rsync -a /usr/share/mabox/lang/en/.config/mabox/settings* $HOME/.config/mabox/ ;;
esac
mb-setvar menu_font_family='Noto Sans Medium'
mb-setvar menu_font_size=9
fi
## END TEMPORARY SETTINGS MENU FIX
jgmenu_theme=${jgmenu_theme:-obtheme}
@ -49,7 +35,7 @@ esac
menu_font_size=${menu_font_size:-9}
menu_font_family=${menu_font_family:-Noto Sans Medium}
jgmenu_font="${menu_font_family} ${menu_font_size}"
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
[ -z $jgmenu_use_borders ] && menu_border=0
@ -72,9 +58,6 @@ fi
}
WEBBROWSER="exo-open --launch WebBrowser"
[ $(pidof picom) ] && RADIUS="4"
#SCREENWIDTH=$(xdpyinfo | awk '/^ +dimensions/ {print $2}' | cut -d 'x' -f1)
OSNAME=$(lsb_release -d | awk '{print $2}')
OSVERSION=$(lsb_release -r | awk '{print $2}')
@ -103,9 +86,9 @@ menu_height_min = ${MENU_HEIGHT_MIN:-0}
menu_height_max = ${MENU_HEIGHT_MAX:-0}
menu_padding_top = ${MENU_PADDING_TOP:-70}
menu_padding_right = ${MENU_PADDING_RIGHT:-2}
menu_padding_bottom = ${MENU_PADDING_BOTTOM:-10}
menu_padding_bottom = ${MENU_PADDING_BOTTOM:-2}
menu_padding_left = ${MENU_PADDING_LEFT:-2}
menu_radius = ${MENU_RADIUS:-4}
menu_radius = ${MENU_RADIUS:-0}
menu_valign = ${MENU_VALIGN:-top}
menu_halign = ${MENU_HALIGN:-left}
@ -151,6 +134,7 @@ unset font
#MENU GŁÓWNE
main() {
mb-setvar jgtools_last="\"main ipc\""
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
@ -159,13 +143,11 @@ trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
POSITION_MODE=${1:-pointer}
HIDE_BACK_ITEMS=1
MENU_PADDING_TOP=24
MENU_PADDING_RIGHT=0
MENU_PADDING_BOTTOM=0
MENU_PADDING_LEFT=0
#MENU_PADDING_RIGHT=0
#MENU_PADDING_BOTTOM=0
#MENU_PADDING_LEFT=0
[ $jgmenu_use_icons == false ] && jgmenu_icon_size=0
MENU_RADIUS=${RADIUS:-0}
mkconfigfile
jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
@ -173,6 +155,8 @@ jgmenu --config-file=${CONFIG_FILE} 2>/dev/null
# PANEL PO PRAWEJ AKTUALIZACE-USTAWIENIA-POMOC
right() {
mb-setvar jgtools_last="\"right\""
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
@ -445,6 +429,8 @@ jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
}
places() {
mb-setvar jgtools_last="\"places\""
CONFIG_FILE=$(mktemp)
MENU_ITEMS=$(mktemp)
trap "rm -f ${CONFIG_FILE} ${MENU_ITEMS}" EXIT
@ -484,16 +470,16 @@ esac
#MENU_HEIGHT_MIN=$(xdpyinfo | awk '/^ +dimensions/ {print $2}' | cut -d 'x' -f2)
# eksperyment
SCRHEIGHT=$(xdpyinfo | awk '/^ +dimensions/ {print $2}' | cut -d 'x' -f2)
#SCRHEIGHT=$(xdpyinfo | awk '/^ +dimensions/ {print $2}' | cut -d 'x' -f2)
panels_topmargin=${panels_topmargin:-0}
MENU_HEIGHT_MIN=$(expr $SCRHEIGHT - $panels_topmargin - $panels_topmargin)
eval $(xdotool getdisplaygeometry --shell)
MENU_HEIGHT_MIN=$(expr $HEIGHT - $panels_topmargin - $panels_topmargin)
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
JGWIDTH=40
jgmenu_icon_size=0
MENU_PADDING_TOP=55
MENU_PADDING_TOP=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
[ $places_softwarepipe == true ] && softwarepipe="<big></big> $POPINSTALL,^pipe(jgsoftware-pipe -r)" && pipesep="^sep($PIPEMENUS)"
@ -514,7 +500,7 @@ cat <<EOF > ${MENU_ITEMS}
^sep($QUICK_NAV)
<big>襁</big> $ROOTDIR,^pipe(jgbrowser /),folder
<big></big> $HOME_DIR,^pipe(jgbrowser),folder-home
<big></big> $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
@ -561,7 +547,6 @@ TABS="250"
jgmenu_item_height=30
jgmenu_icon_size=26
#jgmenu_font="Noto Sans Medium 11"
MENU_RADIUS=${RADIUS:-0}
mkconfigfile
@ -634,8 +619,8 @@ MENU_VALIGN="center"
TABS="280"
jgmenu_item_height=28
jgmenu_icon_size=0
#jgmenu_font='Noto Sans Medium 10'
MENU_RADIUS=${RADIUS:-0}
#MENU_RADIUS=${RADIUS:-0}
[ -d $(xdg-user-dir PICTURES)/screenshots ] || mkdir -p $(xdg-user-dir PICTURES)/screenshots
@ -685,6 +670,8 @@ 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
@ -725,6 +712,10 @@ esac
case $1 in
all*)
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/mabox/settings* $HOME/.config/mabox/
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/jgmenu/*.csv $HOME/.config/jgmenu/
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/mabox/places* $HOME/.config/mabox/
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/mabox/right* $HOME/.config/mabox/
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/mabox/exit.csv $HOME/.config/mabox/
;;
main*)
rsync -a /usr/share/mabox/lang/$LNGDIR/.config/jgmenu/*.csv $HOME/.config/jgmenu/