2021-05-21 23:15:53 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# jgdeskgrid - configure DeskGrid from menu
|
|
|
|
#
|
2021-05-22 02:00:30 +02:00
|
|
|
case $LANG in
|
|
|
|
pl*)
|
|
|
|
REMOVE="Usuń to menu z panelu"
|
|
|
|
;;
|
|
|
|
es*)
|
|
|
|
REMOVE="Eliminar este menú del panel"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
REMOVE="Remove this menu from panel"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2021-05-21 23:15:53 +02:00
|
|
|
. ~/.config/mabox/mabox.conf
|
|
|
|
|
|
|
|
CONFIG_DIR="$HOME/.config/deskgrid"
|
|
|
|
CONFIG_FILE="$CONFIG_DIR/deskgrid.conf"
|
|
|
|
mkdir -p $CONFIG_DIR
|
|
|
|
if [ ! -f $CONFIG_FILE ]; then
|
|
|
|
cat <<EOF > ${CONFIG_FILE}
|
|
|
|
# Gap between windows in pixels (reasonable values: 0 8 16 24)
|
|
|
|
gap=16
|
|
|
|
# Grid columns (12 16 24)
|
|
|
|
grid_x=16
|
|
|
|
# Grid rows (6 12 16)
|
|
|
|
grid_y=12
|
|
|
|
#
|
|
|
|
titlebar_height=18
|
|
|
|
#Notifications true or false
|
|
|
|
notifications=true
|
|
|
|
# Outer gap (disable if you use WM margins)
|
|
|
|
show_outer_gap=true
|
|
|
|
# Only for clicksnap action
|
|
|
|
activate_window=false
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
source <(grep = $CONFIG_FILE)
|
|
|
|
|
|
|
|
GAP=${gap:-16}
|
|
|
|
GRID_X=${grid_x:-16}
|
|
|
|
GRID_Y=${grid_y:-12}
|
|
|
|
TITLEBAR_HEIGHT=${titlebar_height:-18}
|
|
|
|
|
|
|
|
me="mb-jgtools $jgtools_last"
|
|
|
|
|
|
|
|
out+=("^sep(DeskGrid)")
|
|
|
|
out+=("Show image helper,drawgrid")
|
|
|
|
#out+=("About,")
|
|
|
|
out+=("^sep(Configuration)")
|
|
|
|
out+=("Columns [ <b>$GRID_X</b> ],^checkout(columns)")
|
|
|
|
out+=("Rows [ <b>$GRID_Y</b> ],^checkout(rows)")
|
|
|
|
out+=("Gap between windows [ <b>$GAP</b> ],^checkout(gap)")
|
|
|
|
out+=("Show outer gap [ <b>$show_outer_gap</b> ],^checkout(outer)")
|
|
|
|
out+=("Notifications [ <b>$notifications</b> ],^checkout(notify)")
|
|
|
|
out+=("^sep()")
|
|
|
|
out+=("Edit config file ,geany $CONFIG_FILE")
|
|
|
|
|
2021-05-22 02:00:30 +02:00
|
|
|
out2+=("^tag(columns)")
|
|
|
|
for i in 8 12 16 24 32; do out2+=("$(printf "<tt>%3s</tt>,%s" "$i" "mb-setvar grid_x=${i} $CONFIG_FILE;$me")");done
|
|
|
|
out2+=("^tag(rows)")
|
|
|
|
for i in 6 8 12 16 24; do out2+=("$(printf "<tt>%3s</tt>,%s" "$i" "mb-setvar grid_y=${i} $CONFIG_FILE;$me")");done
|
|
|
|
out2+=("^tag(gap)")
|
|
|
|
for i in 0 2 4 8 12 16 24 32 40; do out2+=("$(printf "<tt>%3s</tt>,%s" "$i" "mb-setvar gap=${i} $CONFIG_FILE;$me")");done
|
|
|
|
out2+=("^tag(outer)")
|
|
|
|
out2+=("$(printf "<tt>%3s</tt>,%s" "true" "mb-setvar show_outer_gap=true $CONFIG_FILE;$me")")
|
|
|
|
out2+=("$(printf "<tt>%3s</tt>,%s" "false" "mb-setvar show_outer_gap=false $CONFIG_FILE;$me")")
|
|
|
|
out2+=("^tag(notify)")
|
|
|
|
out2+=("$(printf "<tt>%3s</tt>,%s" "true" "mb-setvar notifications=true $CONFIG_FILE;$me")")
|
|
|
|
out2+=("$(printf "<tt>%3s</tt>,%s" "false" "mb-setvar notifications=false $CONFIG_FILE;$me")")
|
2021-05-21 23:15:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### RUN
|
|
|
|
if [[ "$1" == "-s" ]]; then
|
|
|
|
. /usr/bin/pipemenu-standalone.cfg
|
|
|
|
. $HOME/.config/mabox/mabox.conf
|
|
|
|
|
|
|
|
MENU_PADDING_TOP=0
|
|
|
|
MENU_HALIGN="center"
|
|
|
|
MENU_VALIGN="center"
|
|
|
|
jgmenu_icon_size=0
|
|
|
|
|
|
|
|
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
|
|
|
[ -z $jgmenu_use_borders ] && menu_border=0
|
|
|
|
|
|
|
|
mkconfigfile
|
|
|
|
|
|
|
|
cat <<EOF > ${MENU_ITEMS}
|
|
|
|
$(printf '%s\n' "${out[@]}")
|
|
|
|
$(printf '%s\n' "${out2[@]}")
|
|
|
|
EOF
|
|
|
|
|
|
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
fi
|
|
|
|
printf '%s\n' "${out[@]}"
|
|
|
|
|
|
|
|
if [[ $1 == "-r" ]]; then
|
|
|
|
printf '%s\n' "^sep()"
|
2021-05-23 10:20:13 +02:00
|
|
|
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdeskgrid=false;mb-jgtools places"
|
2021-05-21 23:15:53 +02:00
|
|
|
fi
|
|
|
|
printf '%s\n' "${out2[@]}"
|