upload
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
# mabox-pipemenus
|
||||
An Openbox pipemenus for use with Manjaro Linux (port of CrunchBang pipemenus)
|
||||
|
||||
Also some jgmenu native pipemenus
|
||||
|
||||
Work in progress
|
||||
|
||||
|
||||
156
usr/bin/jgclock
Executable file
156
usr/bin/jgclock
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/bin/bash
|
||||
TINT=$(pgrep -a tint2 |cut -d' ' -f4)
|
||||
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
CLOCK="Zegar"
|
||||
FONT_COLOR="Kolor"
|
||||
SET_COLOR="Ustaw kolor"
|
||||
LINE1="Linia 1"
|
||||
LINE2="Linia 2"
|
||||
FORMAT="Format"
|
||||
FONT="Czcionka"
|
||||
INCREASE="Powiększ"
|
||||
DECREASE="Pomniejsz"
|
||||
SETFONT="Ustaw wybraną czcionkę..."
|
||||
NONE="brak"
|
||||
MSM_TIME_DATE="Ustawienia daty i czasu"
|
||||
;;
|
||||
es*)
|
||||
CLOCK="Clock"
|
||||
FONT_COLOR="Color"
|
||||
SET_COLOR="Set color"
|
||||
LINE1="Line 1"
|
||||
LINE2="Line 2"
|
||||
FORMAT="Format"
|
||||
FONT="Font"
|
||||
INCREASE="Increase"
|
||||
DECREASE="Decrease"
|
||||
SETFONT="Set custom font..."
|
||||
NONE="none"
|
||||
MSM_TIME_DATE="Time and Date settings"
|
||||
;;
|
||||
*)
|
||||
CLOCK="Clock"
|
||||
FONT_COLOR="Color"
|
||||
SET_COLOR="Set color"
|
||||
LINE1="Line 1"
|
||||
LINE2="Line 2"
|
||||
FORMAT="Format"
|
||||
FONT="Font"
|
||||
INCREASE="Increase"
|
||||
DECREASE="Decrease"
|
||||
SETFONT="Set custom font..."
|
||||
NONE="none"
|
||||
MSM_TIME_DATE="Time and Date settings"
|
||||
;;
|
||||
esac
|
||||
|
||||
read PANELITEMS <<< "$(grep "panel_items" ${TINT} | cut -d'=' -f2)"
|
||||
# Clock
|
||||
if [[ "$PANELITEMS" == *C* ]]; then
|
||||
read TF1 <<< "$(grep "time1_format" ${TINT} | cut -d'=' -f2)"
|
||||
read TF2 <<< "$(grep "time2_format" ${TINT} | cut -d'=' -f2)"
|
||||
read -a FL1 <<< "$(grep "time1_font" ${TINT} | cut -d'=' -f2)"
|
||||
L1_FONT="${FL1[@]::${#FL1[@]}-1}" # this is crazy... all array elements but last
|
||||
L1_SIZE="${FL1[-1]}"
|
||||
read -a FL2 <<< "$(grep "time2_font" ${TINT} | cut -d'=' -f2)"
|
||||
L2_FONT="${FL2[@]::${#FL2[@]}-1}" # this is crazy... all array elements but last
|
||||
L2_SIZE="${FL2[-1]}"
|
||||
read CLR OPA <<< "$(grep "clock_font_color" ${TINT} | cut -d'=' -f2)"
|
||||
|
||||
out+=("^sep($CLOCK)")
|
||||
out+=("[ <b> $(date "+${TF1}") </b> ] $FORMAT $LINE1,^checkout(cl1)")
|
||||
[[ "$TF2" == "" ]] && out+=("[ <i>$NONE</i> ] $FORMAT $LINE2,^checkout(cl2)")|| out+=("[ <b> $(date "+${TF2}") </b> ] $FORMAT $LINE2,^checkout(cl2)")
|
||||
out+=("^sep()")
|
||||
out+=("$FONT $LINE1: [ <b>$L1_FONT $L1_SIZE</b> ],^checkout(fl1)")
|
||||
[[ "$TF2" != "" ]] && out+=("$FONT $LINE2: [ <b>$L2_FONT $L2_SIZE</b> ],^checkout(fl2)")
|
||||
out+=("^sep()")
|
||||
out+=("<tt><span bgcolor='${CLR}'> </span></tt> $FONT_COLOR,^checkout(ccolor)")
|
||||
out2+=("^tag(ccolor)")
|
||||
out2+=("^sep($SET_COLOR)")
|
||||
colors=("#ffffff" "#CCCCCC" "#E95420" "#18b0b0" "#3584e4" "#0e8420" "#3dd425" "#c748ba" "#c7162b" "#f4a100" "#333333" "#000000")
|
||||
for i in "${colors[@]}"
|
||||
do
|
||||
out2+=("<tt><small>$i</small> <span bgcolor='$i'> </span></tt>,t2ctl clockcolor '${i}' ${TINT};me")
|
||||
done
|
||||
out2+=("^tag(cl1)")
|
||||
out2+=("^sep($LINE1)")
|
||||
out2+=("<b>$(date +"%H:%M")</b> <small>(%H:%M)</small>,t2ctl clockline1 '%H:%M' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%H:%M:%S")</b> <small>(%H:%M:%S)</small>,t2ctl clockline1 '%H:%M:%S' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%I:%M %p")</b> <small>(%I:%M %p)</small>,t2ctl clockline1 '%I:%M %p' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%-I:%M %p")</b> <small>(%I-:%M %p)</small>,t2ctl clockline1 '%-I:%M %p' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%H:%M (%a)")</b> <small>(%H:%M (%a))</small>,t2ctl clockline1 '%H:%M (%a)' ${TINT};$me")
|
||||
|
||||
out2+=("^tag(cl2)")
|
||||
out2+=("^sep($LINE2)")
|
||||
out2+=("$NONE,t2ctl clockline2 none ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("<b>$(date +"%A %d %B")</b> <small>(%A %d %B)</small>,t2ctl clockline2 '%A %d %B' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%a %d %b")</b> <small>(%a %d %b)</small>,t2ctl clockline2 '%a %d %b' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%x")</b> <small>(%x)</small>,t2ctl clockline2 '%x' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%m-%d-%Y")</b> <small>(%m-%d-%Y)</small>,t2ctl clockline2 '%m-%d-%Y' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%F")</b> <small>(%F)</small>,t2ctl clockline2 '%F' ${TINT};$me")
|
||||
out2+=("<b>$(date +"%e.%m.%y")</b> <small>(%e.%m.%y)</small>,t2ctl clockline2 '%e.%m.%y' ${TINT};$me")
|
||||
out2+=("^tag(fl1)")
|
||||
out2+=("^sep($L1_FONT $L1_SIZE)")
|
||||
out2+=("<big></big> $INCREASE ( $((L1_SIZE+1)) ),t2ctl clock1_fontsize $((L1_SIZE+1)) ${TINT};$me")
|
||||
out2+=("<big></big> $DECREASE ( $((L1_SIZE-1)) ),t2ctl clock1_fontsize $((L1_SIZE-1)) ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
sizes=(20 19 18 17 16 15 14 13 12 11 10 9 8 7 6)
|
||||
for i in "${sizes[@]}"
|
||||
do
|
||||
[[ "$L1_SIZE" == "$i" ]] && out2+=("<b>$i px</b>,t2ctl clock1_fontsize $i ${TINT};$me") || out2+=("$i px,t2ctl clock1_fontsize $i ${TINT};$me")
|
||||
done
|
||||
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> $SETFONT,mb-setfont t2_time1_font ${TINT}")
|
||||
out2+=("^tag(fl2)")
|
||||
out2+=("^sep($L2_FONT $L2_SIZE)")
|
||||
out2+=("<big></big> $INCREASE ( $((L2_SIZE+1)) ),t2ctl clock2_fontsize $((L2_SIZE+1)) ${TINT};$me")
|
||||
out2+=("<big></big> $DECREASE ( $((L2_SIZE-1)) ),t2ctl clock2_fontsize $((L2_SIZE-1)) ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
sizes=(20 19 18 17 16 15 14 13 12 11 10 9 8 7 6)
|
||||
for i in "${sizes[@]}"
|
||||
do
|
||||
[[ "$L2_SIZE" == "$i" ]] && out2+=("<b>$i px</b>,t2ctl clock2_fontsize $i ${TINT};$me") || out2+=("$i px,t2ctl clock2_fontsize $i ${TINT};$me")
|
||||
done
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> $SETFONT,mb-setfont t2_time2_font ${TINT}")
|
||||
fi
|
||||
out+=("^sep()")
|
||||
out+=("<big></big> $MSM_TIME_DATE,manjaro-settings-manager -m msm_timedate")
|
||||
|
||||
|
||||
if [ $1 == "ipc" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
POSITION_MODE=${1:-fixed}
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
181
usr/bin/jgconky-pipe
Executable file
181
usr/bin/jgconky-pipe
Executable file
@@ -0,0 +1,181 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONKYDEFAULT="$HOME/.conkyrc"
|
||||
CONKYPATH="$HOME/.config/conky"
|
||||
CSESSIONFILE="$CONKYPATH/conky-sessionfile"
|
||||
SESSIONS="$CONKYPATH/saved-sessions"
|
||||
CZEN="mb-conky-manager"
|
||||
CSESSION="mb-conky-session"
|
||||
|
||||
if [ ! -e "$CSESSIONFILE" ] 2> /dev/null ; then
|
||||
echo "Error: Failed to locate conky-sessionfile in $CONKYPATH" >&2
|
||||
echo "conky -c $HOME/.conkyrc & sleep 1" > "$CSESSIONFILE"
|
||||
fi
|
||||
if [ ! -e "$SESSIONS" ] 2> /dev/null ; then
|
||||
echo "$0: Failed to locate saved-sessions in $CONKYPATH" >&2
|
||||
fi
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
ENABLE="Uruchom sesję Conky"
|
||||
DISABLE="Zatrzymaj sesję Conky"
|
||||
CHOOSE_CONKY="Wybierz Conky..."
|
||||
SESSIONS_LBL="Sesje Conky"
|
||||
NEW_SESSION="Nowa sesja Conky"
|
||||
RELOAD="Przeładuj Conky"
|
||||
SAVED_SESSIONS="Zachowane sesje"
|
||||
DEFAULT_CONKYRC="Domyślne conkyrc"
|
||||
RUNNING_CONKY="Działające Conky"
|
||||
EDIT_CONKY="Edytuj Conky"
|
||||
CONKY_EDITOR="Wybierz plik Conky do edycji..."
|
||||
NONE="Brak"
|
||||
DEFAULT="Domyślna"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
;;
|
||||
es*)
|
||||
ENABLE="Start Conky session"
|
||||
DISABLE="Stop Conky session"
|
||||
CHOOSE_CONKY="Elegir recuadro Conky..."
|
||||
SESSIONS_LBL="Conky Sesiones"
|
||||
NEW_SESSION="Guardar sesión actual Conky"
|
||||
RELOAD="Recargar recuadros Conky"
|
||||
SAVED_SESSIONS="Sesiones Conky guardadas"
|
||||
DEFAULT_CONKYRC="Archivo conkyrc x defecto"
|
||||
RUNNING_CONKY="Recuadros en ejecución"
|
||||
EDIT_CONKY="Edición manual recuadro"
|
||||
CONKY_EDITOR="Editor de recuadro"
|
||||
NONE="Ninguno"
|
||||
DEFAULT="Default"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
;;
|
||||
*)
|
||||
ENABLE="Start Conky session"
|
||||
DISABLE="Stop Conky session"
|
||||
CHOOSE_CONKY="Choose Conky..."
|
||||
SESSIONS_LBL="Conky Sessions"
|
||||
NEW_SESSION="New Conky session"
|
||||
RELOAD="Reload Conky"
|
||||
SAVED_SESSIONS="Saved sessions"
|
||||
DEFAULT_CONKYRC="Default conkyrc"
|
||||
RUNNING_CONKY="Running Conky"
|
||||
EDIT_CONKY="Edit Conky"
|
||||
CONKY_EDITOR="Conky Editor"
|
||||
NONE="None"
|
||||
DEFAULT="Default"
|
||||
REMOVE="Remove this menu from panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
me="jgconky-pipe -s"
|
||||
|
||||
EditMenu(){
|
||||
if [[ $(pidof conky) ]];then
|
||||
out+=("$RUNNING_CONKY,^checkout(RUNNING)")
|
||||
out2+=("^tag(RUNNING)")
|
||||
out2+=("^sep($RUNNING_CONKY)")
|
||||
while read -r session ;do # get running conkys from sessionfile
|
||||
[[ -z $session ]] && continue
|
||||
CPATH=$(echo "$session" | awk '{print $3}')
|
||||
#CONKY=$(echo "$CPATH" | awk -F"/" '{print $(NF-1)"/"$NF }')
|
||||
CONKY=${CPATH##*/}
|
||||
out2+=("$CONKY,xdg-open $CPATH")
|
||||
done < "$CSESSIONFILE"
|
||||
|
||||
else
|
||||
out2+=("^tag(RUNNING)")
|
||||
out2+=("$NONE")
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
out+=("^sep(Conky)")
|
||||
if [[ $(pidof conky) ]];then
|
||||
out+=("$DISABLE,conky_toggle")
|
||||
else
|
||||
out+=("$ENABLE,conky_toggle;$me")
|
||||
fi
|
||||
|
||||
if type "$CZEN" &>/dev/null;then # mb-conky-manager script found
|
||||
out+=("$CHOOSE_CONKY,$CZEN")
|
||||
fi
|
||||
|
||||
if type "$CSESSION" &>/dev/null;then # mb-conky-session script found
|
||||
out+=("$RELOAD,$CSESSION")
|
||||
fi
|
||||
|
||||
out+=("^sep($EDIT_CONKY)")
|
||||
if type mb-conkyedit &>/dev/null;then # mb-conkyedit script found
|
||||
out+=("$CONKY_EDITOR,mb-conkyedit")
|
||||
EditMenu
|
||||
else
|
||||
EditMenu
|
||||
fi
|
||||
|
||||
out+=("^sep($SESSIONS_LBL)")
|
||||
if type "$CZEN" &>/dev/null;then # mb-conkyzen script found
|
||||
out+=("$NEW_SESSION,$CZEN -z")
|
||||
fi
|
||||
|
||||
if type "$CSESSION" &>/dev/null;then # mb-conky-session script found
|
||||
out+=("^sep($SAVED_SESSIONS)")
|
||||
if [[ -e "$SESSIONS" ]]
|
||||
then
|
||||
while read -r session ;do
|
||||
[[ -z $session ]] && continue # skip if line is blank
|
||||
out+=("${session##*/},$CSESSION $session")
|
||||
done < "$SESSIONS"
|
||||
else
|
||||
echo "$0: Failed to locate saved-sessions in $CONKYPATH" >&2
|
||||
fi
|
||||
fi
|
||||
out+=("^sep(Colorizer)")
|
||||
out+=("Colorizer - Conky,colorizer-conky -s")
|
||||
|
||||
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
|
||||
[ $(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()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_conkypipe=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
166
usr/bin/jgdeskgrid
Executable file
166
usr/bin/jgdeskgrid
Executable file
@@ -0,0 +1,166 @@
|
||||
#!/bin/bash
|
||||
# jgdeskgrid - configure SuperClick / DeskGrid from menu
|
||||
#
|
||||
case $LANG in
|
||||
pl*)
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
title="SuperClick - ustaw swoje okna na siatce"
|
||||
help='\n<b>Super + LewyKlikMyszy</b> w odpowiednim miejscu okna - aby przemieścić je w wybranym kierunku.\n\n<i>Działa też z klawiatury...</i>\nUżyj <b>Super + Keypad_Keys</b> aby umieszczać okna na siatce\n\n\nnKonfigurowalne usatwienia:\n- odstęp\n- odstęp zewnętrzny'
|
||||
ABOUT="O SuperClick"
|
||||
TRAINER="Ćwicz z trenerem"
|
||||
QUICK_TILE="Trener SuperClick"
|
||||
KEYBOARD_DEMO="Demo użycia z klawiatury"
|
||||
CONFIGURATION="Konfiguracja"
|
||||
LGAP="Odstęp"
|
||||
OUTER_GAP="Zewnętrzny odstęp"
|
||||
NOTIFY="Powiadomienia"
|
||||
CFG_MENU="Menu konfiguracji"
|
||||
EDITCONF="Edytuj plik konfiguracyjny"
|
||||
LEFTPANEL="Lewy panel"
|
||||
;;
|
||||
es*)
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
title="SuperClick - arrange your windows quickly"
|
||||
help='\n\n<b>Super + LeftMouseClick</b> on appropriate area of the window to snap it in a given direction.\n\n<i>Works also with keyboard...</i>\nUse <b>Super + Keypad_Keys</b> to move windows on the grid\n\nConfigurable settings:\n- gap\n- show_outer_gap'
|
||||
ABOUT="About SuperClick"
|
||||
TRAINER="Practice with trainer"
|
||||
KEYBOARD_DEMO="Keyboard usage demo"
|
||||
QUICK_TILE="SuperClick trainer"
|
||||
CONFIGURATION="Configuration"
|
||||
LGAP="Gap between windows"
|
||||
OUTER_GAP="Show outer gap"
|
||||
NOTIFY="Notifications"
|
||||
CFG_MENU="Config Menu"
|
||||
EDITCONF="Edit config file"
|
||||
LEFTPANEL="Left panel"
|
||||
;;
|
||||
*)
|
||||
REMOVE="Remove this menu from panel"
|
||||
title="SuperClick - arrange your windows quickly"
|
||||
help='\n\n<b>Super + LeftMouseClick</b> on appropriate area of the window to snap it in a given direction.\n\n<i>Works also with keyboard...</i>\nUse <b>Super + Keypad_Keys</b> to move windows on the grid\n\nConfigurable settings:\n- gap\n- show_outer_gap'
|
||||
ABOUT="About SuperClick"
|
||||
TRAINER="Practice with trainer"
|
||||
QUICK_TILE="SuperClick trainer"
|
||||
KEYBOARD_DEMO="Keyboard usage demo"
|
||||
CONFIGURATION="Configuration"
|
||||
LGAP="Gap between windows"
|
||||
OUTER_GAP="Show outer gap"
|
||||
NOTIFY="Notifications"
|
||||
CFG_MENU="Config Menu"
|
||||
EDITCONF="Edit config file"
|
||||
LEFTPANEL="Left panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
CONFIG_FILE="$HOME/.config/superclick.cfg"
|
||||
if [ ! -f $CONFIG_FILE ]; then
|
||||
cat <<EOF > ${CONFIG_FILE}
|
||||
# Gap between windows in pixels (reasonable values: 0 8 16 24)
|
||||
gap=16
|
||||
# Outer gap (disable if you use WM margins)
|
||||
show_outer_gap=true
|
||||
# Only for mouse action
|
||||
activate_window=false
|
||||
EOF
|
||||
fi
|
||||
source <(grep = $CONFIG_FILE)
|
||||
GAP=${gap:-16}
|
||||
|
||||
me="jgdeskgrid -s"
|
||||
|
||||
#out+=("^sep(SuperClick)")
|
||||
out+=("<big></big> $QUICK_TILE,superclick trainer")
|
||||
out+=("<big> + </big> $KEYBOARD_DEMO,viewnior /usr/share/mabox/img/superclick-keyboard.gif")
|
||||
out+=("<big></big> $ABOUT,notify-send.sh -u critical -i mbcc '$title' '$help' -o '$TRAINER:superclick trainer' -o '$CFG_MENU:jgdeskgrid -s' -o '$EDITCONF:xdg-open $CONFIG_FILE'")
|
||||
#out+=("<big></big> $SHOW_IMGHELPER,drawgrid")
|
||||
out+=("^sep($CONFIGURATION)")
|
||||
|
||||
out+=("$LGAP [ <b>$GAP</b> ],^checkout(gap)")
|
||||
[[ "$show_outer_gap" == "true" ]] && out+=("<big></big> $OUTER_GAP,mb-setvar show_outer_gap=false $CONFIG_FILE;$me") || out+=("<big></big> $OUTER_GAP,mb-setvar show_outer_gap=true $CONFIG_FILE;$me")
|
||||
#[[ "$notifications" == "true" ]] && out+=("<big></big> $NOTIFY,mb-setvar notifications=false $CONFIG_FILE;$me") || out+=("<big></big> $NOTIFY,mb-setvar notifications=true $CONFIG_FILE;$me")
|
||||
|
||||
out+=("^sep()")
|
||||
out+=("<big></big> $EDITCONF,xdg-open $CONFIG_FILE")
|
||||
|
||||
out2+=("^tag(gap)")
|
||||
for i in 0 4 8 10 16 20 24 32 40; do out2+=("$(printf "<tt>%3s</tt>,%s" "$i" "mb-setvar gap=${i} $CONFIG_FILE;$me")");done
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" $LEFTPANEL,mb-jgtools places")
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=40
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
||||
MENU_PADDING_TOP=$((jgtools_padding + 152))
|
||||
|
||||
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2)
|
||||
THUMBDIR="$HOME/.cache/colorizer/thumbs"
|
||||
mkdir -p ${THUMBDIR}
|
||||
NAME=${WALLPATH////_}
|
||||
if [[ "${NAME}" =~ ^_home_.* ]]; then
|
||||
n=${#HOME}
|
||||
((n++))
|
||||
NAME=${NAME:${n}}
|
||||
fi
|
||||
THUMB="${THUMBDIR}/${NAME}.png"
|
||||
if [[ ! -f "$THUMB" ]]
|
||||
then
|
||||
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
|
||||
fi
|
||||
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
@rect,,$((jgtools_padding + 2)),$((jgtools_padding + 2)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
@rect,,$((jgtools_padding + 92)),$((jgtools_padding + 2)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
@rect,,$((jgtools_padding + 182)),$((jgtools_padding + 2)),86,46,0,left,top,#FFFFFF 60,#FFFFFF 40,
|
||||
|
||||
@text,,$((jgtools_padding + 222)),$((jgtools_padding + 2)),86,46,0,left,top,#FFFFFF 100,#FFFFFF 30,<span size='20800' font_family='Ubuntu'><big></big></span>
|
||||
|
||||
@rect,,$((jgtools_padding + 2)),$((jgtools_padding + 52)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
#@rect,,$((jgtools_padding + 92)),$((jgtools_padding + 52)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
@rect,,$((jgtools_padding + 182)),$((jgtools_padding + 52)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
|
||||
@rect,,$((jgtools_padding + 2)),$((jgtools_padding + 102)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
@rect,,$((jgtools_padding + 92)),$((jgtools_padding + 102)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
@rect,,$((jgtools_padding + 182)),$((jgtools_padding + 102)),86,46,0,left,top,#FFFFFF 20,#222222 30,
|
||||
|
||||
@rect,,$((jgtools_padding + 135)),$((jgtools_padding + 122)),135,22,0,left,top,#222222 20,#222222 70,
|
||||
@text,,$((jgtools_padding + 168)),$((jgtools_padding + 118)),130,30,0,left,top,#EEEEEE,${WINCLR},<span size='10400' font_family='Ubuntu'><b>SuperClick</b></span>
|
||||
$(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()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdeskgrid=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
156
usr/bin/jgdeskmngr
Executable file
156
usr/bin/jgdeskmngr
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/bin/bash
|
||||
# jgdeskmngr - pipemenu (or standalone dynamic menu) for deskmngr
|
||||
#
|
||||
|
||||
SESSIONDIR="$HOME/.config/deskmngr/"
|
||||
CONFIG_FILE="$SESSIONDIR/deskmngr.conf"
|
||||
mkdir -p $SESSIONDIR
|
||||
# If config file not exist create one with defaults
|
||||
if [ ! -f $CONFIG_FILE ]; then
|
||||
cat <<EOF > ${CONFIG_FILE}
|
||||
waitsec=1
|
||||
EOF
|
||||
fi
|
||||
source <(grep = $CONFIG_FILE)
|
||||
waittime=${waitsec:-1}
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
DESKMNGR="Menadżer sesji desktopowych"
|
||||
ABOUT="O DeskMngr"
|
||||
SAVED_SESS="Zapisane sesje"
|
||||
RESTORE_TO="Przywróć na pulpit..."
|
||||
OVERWRITE="<b>Nadpisz</b> sesję:"
|
||||
EDIT="<b>Edytuj</b> sesję:"
|
||||
DELETE="<b>Usuń</b> sesję:"
|
||||
OPEN_CNFDIR="Otwórz katalog z sesjami"
|
||||
ADD="Dodaj nową..."
|
||||
NEW="<b>Nowa</b> sesja z bieżącego pulpitu jako..."
|
||||
SETTINGS="Ustawienia"
|
||||
INTERVAL="Interwał"
|
||||
title="DeskMngr - zapisuje i przywraca sesje"
|
||||
help='\nZapisuje rozmiar i pozycję wszystkich okien z bieżącego pulpitu.\n\nSesję możesz otworzyć poźniej na dowolnym pulpicie.\n\n'
|
||||
LEFTPANEL="Lewy panel"
|
||||
;;
|
||||
es*)
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
DESKMNGR="Desktop session Manager"
|
||||
ABOUT="About DeskMngr"
|
||||
SAVED_SESS="Saved sessions"
|
||||
RESTORE_TO="Restore to desktop..."
|
||||
OVERWRITE="<b>Overwrite</b> session:"
|
||||
EDIT="<b>Edit</b> session:"
|
||||
DELETE="<b>Delete</b> session:"
|
||||
OPEN_CNFDIR="Open config directory"
|
||||
ADD="Add new..."
|
||||
NEW="<b>New</b> session from current desktop as..."
|
||||
SETTINGS="Settings"
|
||||
INTERVAL="Interval"
|
||||
title="DeskMngr - save and restore sessions"
|
||||
help='\nSave all opened windows from active desktop as session.\n\nRestore saved session later on desktop of your choice.\n\n'
|
||||
LEFTPANEL="Left panel"
|
||||
;;
|
||||
*)
|
||||
REMOVE="Remove this menu from panel"
|
||||
DESKMNGR="Desktop session Manager"
|
||||
ABOUT="About DeskMngr"
|
||||
SAVED_SESS="Saved sessions"
|
||||
RESTORE_TO="Restore to desktop..."
|
||||
OVERWRITE="<b>Overwrite</b> session:"
|
||||
EDIT="<b>Edit</b> session:"
|
||||
DELETE="<b>Delete</b> session:"
|
||||
OPEN_CNFDIR="Open config directory"
|
||||
ADD="Add new..."
|
||||
NEW="<b>New</b> session from current desktop as..."
|
||||
SETTINGS="Settings"
|
||||
INTERVAL="Interval"
|
||||
title="DeskMngr - save and restore sessions"
|
||||
help='\nSave all opened windows from active desktop as session.\nRestore saved session later on desktop of your choice.\n\n'
|
||||
LEFTPANEL="Left panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
me="jgdeskmngr -s"
|
||||
|
||||
SESSIONDIR="$HOME/.config/deskmngr/"
|
||||
mkdir -p $SESSIONDIR
|
||||
|
||||
out+=("^sep($DESKMNGR)")
|
||||
out+=("<big></big> $ABOUT,notify-send.sh -u critical -i mbcc '$title' '$help';$me")
|
||||
|
||||
|
||||
out+=("^sep(<i><small>$SAVED_SESS</small></i>)")
|
||||
i="0"
|
||||
while IFS= read -r line
|
||||
do
|
||||
name=$(basename $line .desk)
|
||||
out+=(" ${name//_/ },^checkout(sess${i})")
|
||||
out2+=("^tag(sess${i})")
|
||||
out2+=("^sep($RESTORE_TO)")
|
||||
while IFS= read -r linia || [ -n "$linia" ];
|
||||
do read -r ID dname< <(echo $linia)
|
||||
dname=$(wmctrl -d | grep ^${ID} | cut -d' ' -f13-)
|
||||
out2+=("\"\"\" ${dname/&/&}\"\"\",deskmngr -r $name.desk $ID")
|
||||
done < <(wmctrl -d|awk '{print $1}')
|
||||
out2+=("^sep()" " $OVERWRITE <b>${name//_/ }</b>,deskmngr save $name")
|
||||
out2+=("^sep()" " $EDIT <b>${name//_/ }</b>,xdg-open $SESSIONDIR$name.desk")
|
||||
out2+=("^sep()" " $DELETE <b>${name//_/ }</b>,rm -f $SESSIONDIR$name.desk;$me")
|
||||
((i=i+1))
|
||||
done < <(deskmngr -l)
|
||||
|
||||
out+=("^sep()" " $OPEN_CNFDIR,pcmanfm ~/.config/deskmngr/")
|
||||
out+=("^sep(<i><small>$ADD</small></i>)")
|
||||
out+=(" $NEW,deskmngr -s")
|
||||
out+=("^sep($SETTINGS)")
|
||||
out+=("$INTERVAL: <b>[ $waittime ]</b> ,^checkout(time)")
|
||||
out2+=("^tag(time)")
|
||||
out2+=("^sep($INTERVAL)")
|
||||
for i in 1 2 3 4 5; do out2+=("$(printf "<tt>%3s</tt>,%s" "$i" "mb-setvar waitsec=${i} $CONFIG_FILE;$me")");done
|
||||
### RUN
|
||||
if [ "$1" == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" $LEFTPANEL,mb-jgtools places")
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
mkconfigfile
|
||||
|
||||
cat << EOF > ${MENU_ITEMS}
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
. ~/.config/mabox/jgdeskmngr.csv
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
printf '%s\n' "${out[@]}"
|
||||
cat ~/.config/mabox/jgdeskmngr.csv
|
||||
|
||||
if [[ $1 == "-r" ]]; then
|
||||
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdeskmngr=false;mb-jgtools places"
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out2[@]}"
|
||||
399
usr/bin/jgdesktops
Executable file
399
usr/bin/jgdesktops
Executable file
@@ -0,0 +1,399 @@
|
||||
#!/bin/bash
|
||||
# jgdesktops
|
||||
#
|
||||
COLORIZER_CONF="$HOME/.config/colorizer/colorizer.conf"
|
||||
AREA_CFG="$HOME/.config/areaclick.conf"
|
||||
source ${COLORIZER_CONF}
|
||||
me="jgdesktops -s"
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
TITLE="Pulpity i Okna"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
ACTIVE="bieżący"
|
||||
GOTO="Idź do..."
|
||||
WINKILL="Zabijacz Okien"
|
||||
CLOSEALL_GR="Z wdziękiem <b>zamknij wszystkie okna</b> na..."
|
||||
CLOSEALL="Zamknij wszystkie okna na..."
|
||||
DESKTOP="Pulpicie"
|
||||
ALL_DESK="Wszystkich pulpitach"
|
||||
MANAGE="Pulpity"
|
||||
ADD="<b>Dodaj nowy</b>"
|
||||
REMOVE_LAST="<b>Usuń ostatni</b>"
|
||||
CONKY_TOGGLE="Włącz/Wyłącz Conky"
|
||||
PICOM_TOGGLE="Włącz/Wyłącz Picom"
|
||||
DESKMNGR="Menadżer sesji pulpitowych"
|
||||
WALLCHANGER="Tapetu oraz <b>stylizacja</b> pulpitu"
|
||||
DESKGRID="Desktop Grid"
|
||||
SCREEN_RES="Ustawienia ekranu"
|
||||
ENABLE="Włącz"
|
||||
DISABLE="Wyłącz"
|
||||
DESK_SERVICES="Usługi pulpitu"
|
||||
TINT2="<b>Tint2 panel</b>"
|
||||
CONKY="Sesja <b>Conky</b>"
|
||||
PICOM="<b>Picom</b> - kompozytor"
|
||||
CORTILE="<b>Cortile</b> - tiling manager"
|
||||
MCORNERS="<b>Krawędzie ekranu</b>"
|
||||
RUNNING="(uruchomiona)"
|
||||
STOPPED="(zatrzymana)"
|
||||
MONITORBLANK="<b>Wygaszanie</b> monitora"
|
||||
ON="(włączone)"
|
||||
OFF="(wyłączone)"
|
||||
WMTWEAKS="Ulepszenia Menadżera Okien"
|
||||
SHOW_DESK="Pokaż pulpit - lewy klik"
|
||||
SWITCH_DESK="Zmień pulpit - kółko myszy"
|
||||
FOCUS="Fokus podąża za myszą"
|
||||
WALLPAPER="Tapeta"
|
||||
TOOLS="Narzędzia"
|
||||
OBTHEME="Motyw Openbox"
|
||||
MENUPANELS="Menu i Panele"
|
||||
YES="Tak"
|
||||
NO="Nie"
|
||||
AREACLICK="AreaClick"
|
||||
ABOUT_AREACLICK="O AreaClick"
|
||||
AREA_WIDTH="rozmiar obszaru"
|
||||
EDIT_AREACONF="Edytuj <i>areaclick.conf</i>"
|
||||
RESET_AREACONF="Resetuj plik konfiguracyjny"
|
||||
RESET_SURE="Na pewno?"
|
||||
RESET_YES="Tak, resetuj"
|
||||
WM_MARGIN="Marginesy Openbox"
|
||||
OBCONF_MARG="ObConf -> Marginesy"
|
||||
SET_ALL_MARG="ustaw wszystkie na:"
|
||||
;;
|
||||
es*)
|
||||
TITLE="Windows & Desktops"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
ACTIVE="active"
|
||||
GOTO="Go to..."
|
||||
WINKILL="Windows Killer"
|
||||
CLOSEALL_GR="Gracefully <b>close all windows</b> on..."
|
||||
CLOSEALL="Close all windows on..."
|
||||
DESKTOP="Desktop"
|
||||
ALL_DESK="All Desktops"
|
||||
MANAGE="Manage Desktops"
|
||||
ADD="<b>Add new</b> desktop"
|
||||
REMOVE_LAST="<b>Remove last</b> desktop"
|
||||
CONKY_TOGGLE="Conky Toggle"
|
||||
PICOM_TOGGLE="Picom Toggle"
|
||||
DESKMNGR="Desktop session Manager"
|
||||
WALLCHANGER="Wallpaper & Desktop <b>styling</b>"
|
||||
DESKGRID="Desktop Grid"
|
||||
SCREEN_RES="Screen Settings"
|
||||
ENABLE="Enable"
|
||||
DISABLE="Disable"
|
||||
DESK_SERVICES="Desktop services"
|
||||
TINT2="<b>Tint2 panel</b> session"
|
||||
CONKY="<b>Conky</b> session"
|
||||
PICOM="<b>Picom</b> - compositor"
|
||||
CORTILE="<b>Cortile</b> - tiling manager"
|
||||
MCORNERS="<b>Screen Edges</b> - hot corners"
|
||||
RUNNING="(running)"
|
||||
STOPPED="(stopped)"
|
||||
MONITORBLANK="Monitor <b>blanking</b>"
|
||||
ON="(on)"
|
||||
OFF="(off)"
|
||||
WMTWEAKS="Window Manager tweaks"
|
||||
SHOW_DESK="Show Desktop on left click"
|
||||
SWITCH_DESK="Switch Desktop on mousewheel up/down"
|
||||
FOCUS="Focus follow Mouse"
|
||||
WALLPAPER="Wallpaper"
|
||||
TOOLS="Tools"
|
||||
OBTHEME="Openbox Theme"
|
||||
MENUPANELS="Menus/Panels"
|
||||
YES="Yes"
|
||||
NO="No"
|
||||
AREACLICK="AreaClick"
|
||||
ABOUT_AREACLICK="About AreaClick"
|
||||
AREA_WIDTH="click area size"
|
||||
EDIT_AREACONF="Edit <i>areaclick.conf</i>"
|
||||
RESET_AREACONF="Reset config to defaults"
|
||||
RESET_SURE="Are you sure?"
|
||||
RESET_YES="Yes, reset to defaults"
|
||||
WM_MARGIN="Openbox Margin"
|
||||
OBCONF_MARG="ObConf -> Margins"
|
||||
SET_ALL_MARG="set all margins to:"
|
||||
;;
|
||||
*)
|
||||
TITLE="Windows & Desktops"
|
||||
REMOVE="Remove this menu from panel"
|
||||
ACTIVE="active"
|
||||
GOTO="Go to..."
|
||||
WINKILL="Windows Killer"
|
||||
CLOSEALL_GR="Gracefully <b>close all windows</b> on..."
|
||||
CLOSEALL="Close all windows on..."
|
||||
DESKTOP="Desktop"
|
||||
ALL_DESK="All Desktops"
|
||||
MANAGE="Manage Desktops"
|
||||
ADD="<b>Add new</b> desktop"
|
||||
REMOVE_LAST="<b>Remove last</b> desktop"
|
||||
DESKMNGR="Desktop session Manager"
|
||||
CONKY_TOGGLE="Conky Toggle"
|
||||
PICOM_TOGGLE="Picom Toggle"
|
||||
WALLCHANGER="Wallpaper & Desktop <b>styling</b>"
|
||||
DESKGRID="Desktop Grid"
|
||||
SCREEN_RES="Screen settings"
|
||||
ENABLE="Enable"
|
||||
DISABLE="Disable"
|
||||
DESK_SERVICES="Desktop services"
|
||||
TINT2="<b>Tint2 panel</b> session"
|
||||
CONKY="<b>Conky</b> session"
|
||||
PICOM="<b>Picom</b> - compositor"
|
||||
CORTILE="<b>Cortile</b> - tiling manager"
|
||||
MCORNERS="<b>Screen Edges</b> - hot corners"
|
||||
RUNNING="(running)"
|
||||
STOPPED="(stopped)"
|
||||
MONITORBLANK="Monitor <b>blanking</b>"
|
||||
ON="(on)"
|
||||
OFF="(off)"
|
||||
WMTWEAKS="Window Manager tweaks"
|
||||
SHOW_DESK="Show Desktop on left click"
|
||||
SWITCH_DESK="Switch Desktop on mousewheel up/down"
|
||||
FOCUS="Focus follow Mouse"
|
||||
WALLPAPER="Wallpaper"
|
||||
TOOLS="Tools"
|
||||
COLORIZER_SETTINGS="Colorizer Settings"
|
||||
OBTHEME="Openbox Theme"
|
||||
MENUPANELS="Menus/Panels"
|
||||
YES="Yes"
|
||||
NO="No"
|
||||
AREACLICK="AreaClick"
|
||||
ABOUT_AREACLICK="About AreaClick"
|
||||
AREA_WIDTH="click area size"
|
||||
EDIT_AREACONF="Edit <i>areaclick.conf</i>"
|
||||
RESET_AREACONF="Reset config to defaults"
|
||||
RESET_SURE="Are you sure?"
|
||||
RESET_YES="Yes, reset to defaults"
|
||||
WM_MARGIN="Openbox Margin"
|
||||
OBCONF_MARG="ObConf -> Margins"
|
||||
SET_ALL_MARG="set all margins to:"
|
||||
;;
|
||||
esac
|
||||
|
||||
#CSVFILE="$HOME/.config/mabox/jgdesktops-bottom.csv"
|
||||
# If config file not exist create one with defaults
|
||||
#if [ ! -f $CSVFILE ]; then
|
||||
#cat <<EOF > ${CSVFILE}
|
||||
#^sep($TOOLS)
|
||||
#<big></big> $WALLCHANGER,^pipe(jgwallpaperchanger)
|
||||
#<big></big> $DESKGRID,^pipe(jgdeskgrid)
|
||||
#<big></big> $DESKMNGR,^pipe(jgdeskmngr)
|
||||
#<big></big> $SCREEN_RES - ARandR,arandr
|
||||
#<big></big> $SCREEN_RES - LXRandr,lxrandr
|
||||
#EOF
|
||||
#fi
|
||||
|
||||
out+=("^sep(${TITLE})")
|
||||
currdesk=$(wmctrl -d | grep "*" | awk '{print $1}')
|
||||
#out+=("^sep(Okna i pulpity)")
|
||||
|
||||
i=0
|
||||
|
||||
while IFS= read -r linia || [ -n "$linia" ];
|
||||
do
|
||||
name=""
|
||||
read -r ID name< <(echo $linia)
|
||||
#declare -g "arr$ID"=("$name, wmctrl -s $ID")
|
||||
dname=$(wmctrl -d | grep ^${ID} | cut -d' ' -f13-)
|
||||
if [[ "$ID" = "$currdesk" ]]; then
|
||||
out+=("^sep(<i><small>${dname/&/&} ($ACTIVE)</small></i>)")
|
||||
|
||||
else
|
||||
out+=("^sep(<i><small>${dname/&/&}</small></i>)" " <i>$GOTO</i>,wmctrl -s $ID")
|
||||
fi
|
||||
while IFS= read -r line
|
||||
do
|
||||
read -r id DESK host title< <(echo $line)
|
||||
if [[ "$DESK" = "$ID" ]]; then
|
||||
trimmed=${title:0:60}
|
||||
out+=("\"\"\"[ ${trimmed/&/&} ]\"\"\",wmctrl -i -a $id")
|
||||
fi
|
||||
done < <(wmctrl -l| grep -v " -1")
|
||||
done < <(wmctrl -d|awk '{print $1" "$10" "$11}')
|
||||
|
||||
# Gracefully close windows on any desktop or all windows
|
||||
|
||||
if [ $(wmctrl -l | awk $2 '!/-1/ {print $2}' | uniq |wc -l) -gt 0 ];then
|
||||
out+=("^sep($WINKILL)")
|
||||
out+=("<big></big> $CLOSEALL_GR,^checkout(killwin)")
|
||||
out2+=("^tag(killwin)" "^sep($CLOSEALL)")
|
||||
for i in $(wmctrl -l | awk $2 '!/-1/ {print $2}' |sort| uniq)
|
||||
do
|
||||
dname=$(wmctrl -d | grep ^${i} | cut -d' ' -f13-)
|
||||
out2+=(" $DESKTOP ${dname/&/&},killwindows $i")
|
||||
done
|
||||
out2+=("^sep()" "$ALL_DESK,killwindows all")
|
||||
fi
|
||||
out+=("^sep($MANAGE)")
|
||||
desktops=$(wmctrl -d |wc -l)
|
||||
#out+=(" $ADD,wmctrl -n $((desktops+1));$me")
|
||||
out+=(" $ADD,obxml desktops $((desktops+1));$me")
|
||||
[[ "$desktops" -gt "1" ]] && out+=(" $REMOVE_LAST,obxml desktops $((desktops-1));$me")
|
||||
|
||||
|
||||
|
||||
out+=("^sep($DESK_SERVICES)")
|
||||
if pidof tint2 &>/dev/null;then
|
||||
#out+=("<big></big> $TINT2 <i>$RUNNING</i>,killall tint2;$me")
|
||||
:
|
||||
else
|
||||
out+=("<big></big> $TINT2 <i>$STOPPED</i>,mb-tint2-session &>/dev/null;$me")
|
||||
fi
|
||||
if pidof conky &>/dev/null; then
|
||||
out+=("<big></big> $CONKY <i>$RUNNING</i>,conky_toggle;$me")
|
||||
else
|
||||
out+=("<big></big> $CONKY <i>$STOPPED</i>,conky_toggle;$me")
|
||||
fi
|
||||
if pidof picom &>/dev/null; then
|
||||
out+=("<big></big> $PICOM <i>$RUNNING</i>,compton_toggle;$me")
|
||||
else
|
||||
out+=("<big></big> $PICOM <i>$STOPPED</i>,compton_toggle;$me")
|
||||
fi
|
||||
if command -v mcorners &> /dev/null;then
|
||||
if [[ -f /tmp/mcorners.lck ]]; then
|
||||
out+=("<big></big> $MCORNERS <i>$RUNNING</i>,mcorners --stop;$me")
|
||||
else
|
||||
out+=("<big></big> $MCORNERS <i>$STOPPED</i>,mcorners -tl 'jgdesktops -s' -l 'mb-jgtools places' -tr 'mb-music -s' -bl 'colorizer -s' -br 'skippy-xd-fix' -r 'mb-jgtools right' -iof;$me")
|
||||
fi
|
||||
fi
|
||||
if command -v cortile &> /dev/null;then
|
||||
if pidof cortile &>/dev/null; then
|
||||
out+=("<big></big> $CORTILE <i>$RUNNING</i>,cortilectl stop")
|
||||
else
|
||||
out+=("<big></big> $CORTILE <i>$STOPPED</i>,cortilectl start")
|
||||
fi
|
||||
fi
|
||||
out+=("^sep()")
|
||||
|
||||
|
||||
|
||||
|
||||
if (xset q|grep --quiet "DPMS is Enabled");then
|
||||
out+=("<big></big> $MONITORBLANK <i>$ON</i>,noblank;$me")
|
||||
else
|
||||
out+=("<big></big> $MONITORBLANK <i>$OFF</i>,noblank;$me")
|
||||
fi
|
||||
|
||||
|
||||
# DESKTOP MOUSE ACTIONS
|
||||
mousewheel=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Click"][@button="Up"]/a:action/a:to' $HOME/.config/openbox/rc.xml)
|
||||
focus=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:focus/a:followMouse' $HOME/.config/openbox/rc.xml)
|
||||
areaclick=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/a:command' $HOME/.config/openbox/rc.xml)
|
||||
|
||||
out+=("^sep($WMTWEAKS)")
|
||||
if [[ "${areaclick}" != "areaclick" ]]; then
|
||||
lclick=$(xml sel -N a=http://openbox.org/3.4/rc -t -v '/a:openbox_config/a:mouse/a:context[@name="Root"]/a:mousebind[@action="Press"][@button="Left"]/a:action/@name' $HOME/.config/openbox/rc.xml)
|
||||
if [[ ! -z "$lclick" ]];then
|
||||
[[ "$lclick" = "none" ]] && out+=("<big></big> $SHOW_DESK,obxml show_desk on") || out+=("<big></big> $SHOW_DESK,obxml show_desk off")
|
||||
fi
|
||||
else
|
||||
if source ~/.config/areaclick.conf ;then
|
||||
[[ "${cmd_center}" == "show_desktop" ]] && out+=("<big></big> $SHOW_DESK,mb-setvar cmd_center=none $AREA_CFG") || out+=("<big></big> $SHOW_DESK,mb-setvar cmd_center=show_desktop $AREA_CFG")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -z "$mousewheel" ]];then
|
||||
[[ "$mousewheel" = "none" ]] && out+=("<big></big> $SWITCH_DESK,obxml switch_desk on") || out+=("<big></big> $SWITCH_DESK,obxml switch_desk off")
|
||||
fi
|
||||
[[ "$focus" = "no" ]] && out+=("<big></big> $FOCUS,obxml focus_follow_mouse on") || out+=("<big></big> $FOCUS,obxml focus_follow_mouse off")
|
||||
|
||||
# AREACLICK
|
||||
if [[ "${areaclick}" == "areaclick" ]]; then
|
||||
if source ~/.config/areaclick.conf ;then
|
||||
if [[ "${sidearea}" -gt "0" ]];then
|
||||
out+=("<big></big> <b>$AREACLICK</b> (<i>$AREA_WIDTH</i>: ${sidearea}px),^checkout(area)")
|
||||
else
|
||||
out+=("<big></big> <b>$AREACLICK</b> <i>$STOPPED</i>,^checkout(area)")
|
||||
fi
|
||||
out2+=("^tag(area)")
|
||||
out2+=("^sep(AreaClick)")
|
||||
#out2+=("$ABOUT_AREACLICK,mb-docs areaclick")
|
||||
out2+=("^sep($AREA_WIDTH (px))")
|
||||
[[ "${sidearea}" == "0" ]] && out2+=("<big>綠</big> 0 (disabled),areaclick area 0") || out2+=("<big>祿</big> 0 (disable),areaclick area 0")
|
||||
[[ "${sidearea}" == "2" ]] && out2+=("<big>綠</big> 2px,areaclick area 2") || out2+=("<big>祿</big> 2px,areaclick area 2")
|
||||
[[ "${sidearea}" == "10" ]] && out2+=("<big>綠</big> 10px,areaclick area 10") || out2+=("<big>祿</big> 10px,areaclick area 10")
|
||||
[[ "${sidearea}" == "60" ]] && out2+=("<big>綠</big> 60px,areaclick area 60") || out2+=("<big>祿</big> 60px,areaclick area 60")
|
||||
[[ "${sidearea}" == "100" ]] && out2+=("<big>綠</big> 100px,areaclick area 80") || out2+=("<big>祿</big> 100px,areaclick area 100")
|
||||
[[ "${sidearea}" == "200" ]] && out2+=("<big>綠</big> 200px (disable),areaclick area 200") || out2+=("<big>祿</big> 200px,areaclick area 200")
|
||||
out2+=("^sep()")
|
||||
out2+=("$EDIT_AREACONF,areaclick editconf")
|
||||
out2+=("^sep()")
|
||||
out2+=("$RESET_AREACONF,^checkout(reseta)")
|
||||
out3+=("^tag(reseta)")
|
||||
out3+=("^sep($RESET_SURE)")
|
||||
out3+=("\"\"\"$RESET_YES\"\"\", areaclick reset")
|
||||
|
||||
out2+=("^sep($WM_MARGIN)")
|
||||
m_top=$(obxml sel /a:openbox_config/a:margins/a:top)
|
||||
m_bottom=$(obxml sel /a:openbox_config/a:margins/a:bottom)
|
||||
m_left=$(obxml sel /a:openbox_config/a:margins/a:top)
|
||||
m_right=$(obxml sel /a:openbox_config/a:margins/a:top)
|
||||
out2+=("^sep(<big></big> <small>$m_left</small> <big></big> <small>$m_top</small> <small>$m_bottom</small> <big></big> <small>$m_right</small> <big></big>")
|
||||
#out2+=("$OBCONF_MARG,obconf")
|
||||
out2+=("^sep(<i>$SET_ALL_MARG</i>)")
|
||||
out2+=("0,obxml margin all 0")
|
||||
out2+=("1px,obxml margin all 1")
|
||||
out2+=("2px,obxml margin all 2")
|
||||
out2+=("4px,obxml margin all 4")
|
||||
out2+=("8px,obxml margin all 8")
|
||||
out2+=("16px,obxml margin all 16")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
out+=("^sep($TOOLS)")
|
||||
out+=("<big></big> $WALLCHANGER,jgwallpaperchanger -s")
|
||||
out+=("<big></big> SuperClick,jgdeskgrid -s")
|
||||
out+=("<big></big> $DESKMNGR,^pipe(jgdeskmngr)")
|
||||
|
||||
|
||||
#out+=(". ~/.config/mabox/jgdesktops-bottom.csv")
|
||||
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" || "$1" == "ipc" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="center"
|
||||
|
||||
if [[ "$1" == "ipc" ]]; then
|
||||
POSITION_MODE="ipc"
|
||||
else
|
||||
POSITION_MODE="pointer"
|
||||
fi
|
||||
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[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
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()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdesktops=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
91
usr/bin/jgespanso-pipe
Executable file
91
usr/bin/jgespanso-pipe
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
TYPE_TO_SEARCH="pisz, aby wyszukać"
|
||||
CONFIGURE="Konfiguracja Espanso"
|
||||
EDITCONF="Edytuj domyślny plik konfiguracyjny"
|
||||
OPENCONFDIR="Otwórz katalog z konfiguracją"
|
||||
DOCU="Dokumentacja <b>Espanso</b> (online)"
|
||||
LIST="Lista wyzwalaczy:"
|
||||
;;
|
||||
es*)
|
||||
TYPE_TO_SEARCH="Buscar"
|
||||
CONFIGURE="Configurar Espanso"
|
||||
EDITCONF="Editar archivo x defecto"
|
||||
OPENCONFDIR="Abrir el directorio"
|
||||
DOCU="Leer <b>Documentacion</b> de Espanso (en línea)"
|
||||
LIST="List of triggers:"
|
||||
;;
|
||||
*)
|
||||
TYPE_TO_SEARCH="Type to filter"
|
||||
CONFIGURE="Configure Espanso"
|
||||
EDITCONF="Edit default config file"
|
||||
OPENCONFDIR="Open config directory"
|
||||
DOCU="Read <b>Espanso</b> documentation (online)"
|
||||
LIST="List of triggers:"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
MENU_ITEMS=/tmp/espanso_list.csv
|
||||
trap "rm -f $MENU_ITEMS" EXIT
|
||||
|
||||
if ! pgrep -x "espanso" > /dev/null
|
||||
then
|
||||
echo "^sep(Espanso - text expander)" >/tmp/espanso_list.csv
|
||||
echo "Espanso not running! Run it first by: espanso start,^term(espanso start)" >>/tmp/espanso_list.csv
|
||||
|
||||
else
|
||||
echo "@search,,10,5,292,20,4,left,top,auto,#262626,\"\"\"<big></big> <i>$TYPE_TO_SEARCH</i>\"\"\"" >/tmp/espanso_list.csv
|
||||
echo "^sep(Espanso - text expander)" >>/tmp/espanso_list.csv
|
||||
echo "^sep($CONFIGURE)" >>/tmp/espanso_list.csv
|
||||
echo "$OPENCONFDIR,pcmanfm ~/.config/espanso/" >>/tmp/espanso_list.csv
|
||||
echo "$DOCU,exo-open --launch WebBrowser https://espanso.org/docs/" >>/tmp/espanso_list.csv
|
||||
echo "^sep($LIST)" >>/tmp/espanso_list.csv
|
||||
while read -r line ; do
|
||||
|
||||
IFS='-' read -r id string <<< "$line"
|
||||
#printf "\"\"\"<b><tt>%-12s</tt></b> <i>%s</i>\"\"\",xdotool type %s\n" $id "${string//</<}" $id >> $MENU_ITEMS
|
||||
string="${string//</<}"
|
||||
string="${string//&/&}"
|
||||
printf "\"\"\"<b><tt>%-12s</tt></b> <i>%s</i>\"\"\",xdotool type %s\n" $id "${string}" $id >> $MENU_ITEMS
|
||||
done < <(espanso match list)
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
### RUN
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_PADDING_TOP=24
|
||||
MENU_HALIGN="center"
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=500
|
||||
MENU_HEIGHT_MAX=600
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
mkconfigfile
|
||||
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=/tmp/espanso_list.csv 2>/dev/null
|
||||
rm -f /tmp/espanso_list.csv
|
||||
exit 0
|
||||
fi
|
||||
#cat ${CONFIG_FILE}
|
||||
#cat ${MENU_ITEMS}
|
||||
|
||||
if [ $1 == "-r" ]; then
|
||||
echo "<i>$REMOVE</i>,mb-setvar places_softwarepipe=false" >> /tmp/espanso_list.csv
|
||||
fi
|
||||
cat "${MENU_ITEMS}"
|
||||
57
usr/bin/jghistory-pipe
Executable file
57
usr/bin/jghistory-pipe
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
case $LANG in
|
||||
pl*)
|
||||
TYPE_TO_SEARCH="pisz, aby wyszukać"
|
||||
HISTHELPER="Ściągawka z historii"
|
||||
NOTHING="Niczego tu nie ma... Otwórz terminal (W-t) i wykonaj jakieś polecenie"
|
||||
;;
|
||||
es*)
|
||||
TYPE_TO_SEARCH="Buscar"
|
||||
HISTHELPER="Historia breve"
|
||||
NOTHING="Nada que ver aquí...Abrir la terminal (W-t) y ejecutar algunos comandos"
|
||||
;;
|
||||
*)
|
||||
TYPE_TO_SEARCH="Type to filter"
|
||||
HISTHELPER="History helper"
|
||||
NOTHING="Nothing to see here... Open terminal (W-t) and run some commands"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
MENU_ITEMS=/tmp/history_list.csv
|
||||
trap "rm -f $MENU_ITEMS" EXIT
|
||||
|
||||
|
||||
if [ -f ~/.bash_history ]; then
|
||||
echo "@search,,10,5,292,20,4,left,top,auto,#262626,\"\"\"<big></big> <i>$TYPE_TO_SEARCH</i>\"\"\"" >/tmp/history_list.csv
|
||||
|
||||
echo "^sep($HISTHELPER)" >>/tmp/history_list.csv
|
||||
while read -r line ; do
|
||||
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \'%s\'\n" "$line" "$line" >> $MENU_ITEMS
|
||||
done < <(cat ~/.bash_history|sort|uniq)
|
||||
else
|
||||
echo "^sep($HISTHELPER)" >/tmp/history_list.csv
|
||||
echo "\"\"\"$NOTHING\"\"\",exo-open --launch TerminalEmulator" >>/tmp/history_list.csv
|
||||
fi
|
||||
### RUN
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
|
||||
MENU_PADDING_TOP=24
|
||||
MENU_HALIGN="center"
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=500
|
||||
MENU_HEIGHT_MAX=600
|
||||
mkconfigfile
|
||||
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=/tmp/history_list.csv 2>/dev/null
|
||||
rm -f /tmp/history_list.csv
|
||||
exit 0
|
||||
fi
|
||||
#cat ${CONFIG_FILE}
|
||||
cat ${MENU_ITEMS}
|
||||
|
||||
|
||||
176
usr/bin/jgkeys-pipe
Executable file
176
usr/bin/jgkeys-pipe
Executable file
@@ -0,0 +1,176 @@
|
||||
#!/bin/bash
|
||||
# jgkeys-pipe - native jgmenu pipemenu with keyboard shortcuts
|
||||
#
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
APPS="Aplikacje"
|
||||
FILEMNGR="Menadżer plików"
|
||||
BROWSER="Przeglądarka WWW"
|
||||
TERMINAL="Terminal"
|
||||
EDITOR="Edytor tekstu"
|
||||
FSEARCH="Wyszukiwanie plików"
|
||||
RESMON="Monitor zasobów"
|
||||
PYRADIO="PyRadio"
|
||||
VOLUME="Kontrola głośności"
|
||||
COMPOSITOR="wł/wył Picom"
|
||||
WINDOWS="Okna"
|
||||
HALF="połowa ekranu"
|
||||
FULL="Pełny ekran"
|
||||
ARROWS="Strzałki"
|
||||
SHOW_DESKTOP="pokaż pulpit"
|
||||
|
||||
PANELS="Menu/Panele boczne"
|
||||
M_MAIN="Główne menu"
|
||||
M_SETTINGS="Menu ustawień"
|
||||
M_HELP="Menu pomocy (to menu)"
|
||||
PLACES="Lewy (miejsca)"
|
||||
RIGHT="Prawy (ustawienia/pomoc)"
|
||||
LOCK="Blokada ekranu"
|
||||
EXIT="Wyloguj..."
|
||||
HELPERS="Pomocnicy"
|
||||
HISTORY="Ściągawka z historii"
|
||||
ESPANSO="Espanso - text expander"
|
||||
JGTILE="Kafelkowanie okien"
|
||||
SHORTCUTS="Wszystkie skróty"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
|
||||
;;
|
||||
es*)
|
||||
APPS="Ejecutar"
|
||||
FILEMNGR="gestor archivos"
|
||||
BROWSER="Navegador"
|
||||
TERMINAL="Terminal"
|
||||
EDITOR="Editor de textos"
|
||||
FSEARCH="FSearch"
|
||||
RESMON="Monitor de recursos"
|
||||
PYRADIO="Internet Radio"
|
||||
VOLUME="control volumen "
|
||||
COMPOSITOR="activa/desact compositor"
|
||||
WINDOWS="VENTANAS"
|
||||
HALF="1/2 pantalla"
|
||||
FULL="Toggle Full Screen"
|
||||
ARROWS="Arrows"
|
||||
SHOW_DESKTOP="mostrar escritorio"
|
||||
|
||||
PANELS="Paneles Laterales"
|
||||
|
||||
M_MAIN="Menú principal"
|
||||
M_SETTINGS="Menú de configuración"
|
||||
M_HELP="Menú de ayuda"
|
||||
PLACES="Lugares (izquierda)"
|
||||
RIGHT="Ajustes (derecha)"
|
||||
LOCK="Bloquear pantalla"
|
||||
EXIT="Salir "
|
||||
HELPERS="Ayudantes"
|
||||
HISTORY="Historia breve"
|
||||
ESPANSO="Espanso - text expander"
|
||||
JGTILE="Tiling helper"
|
||||
SHORTCUTS="Atajos del teclado"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
|
||||
;;
|
||||
*)
|
||||
APPS="Applications"
|
||||
FILEMNGR="File Manager"
|
||||
BROWSER="WWW browser"
|
||||
TERMINAL="Terminal"
|
||||
EDITOR="Text Editor"
|
||||
FSEARCH="FSearch"
|
||||
RESMON="Resource Monitor"
|
||||
PYRADIO="Internet Radio"
|
||||
VOLUME="Volume Control"
|
||||
COMPOSITOR="toggle Picom (Compositor)"
|
||||
WINDOWS="Windows"
|
||||
HALF="Half screen"
|
||||
FULL="Toggle Full Screen"
|
||||
ARROWS="Arrows"
|
||||
SHOW_DESKTOP="Show desktop"
|
||||
|
||||
PANELS="Menu/SidePanels"
|
||||
M_MAIN="Main Menu"
|
||||
M_SETTINGS="Settings Menu"
|
||||
M_HELP="Help (this) Menu"
|
||||
PLACES="Places Sidepanel (Left)"
|
||||
RIGHT="Help/Settings Sidepanel (Right)"
|
||||
LOCK="Lock screen"
|
||||
EXIT="Exit Dialog"
|
||||
HELPERS="Helpers"
|
||||
HISTORY="History helper"
|
||||
ESPANSO="Espanso - text expander"
|
||||
JGTILE="Tiling helper"
|
||||
SHORTCUTS="All Keybindings"
|
||||
REMOVE="Remove this menu from panel"
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
out+=("^sep($APPS)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-f" "$FILEMNGR" "exo-open --launch FileManager")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-w" "$BROWSER" "exo-open --launch WebBrowser")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-t" "$TERMINAL" "exo-open --launch TerminalEmulator")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-grave" "Quake-like $TERMINAL" "mabox-terminal")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-e" "$EDITOR" geany)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-g" "Galculator" galculator)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-h" "$RESMON" "^term(bpytop)")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-/" "$FSEARCH" fsearch)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-r" "$PYRADIO" "sakura -e 'pyradio'")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-v" "$VOLUME" pavucontrol)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-c" "$COMPOSITOR" compton_toggle)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-l" "$LOCK" "betterlockscreen -l")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-x" "$EXIT" "mb-jgtools mblogout")")
|
||||
|
||||
out+=("^sep($PANELS)")
|
||||
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W" "$M_MAIN" "mb-jgtools main")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-s" "$M_SETTINGS" "mb-jgtools settings")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-k" "$M_HELP" "jgkeys-pipe -s")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "C-W-Left" "$PLACES" "mb-jgtools places")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "C-W-Right" "$RIGHT" "mb-jgtools right")")
|
||||
|
||||
out+=("^sep($WINDOWS)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-d" "$SHOW_DESKTOP" show_desktop)")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-$ARROWS" "$HALF")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "F11/W-Enter" "$FULL")")
|
||||
|
||||
out+=("^sep($HELPERS)")
|
||||
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-t" "$JGTILE" "jgtile")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-h" "$HISTORY" "jghistory-pipe -s")")
|
||||
out+=("$(printf "<b><tt>%11s</tt></b> <i> %s</i>,%s" "W-A-e" "$ESPANSO" "jgespanso-pipe -s")")
|
||||
out+=("^sep()")
|
||||
out+=("$(printf "%s,%s" "$SHORTCUTS" "mb-kb --gui &>/dev/null")")
|
||||
|
||||
### RUN
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/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[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
printf '%s\n' "${out[@]}"
|
||||
#printf '%s\n' "${out[@]}" > $HOME/.config/mabox/shortkeys.csv
|
||||
|
||||
if [ $1 == "-r" ]; then
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_keyspipe=false;mb-jgtools places"
|
||||
fi
|
||||
|
||||
152
usr/bin/jglockscreen
Executable file
152
usr/bin/jglockscreen
Executable file
@@ -0,0 +1,152 @@
|
||||
#!/bin/bash
|
||||
# jglockscreen - configure betterlockscreen
|
||||
#
|
||||
CONFIG_DIR="$HOME/.config/mbscreenlocker/"
|
||||
SCRNLOCKCFG="$HOME/.config/mbscreenlocker/mbscreenlocker.conf"
|
||||
|
||||
# Make config directory if not exist
|
||||
mkdir -p $CONFIG_DIR
|
||||
|
||||
# If config file not exist create one with defaults
|
||||
if [ ! -f $SCRNLOCKCFG ]; then
|
||||
cat <<EOF > ${SCRNLOCKCFG}
|
||||
# Effect to use: dim, blur, dimblur or pixel
|
||||
effect=pixel
|
||||
# ScreenLocker program: betterlockscreen or i3lock
|
||||
screenlocker=i3lock
|
||||
EOF
|
||||
fi
|
||||
|
||||
# read config variables from file
|
||||
source <(grep = $SCRNLOCKCFG)
|
||||
case $LANG in
|
||||
pl*)
|
||||
LOCK="Zablokuj ekran"
|
||||
GENIMGS="Generuj obrazy tła"
|
||||
LOCKER="Blokada ekranu <small>(super+l)</small>"
|
||||
TYPETO="wpisz hasło aby odblokować"
|
||||
SELECT_IMG="Wybierz obrazek"
|
||||
CACHE="Użyj aktualnej tapety"
|
||||
EFFECT="Efekt (ustaw i wypróbuj)"
|
||||
DIM="przyciemnienie"
|
||||
BLUR="rozmycie"
|
||||
DIMBLUR="przyciemnienie i rozmycie"
|
||||
PIXEL="pikseloza"
|
||||
DESK="Rozmyty pulpit"
|
||||
EDITCONF="Edytuj plik konfiguracyjny"
|
||||
LEFTPANEL="Lewy panel"
|
||||
;;
|
||||
*)
|
||||
LOCK="Lock screen now"
|
||||
GENIMGS="Update Images"
|
||||
LOCKER="ScreenLocker <small>(super+l)</small>"
|
||||
TYPETO="type password to unlock"
|
||||
SELECT_IMG="Select image file"
|
||||
CACHE="Cache current wallpaper for ScreenLock"
|
||||
EFFECT="Effect (set and run)"
|
||||
DIM="dim"
|
||||
BLUR="blur"
|
||||
DIMBLUR="dim and blur"
|
||||
PIXEL="pixel"
|
||||
DESK="Blurred desktop"
|
||||
EDITCONF="Edit config file"
|
||||
LEFTPANEL="Left panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
me="jglockscreen -s"
|
||||
#help='\nBased on Mabox forum member Shwaybo <a href="https://forum.maboxlinux.org/t/chwp-desktop-wallpaper-changer/496">idea</a>.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n'
|
||||
|
||||
out+=("^sep($LOCKER)")
|
||||
out+=("^sep(<i><small>$TYPETO</small></i>")
|
||||
#out+=("^sep(Betterlockscreen)")
|
||||
out+=("$LOCK,mbscreenlocker")
|
||||
out+=("^sep($GENIMGS)")
|
||||
out+=("$SELECT_IMG,mbscreenlocker -s")
|
||||
out+=("$CACHE,mbscreenlocker -c")
|
||||
out+=("^sep(<i><small>$EFFECT</small></i>)")
|
||||
if [ $effect == "dim" -a $screenlocker != "i3lock" ];then
|
||||
out+=("<b>[ $DIM ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker")
|
||||
else
|
||||
out+=("$DIM,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker")
|
||||
fi
|
||||
if [ $effect == "blur" -a $screenlocker != "i3lock" ];then
|
||||
out+=("<b>[ $BLUR ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker")
|
||||
else
|
||||
out+=("$BLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker")
|
||||
fi
|
||||
if [ $effect == "dimblur" -a $screenlocker != "i3lock" ];then
|
||||
out+=("<b>[ $DIMBLUR ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker")
|
||||
else
|
||||
out+=("$DIMBLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker")
|
||||
fi
|
||||
if [ $effect == "pixel" -a $screenlocker != "i3lock" ];then
|
||||
out+=("<b>[ $PIXEL ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker")
|
||||
else
|
||||
out+=("$PIXEL,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker")
|
||||
fi
|
||||
out+=("^sep()")
|
||||
if [ $screenlocker = "i3lock" ];then
|
||||
out+=("<b>[ $DESK ]</b>,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker")
|
||||
else
|
||||
out+=("$DESK,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker")
|
||||
fi
|
||||
out+=("^sep()")
|
||||
out+=("$EDITCONF ,xdg-open $SCRNLOCKCFG")
|
||||
|
||||
out2+=("^tag(interval)")
|
||||
for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf "<tt> %4s</tt>,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" ⮜ $LEFTPANEL,mb-jgtools places")
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=40
|
||||
menu_margin_x=${submenu_spacing:-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
|
||||
case $LANG in
|
||||
pl*) REMOVE="Usuń to menu z panelu";;
|
||||
es*) REMOVE="Eliminar este menú del panel";;
|
||||
*) REMOVE="Remove this menu from panel";;
|
||||
esac
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jglockscreen=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
echo $effect
|
||||
echo $screenlocker
|
||||
493
usr/bin/jgmenusettings-pipe
Executable file
493
usr/bin/jgmenusettings-pipe
Executable file
@@ -0,0 +1,493 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
TITLE="Ustawienia Menu i Paneli"
|
||||
MENU_ITEMS="Konfiguruj Elementy Menu"
|
||||
OWN_COMMANDS="własne komendy"
|
||||
FAVORITES="Ulubione (u góry)"
|
||||
BELOW_APPS="(pod Aplikacjami)"
|
||||
MAINMENU="Menu główne"
|
||||
SEARCH_FIELD="Pole wyszukiwania"
|
||||
APPS="Programy"
|
||||
APPS_POS="Pokaż programy w..."
|
||||
APPS_MAIN="w menu głównym"
|
||||
APPS_SUB="w podmenu"
|
||||
LEFTPANEL="Lewy panel"
|
||||
RIGHTPANEL="Prawy panel"
|
||||
EXITMENU="Dialog wylogowania"
|
||||
JGBROWSER="Przeglądarka plików/katalogów"
|
||||
SHOW_HIDDEN="Wyświetlanie ukrytych plików"
|
||||
EDIT="Edytuj"
|
||||
FULLHEIGHT="Pełna wysokość"
|
||||
TOP="Góra"
|
||||
CENTER="Na środku"
|
||||
BOTTOM="Dół"
|
||||
MODULES="Moduły"
|
||||
RESET="Przywróć domyślne ustawienia"
|
||||
QUICK_NAV="Szybka nawigacja"
|
||||
BOOKMARKS="Zakładki GTK"
|
||||
VBOXES="Maszyny Wirtualne"
|
||||
PIPEMENUS="Dynamiczne <i>(pipe)</i> menu"
|
||||
DESKMNGR="Desktop Session Manager"
|
||||
DESKTOPS="Pulpity i okna"
|
||||
DESKGRID="SuperClick"
|
||||
POPINSTALL="Instaluj popularne programy"
|
||||
SYSINFO="Informacje o systemie"
|
||||
SHORTCUTS="Skróty klawiszowe"
|
||||
MENUPANELS="Ustawienia Menu/Paneli bocznych"
|
||||
WALLCHANGER="Tapeta"
|
||||
LOCKSCREEN="Blokada ekranu"
|
||||
TINT2="Ustawienia panelu Tint2"
|
||||
CONKY="Ustawienia Conky"
|
||||
SSH_CONN="Połączenia SSH"
|
||||
LOOKANDFEEL="Wygląd"
|
||||
BORDER="Obramowanie"
|
||||
PADDING="Margines wewnętrzny"
|
||||
RADIUS="Zaokrąglone rogi"
|
||||
SUBSPACING="Odstęp submenu"
|
||||
SIDEPANELS_HPOS="Panele boczne pozycja/wysokość"
|
||||
TOPMARGIN="Margines Paneli Góra/Dół"
|
||||
ICONS="Ikony"
|
||||
CIRCLE="Okrągłe ikony (Numix)"
|
||||
SQUARE="Kwadratowe ikony (Numix)"
|
||||
SHOW_ICONS="Pokaż ikony"
|
||||
HIDE_ICONS="Ukryj ikony"
|
||||
INSTALL="Instaluj"
|
||||
SIZE="Rozmiar i czcionka"
|
||||
FONT_FAMILY="Czcionka"
|
||||
FONT_SIZE="Rozmiar czcionki"
|
||||
ITEM_FONT="Element"
|
||||
TITLE_FONT="Tytuł/Separator"
|
||||
INCREASE="Powiększ"
|
||||
DECREASE="Pomniejsz"
|
||||
LINEHEIGHT="Wysokość elementu menu"
|
||||
FONT_CUSTOM="Wybierz czcionkę i rozmiar..."
|
||||
COLOR_SCHEME="Motyw kolorystyczny"
|
||||
GRADIENT="Kierunek Gradientu"
|
||||
EDIT_CURRENT="Edytuj aktywny"
|
||||
FOLLOW_OB="Zgodny z motywem OpenBox"
|
||||
CHOOSE="Wybierz..."
|
||||
RANDTHEME="Losowy"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
;;
|
||||
es*)
|
||||
TITLE="Menu/Panel lateral"
|
||||
MENU_ITEMS="Menu Items"
|
||||
OWN_COMMANDS="Custom Commands"
|
||||
FAVORITES="Favoritos"
|
||||
BELOW_APPS="(Below Apps)"
|
||||
MAINMENU="Main Menu"
|
||||
SEARCH_FIELD="Show Search Field"
|
||||
APPS="Applicationes"
|
||||
APPS_POS="Show Applications in..."
|
||||
APPS_MAIN="Main (root) menu"
|
||||
APPS_SUB="Submenu"
|
||||
LEFTPANEL="Left panel"
|
||||
RIGHTPANEL="Right panel"
|
||||
EXITMENU="Logout Dialog"
|
||||
JGBROWSER="File/Directory Browser"
|
||||
SHOW_HIDDEN="Show hidden files"
|
||||
EDIT="Editar"
|
||||
FULLHEIGHT="Full Height"
|
||||
TOP="TOP"
|
||||
CENTER="Center"
|
||||
BOTTOM="BOTTOM"
|
||||
MODULES="Modules"
|
||||
RESET="Reset to default"
|
||||
QUICK_NAV="Navegación rápida"
|
||||
BOOKMARKS="GTK Marcadores"
|
||||
VBOXES="Virtual Machines"
|
||||
PIPEMENUS="Menu con extras"
|
||||
DESKMNGR="Desktop Session Manager"
|
||||
DESKTOPS="Desktops and Windows"
|
||||
DESKGRID="SuperClick"
|
||||
POPINSTALL="Instalar Programas populares"
|
||||
SYSINFO="System information"
|
||||
SHORTCUTS="Atajos del teclado"
|
||||
MENUPANELS="Menu/Paneles laterales"
|
||||
WALLCHANGER="Wallpaper"
|
||||
LOCKSCREEN="ScreenLocker"
|
||||
TINT2="Tint2 panel settings"
|
||||
CONKY="Conky settings"
|
||||
SSH_CONN="SSH Connections"
|
||||
LOOKANDFEEL="Apariencia"
|
||||
BORDER="Menu Border"
|
||||
PADDING="Padding"
|
||||
RADIUS="Rounded Corners"
|
||||
SIDEPANELS_HPOS="Panels Height/Position"
|
||||
TOPMARGIN="Panels Top/Bottom Margin"
|
||||
SUBSPACING="Submenu Spacing"
|
||||
ICONS="Iconos"
|
||||
CIRCLE="Circilo iconos (Numix)"
|
||||
SQUARE="Cuadrado iconos (Numix)"
|
||||
SHOW_ICONS="Mostrar iconos"
|
||||
HIDE_ICONS="Ocultar iconos"
|
||||
INSTALL="Instalar"
|
||||
SIZE="Tamaño de Menu/Panel lateral"
|
||||
FONT_FAMILY="Familia tipográfica"
|
||||
FONT_SIZE="Tamaño de fuente"
|
||||
ITEM_FONT="Fuente"
|
||||
TITLE_FONT="Titulo/Separador de Fuente"
|
||||
INCREASE="Aumentar"
|
||||
DECREASE="Disminuir"
|
||||
LINEHEIGHT="Altura"
|
||||
FONT_CUSTOM="Seleccionar su fuente y tamaño..."
|
||||
COLOR_SCHEME="Esquema de colores"
|
||||
GRADIENT="Gradient"
|
||||
EDIT_CURRENT="Editar el actual"
|
||||
FOLLOW_OB="Similiar al de Openbox"
|
||||
CHOOSE="Elegir..."
|
||||
RANDTHEME="Random"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
;;
|
||||
*)
|
||||
TITLE="Menu/Panels settings"
|
||||
MENU_ITEMS="Configure Menu Items"
|
||||
OWN_COMMANDS="Custom Commands"
|
||||
FAVORITES="Favorites (on top)"
|
||||
BELOW_APPS="(below Apps)"
|
||||
MAINMENU="Main Menu"
|
||||
SEARCH_FIELD="Show Search Field"
|
||||
APPS="Applications"
|
||||
APPS_POS="Show Applications in..."
|
||||
APPS_MAIN="Main (root) menu"
|
||||
APPS_SUB="Submenu"
|
||||
LEFTPANEL="Left Panel "
|
||||
RIGHTPANEL="Right Panel"
|
||||
EXITMENU="Logout Dialog"
|
||||
JGBROWSER="File/Directory Browser"
|
||||
SHOW_HIDDEN="Show hidden files"
|
||||
EDIT="Edit"
|
||||
FULLHEIGHT="Full Height"
|
||||
TOP="Top"
|
||||
CENTER="Center"
|
||||
BOTTOM="Bottom"
|
||||
MODULES="Modules"
|
||||
RESET="Reset to default"
|
||||
QUICK_NAV="Quick Navigation"
|
||||
BOOKMARKS="GTK Bookmarks"
|
||||
VBOXES="Virtual Machines"
|
||||
PIPEMENUS="Pipe (dynamic) menus"
|
||||
DESKMNGR="Desktop Session Manager"
|
||||
DESKTOPS="Desktops and Windows"
|
||||
DESKGRID="SuperClick"
|
||||
POPINSTALL="Install popular apps"
|
||||
SYSINFO="System information"
|
||||
SHORTCUTS="Keyboard shortcuts"
|
||||
MENUPANELS="Menu/Sidepanels settings"
|
||||
WALLCHANGER="Wallpaper"
|
||||
LOCKSCREEN="ScreenLocker"
|
||||
TINT2="Tint2 panel settings"
|
||||
CONKY="Conky settings"
|
||||
SSH_CONN="SSH Connections"
|
||||
LOOKANDFEEL="Look and Feel"
|
||||
BORDER="Menu Border"
|
||||
PADDING="Padding"
|
||||
RADIUS="Rounded Corners"
|
||||
SUBSPACING="Submenu Spacing"
|
||||
SIDEPANELS_HPOS="Panels Height/Position"
|
||||
TOPMARGIN="Panels Top/Bottom Margin"
|
||||
ICONS="Icons"
|
||||
CIRCLE="Circle icons (Numix)"
|
||||
SQUARE="Square icons (Numix)"
|
||||
SHOW_ICONS="Show icons"
|
||||
HIDE_ICONS="Hide icons"
|
||||
INSTALL="Install"
|
||||
SIZE="Font"
|
||||
FONT_FAMILY="Font Family"
|
||||
FONT_SIZE="Font Size"
|
||||
ITEM_FONT="Item Font"
|
||||
TITLE_FONT="Title/Separator Font"
|
||||
INCREASE="Increase"
|
||||
DECREASE="Decrease"
|
||||
LINEHEIGHT="Item height"
|
||||
FONT_CUSTOM="Select custom font and size..."
|
||||
COLOR_SCHEME="Color Scheme"
|
||||
GRADIENT="Gradient direction"
|
||||
EDIT_CURRENT="Edit current"
|
||||
FOLLOW_OB="Same as OpenBox theme"
|
||||
CHOOSE="Choose..."
|
||||
RANDTHEME="Random"
|
||||
REMOVE="Remove this menu from panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
#me="mb-jgtools $jgtools_last"
|
||||
if [[ $1 == "-r" ]];then
|
||||
me="${0##*/} -s"
|
||||
else
|
||||
me="${0##*/} ${1:--s}"
|
||||
fi
|
||||
|
||||
L="mb-jgtools places"
|
||||
R="mb-jgtools right"
|
||||
|
||||
out+=("^sep($MENU_ITEMS)")
|
||||
out+=("$MAINMENU,^checkout(mainmenu_edit)")
|
||||
out+=("$LEFTPANEL,^checkout(left_edit)")
|
||||
out+=("$RIGHTPANEL,^checkout(right_edit)")
|
||||
out+=("$EXITMENU,^checkout(exit_edit)")
|
||||
#out+=("^sep($JGBROWSER)")
|
||||
#[[ $jgbrowser_show_hidden = false ]] && out+=("<i><s>$SHOW_HIDDEN</s></i>,mb-setvar jgbrowser_show_hidden=true;$me") || out+=("$SHOW_HIDDEN,mb-setvar jgbrowser_show_hidden=false;$me")
|
||||
|
||||
out2+=("^tag(mainmenu_edit)")
|
||||
out2+=("^sep($MAINMENU)")
|
||||
if [[ $search_field = "false" ]];then
|
||||
out2+=("<big></big> $SEARCH_FIELD,mb-setvar search_field=true;mb-jgtools main ipc")
|
||||
else
|
||||
out2+=("<big></big> $SEARCH_FIELD,mb-setvar search_field=false;mb-jgtools main ipc")
|
||||
fi
|
||||
out2+=(" $EDIT $FAVORITES, xdg-open $HOME/.config/mabox/favorites.csv, geany")
|
||||
out2+=(" $EDIT $BELOW_APPS, xdg-open $HOME/.config/mabox/mainmenu_below_apps.csv, geany")
|
||||
out2+=("^sep($APPS_POS)")
|
||||
[[ $apps_in_submenu == "true" ]] && out2+=("祿 $APPS_MAIN,mb-setvar apps_in_submenu=false;mb-jgtools main ipc" " $APPS_SUB,") || out2+=(" $APPS_MAIN," "祿 $APPS_SUB,mb-setvar apps_in_submenu=true;mb-jgtools main ipc")
|
||||
out2+=("^sep(Reset)")
|
||||
out2+=("$RESET,mb-reset mainmenu")
|
||||
out2+=("^tag(left_edit)")
|
||||
out2+=("^sep($LEFTPANEL)")
|
||||
out2+=("$EDIT $OWN_COMMANDS ($TOP), xdg-open $HOME/.config/mabox/places-prepend.csv, geany")
|
||||
|
||||
#out2+=("^sep()")
|
||||
out2+=("^sep($MODULES)")
|
||||
|
||||
[[ $places_quicknav == false ]] && out2+=("<i><s>$QUICK_NAV</s></i>,mb-setvar places_quicknav=true;$L") || out2+=("$QUICK_NAV,mb-setvar places_quicknav=false;$L")
|
||||
[[ $places_bookmarks == false ]] && out2+=("<i><s>$BOOKMARKS</s></i>,mb-setvar places_bookmarks=true;$L") || out2+=("$BOOKMARKS,mb-setvar places_bookmarks=false;$L")
|
||||
if [[ -x "$(command -v VBoxManage)" ]]; then
|
||||
[[ $places_vboxes == false ]] && out2+=("<i><s>$VBOXES</s></i>,mb-setvar places_vboxes=true;$L") || out2+=("$VBOXES,mb-setvar places_vboxes=false;$L")
|
||||
fi
|
||||
|
||||
out2+=("^sep($PIPEMENUS)")
|
||||
[[ $places_menusettingspipe = false ]] && out2+=("<i><s>$MENUPANELS</s></i>,mb-setvar places_menusettingspipe=true;$L") || out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=false;$L")
|
||||
[[ $places_jgwallpaperchanger = false ]] && out2+=("<i><s>$WALLCHANGER</s></i>,mb-setvar places_jgwallpaperchanger=true;$L") || out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=false;$L")
|
||||
[[ $places_jglockscreen = false ]] && out2+=("<i><s>$LOCKSCREEN</s></i>,mb-setvar places_jglockscreen=true;$L") || out2+=("$LOCKSCREEN,mb-setvar places_jglockscreen=false;$L")
|
||||
[[ $places_jgdesktops = false ]] && out2+=("<i><s>$DESKTOPS</s></i>,mb-setvar places_jgdesktops=true;$L") || out2+=("$DESKTOPS,mb-setvar places_jgdesktops=false;$L")
|
||||
[[ $places_jgdeskmngr = false ]] && out2+=("<i><s>$DESKMNGR</s></i>,mb-setvar places_jgdeskmngr=true;$L") || out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=false;$L")
|
||||
[[ $places_jgdeskgrid = false ]] && out2+=("<i><s>$DESKGRID</s></i>,mb-setvar places_jgdeskgrid=true;$L") || out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=false;$L")
|
||||
[[ $places_sysinfopipe = false ]] && out2+=("<i><s>$SYSINFO</s></i>,mb-setvar places_sysinfopipe=true;$L") || out2+=("$SYSINFO,mb-setvar places_sysinfopipe=false;$L")
|
||||
#[[ $places_keyspipe = false ]] && out2+=("<i><s>$SHORTCUTS</s></i>,mb-setvar places_keyspipe=true;$L") || out2+=("$SHORTCUTS,mb-setvar places_keyspipe=false;$L")
|
||||
[[ $places_sshpipe = false ]] && out2+=("<i><s>$SSH_CONN</s></i>,mb-setvar places_sshpipe=true;$L") || out2+=("$SSH_CONN,mb-setvar places_sshpipe=false;$L")
|
||||
[[ $places_softwarepipe = false ]] && out2+=("<i><s>$POPINSTALL</s></i>,mb-setvar places_softwarepipe=true;$L") || out2+=("$POPINSTALL,mb-setvar places_softwarepipe=false;$L")
|
||||
|
||||
[[ $places_tint2pipe = false ]] && out2+=("<i><s>$TINT2</s></i>,mb-setvar places_tint2pipe=true;$L") || out2+=("$TINT2,mb-setvar places_tint2pipe=false;$L")
|
||||
[[ $places_conkypipe = false ]] && out2+=("<i><s>$CONKY</s></i>,mb-setvar places_conkypipe=true;$L") || out2+=("$CONKY,mb-setvar places_conkypipe=false;$L")
|
||||
|
||||
out2+=("^sep()")
|
||||
out2+=("$EDIT $OWN_COMMANDS ($BOTTOM), xdg-open $HOME/.config/mabox/places-append.csv, geany")
|
||||
out2+=("^sep(Reset)")
|
||||
out2+=("$RESET,mb-reset leftpanel")
|
||||
|
||||
out2+=("^tag(right_edit)")
|
||||
out2+=("^sep($RIGHTPANEL)")
|
||||
out2+=("$EDIT $OWN_COMMANDS ($TOP), xdg-open $HOME/.config/mabox/right-prepend.csv, geany")
|
||||
out2+=("$EDIT $OWN_COMMANDS ($BOTTOM), xdg-open $HOME/.config/mabox/right-append.csv, geany")
|
||||
out2+=("^sep(Reset)")
|
||||
out2+=("$RESET,mb-reset rightpanel")
|
||||
|
||||
out2+=("^tag(exit_edit)")
|
||||
out2+=("^sep($EXITMENU)")
|
||||
out2+=("$EDIT $EXITMENU, xdg-open $HOME/.config/mabox/exit.csv, geany")
|
||||
out2+=("^sep(Reset)")
|
||||
out2+=("$RESET,mb-reset logout")
|
||||
|
||||
|
||||
##
|
||||
out+=("^sep($LOOKANDFEEL)")
|
||||
out+=("$SIDEPANELS_HPOS [ <b>${panels_heightpos:-center}</b> ],^checkout(sidepanelpos)")
|
||||
|
||||
|
||||
|
||||
out2+=("^tag(topmargin)")
|
||||
for i in 0 20 30 40 50 60 80 100 120 160 200; do out2+=("$(printf "<tt>%4s</tt>,%s" "$i" "mb-setvar panels_topmargin=${i};$me")");done
|
||||
#for i in 0 20 30 40 50 60 80 100; do out2+=("${i},mb-setvar panels_topmargin=${i};$me");done
|
||||
|
||||
out2+=("^tag(sidepanelpos)")
|
||||
out2+=("^sep($SIDEPANELS_HPOS)")
|
||||
out2+=("$FULLHEIGHT,mb-setvar panels_heightpos=full;$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("$TOP,mb-setvar panels_heightpos=top;$me")
|
||||
out2+=("$CENTER,mb-setvar panels_heightpos=center;$me")
|
||||
out2+=("$BOTTOM,mb-setvar panels_heightpos=bottom;$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("$TOPMARGIN [ <b>${panels_topmargin:-0}</b> ],^checkout(topmargin)")
|
||||
|
||||
|
||||
# FONTS
|
||||
out+=("^sep(<i>$SIZE</i>)")
|
||||
out+=("<big></big> $ITEM_FONT [ <b>$menu_font_family $menu_font_size</b> ],^checkout(itemfont)")
|
||||
out+=("<big></big> $TITLE_FONT [ <b>$menu_sep_font_family $menu_sep_font_size</b> ],^checkout(titlefont)")
|
||||
#out+=("$FONT_FAMILY [ <b>${menu_font_family:-0}</b> ],^checkout(fonty)")
|
||||
#out+=("$FONT_SIZE [ <b>${menu_font_size:-0}</b> ],^checkout(fontsize)")
|
||||
out+=("$LINEHEIGHT [ <b>$item_height_factor%</b> ],^checkout(lineheight)")
|
||||
|
||||
case $menu_font_family in
|
||||
"Noto Sans Light") nol="";;
|
||||
"Noto Sans Medium") nom="";;
|
||||
Deja*) de="";;
|
||||
Robo*) ro="";;
|
||||
Inco*) in="";;
|
||||
Ubunt*) ub="";;
|
||||
*);;
|
||||
esac
|
||||
|
||||
out2+=("^tag(itemfont)")
|
||||
out2+=("^sep($ITEM_FONT)")
|
||||
out2+=("<big></big> $FONT_CUSTOM,mb-setfont menu_item;$me")
|
||||
out2+=("^sep()")
|
||||
|
||||
if [ -f "$HOME/.config/mabox/fonts.list" ];then
|
||||
mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list)
|
||||
else
|
||||
mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list)
|
||||
cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/
|
||||
fi
|
||||
|
||||
if [ "${#favfonts[@]}" -gt 0 ];then
|
||||
out2+=("^sep($FONT_FAMILY)")
|
||||
for fon in "${favfonts[@]}";do
|
||||
[[ "$menu_font_family" == "$fon" ]] && out2+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_font_family='${fon}'\";$me")
|
||||
done
|
||||
fi
|
||||
out2+=("^sep()")
|
||||
out2+=("<small> Edit favorited fonts list</small>,geany ~/.config/mabox/fonts.list")
|
||||
out2+=("^sep($FONT_SIZE)")
|
||||
out2+=("<big></big> $INCREASE <b>$((menu_font_size+1)) px</b>,mb-setvar menu_font_size=$((menu_font_size+1));$me")
|
||||
out2+=("<big></big> $DECREASE <b>$((menu_font_size-1)) px</b>,mb-setvar menu_font_size=$((menu_font_size-1));$me")
|
||||
out2+=("^sep()")
|
||||
sizes=(14 13 12 11 10 9 8)
|
||||
for i in "${sizes[@]}"
|
||||
do
|
||||
[[ "$menu_font_size" == "$i" ]] && out2+=("<big>綠</big> <b>$i px</b>,$me") || out2+=("<big>祿</big> $i px,mb-setvar menu_font_size=$i;$me")
|
||||
done
|
||||
|
||||
|
||||
out2+=("^tag(titlefont)")
|
||||
out2+=("^sep($TITLE_FONT)")
|
||||
out2+=("<big></big> $FONT_CUSTOM,mb-setfont menu_sep;$me")
|
||||
out2+=("^sep()")
|
||||
|
||||
if [ "${#favfonts[@]}" -gt 0 ];then
|
||||
out2+=("^sep($FONT_FAMILY)")
|
||||
for fon in "${favfonts[@]}";do
|
||||
[[ "$menu_sep_font_family" == "$fon" ]] && out2+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,mb-setvar \"menu_sep_font_family='${fon}'\";$me")
|
||||
done
|
||||
fi
|
||||
out2+=("^sep()")
|
||||
out2+=("<small> Edit favorited fonts list</small>,geany ~/.config/mabox/fonts.list")
|
||||
out2+=("^sep($FONT_SIZE)")
|
||||
out2+=("<big></big> $INCREASE <b>$((menu_sep_font_size+1)) px</b>,mb-setvar menu_sep_font_size=$((menu_sep_font_size+1));$me")
|
||||
out2+=("<big></big> $DECREASE <b>$((menu_sep_font_size-1)) px</b>,mb-setvar menu_sep_font_size=$((menu_sep_font_size-1));$me")
|
||||
out2+=("^sep()")
|
||||
sizes=(14 13 12 11 10 9 8)
|
||||
for i in "${sizes[@]}"
|
||||
do
|
||||
[[ "$menu_sep_font_size" == "$i" ]] && out2+=("<big>綠</big> <b>$i px</b>,$me") || out2+=("<big>祿</big> $i px,mb-setvar menu_sep_font_size=$i;$me")
|
||||
done
|
||||
|
||||
out2+=("^tag(lineheight)")
|
||||
for i in 160 180 200 240 280 300 400; do out2+=("$(printf "<tt>%4s%%</tt>,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done
|
||||
|
||||
########## THEMES
|
||||
out+=("^sep(<i>$COLOR_SCHEME</i>)")
|
||||
|
||||
out+=("$CHOOSE ,^checkout(motywy)")
|
||||
out+=("$RANDTHEME,jgctl randomscheme;$me")
|
||||
out2+=("^tag(motywy)")
|
||||
|
||||
for item in /usr/share/mb-jgtools/jgobthemes/*colorrc; do
|
||||
theme="${item##*/}"
|
||||
#notify-send.sh "th" "$item"
|
||||
out2+=("${theme%.*},jgctl applyoldscheme ${item};$me")
|
||||
done
|
||||
|
||||
########## ICONS
|
||||
out+=("^sep(<i>$ICONS</i>)")
|
||||
if [ $jgmenu_use_icons == true ]; then
|
||||
out+=("$HIDE_ICONS [ <b>${jgmenu_icon_theme}</b> ],mb-setvar jgmenu_use_icons=false;$me")
|
||||
else
|
||||
out+=("$SHOW_ICONS [ <b>${jgmenu_icon_theme}</b> ],mb-setvar jgmenu_use_icons=true;$me")
|
||||
fi
|
||||
out+=("^sep()")
|
||||
out+=("$SQUARE,mb-setvar jgmenu_icon_theme=Numix-Square;mb-setvar jgmenu_use_icons=true;$me")
|
||||
out+=("$CIRCLE,mb-setvar jgmenu_icon_theme=Numix-Circle;mb-setvar jgmenu_use_icons=true;$me")
|
||||
if [ -d /usr/share/icons/BeautyLine ];then
|
||||
out+=("BeautyLine,mb-setvar jgmenu_icon_theme=BeautyLine;mb-setvar jgmenu_use_icons=true;$me")
|
||||
else
|
||||
out+=("$INSTALL BeautyLine icons, pamac-installer beautyline")
|
||||
fi
|
||||
if [ -d /usr/share/icons/Papirus ];then
|
||||
out+=("Papirus,mb-setvar jgmenu_icon_theme=Papirus;mb-setvar jgmenu_use_icons=true;$me")
|
||||
else
|
||||
out+=("$INSTALL Papirus icons, pamac-installer papirus-icon-theme")
|
||||
fi
|
||||
if [ -d /usr/share/icons/Sardi-Arc ];then
|
||||
out+=("^sep()")
|
||||
out+=("Sardi,^checkout(sardi)")
|
||||
out2+=("^tag(sardi)")
|
||||
out2+=("Sardi,mb-setvar jgmenu_icon_theme=Sardi;mb-setvar jgmenu_use_icons=true;$me")
|
||||
out2+=("Sardi-Orb-Colora,mb-setvar jgmenu_icon_theme=Sardi-Orb-Colora;mb-setvar jgmenu_use_icons=true;$me")
|
||||
out2+=("Sardi-Flat,mb-setvar jgmenu_icon_theme=Sardi-Flat;mb-setvar jgmenu_use_icons=true;$me")
|
||||
out2+=("Sardi-Flexible,mb-setvar jgmenu_icon_theme=Sardi-Flexible;mb-setvar jgmenu_use_icons=true;$me")
|
||||
out2+=("Sardi-Mono,mb-setvar jgmenu_icon_theme=Sardi-Mono;mb-setvar jgmenu_use_icons=true;$me")
|
||||
else
|
||||
out+=("^sep()")
|
||||
out+=("$INSTALL Sardi icons, pamac-installer sardi-icons")
|
||||
fi
|
||||
out+=("^sep(Colorizer)")
|
||||
out+=("Colorizer - Menu,colorizer-menus -s")
|
||||
|
||||
|
||||
|
||||
### RUN
|
||||
|
||||
#if [[ $1 == "-s" ]]; then
|
||||
if [[ $1 == "-s" || $1 == "-c" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
out+=("^sep()")
|
||||
case "$1" in
|
||||
-s) out+=(" ${arrow_string_left} $LEFTPANEL,mb-jgtools places");;
|
||||
-c) out+=(" ${arrow_string_left} Colorizer,colorizer -s");;
|
||||
esac
|
||||
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=40
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
|
||||
#TEMP POSITION:
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y="60"
|
||||
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
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()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_menusettingspipe=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
178
usr/bin/jgpicom-pipe
Executable file
178
usr/bin/jgpicom-pipe
Executable file
@@ -0,0 +1,178 @@
|
||||
#!/bin/bash
|
||||
# jgpicom-pipe - pipemenu to start, stop, restart Picom and manage Picom configs (WIP)
|
||||
# Copyright (C) 2020-2026 Daniel Napora <danieln@maboxlinux.org>
|
||||
|
||||
|
||||
|
||||
. "$HOME/.config/mabox/mabox.conf"
|
||||
backend=${picom_renderer:-glx}
|
||||
|
||||
CONFDIR="$HOME/.config/picom/configs"
|
||||
CONFFILE="$HOME/.config/picom.conf"
|
||||
|
||||
mkdir -p "$CONFDIR"
|
||||
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
ENABLE="Włącz Kompozytora"
|
||||
RESTART="Restartuj Kompozytora"
|
||||
DISABLE="Wyłącz Kompozytora"
|
||||
CHOOSE="Wybierz plik konfiguracyjny"
|
||||
DEVNULL="/dev/null <i>(brak)</i>"
|
||||
EDIT_TITLE="Edytuj ustawienia Picom"
|
||||
EDIT="Edytuj plik ustawień Kompozytora"
|
||||
OPENDIR="Otwórz katalog <i>~/.config/picom/configs</i>"
|
||||
RENDERER="Rendering Backend"
|
||||
GLX="<b>glx</b> <i>(zalecany)</i>"
|
||||
XRENDER="<b>xrender</b> <i>(dla starszego sprzętu)</i>"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> - menu główne"
|
||||
_LEFTSIDEPANEL="Lewy panel boczny"
|
||||
;;
|
||||
es*)
|
||||
ENABLE="Activar Compositor"
|
||||
RESTART="Reiniciar Compositor"
|
||||
DISABLE="Desactivar Compositor"
|
||||
CHOOSE="Elegir el archivo de configuración"
|
||||
DEVNULL="/dev/null"
|
||||
EDIT_TITLE="Editar..."
|
||||
EDIT="Editar archivo de ajustes del Compositor"
|
||||
OPENDIR="Abrir la carpeta <i>~/.config/picom/configs</i>"
|
||||
RENDERER="Rendering Backend"
|
||||
GLX="<b>glx</b> <i>(recommended)</i>"
|
||||
XRENDER="<b>xrender</b> <i>(for older hardware)</i>"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
|
||||
_LEFTSIDEPANEL="Left Sidepanel"
|
||||
;;
|
||||
*)
|
||||
ENABLE="Start Compositor"
|
||||
RESTART="Restart Compositor"
|
||||
DISABLE="Stop Compositor"
|
||||
CHOOSE="Choose config file"
|
||||
DEVNULL="/dev/null <i>(none)</i>"
|
||||
EDIT_TITLE="Edit Compositor settings"
|
||||
EDIT="Edit Compositor settings file"
|
||||
OPENDIR="Open <i>~/.config/picom/configs</i> dir"
|
||||
RENDERER="Rendering Backend"
|
||||
GLX="<b>glx</b> <i>(recommended)</i>"
|
||||
XRENDER="<b>xrender</b> <i>(for older hardware)</i>"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
|
||||
_LEFTSIDEPANEL="Left Sidepanel"
|
||||
;;
|
||||
esac
|
||||
|
||||
me="jgpicom-pipe -s"
|
||||
|
||||
out+=("^sep(Picom)")
|
||||
if ! pidof picom > /dev/null; then
|
||||
out+=(" $ENABLE,mabox-compositor --start;${me}")
|
||||
|
||||
else
|
||||
out+=(" $RESTART,mabox-compositor --restart;${me}")
|
||||
out+=(" $DISABLE,mabox-compositor --stop;${me}")
|
||||
|
||||
fi
|
||||
out+=("^sep($RENDERER)")
|
||||
[[ "$backend" == "glx" ]] && out+=("<big>綠</big> $GLX" "<big>祿</big> $XRENDER,mb-setvar picom_renderer=xrender;mabox-compositor --restart;${me}") || out+=("<big>祿</big> $GLX,mb-setvar picom_renderer=glx;mabox-compositor --restart;${me}" "<big>綠</big> $XRENDER")
|
||||
|
||||
out+=("^sep($CHOOSE)")
|
||||
|
||||
if [ "$(readlink $CONFFILE)" -ef "/dev/null" ];then
|
||||
out+=("<big>綠</big> <u><b>$DEVNULL</b></u>")
|
||||
else
|
||||
out+=("<big>祿</big> $DEVNULL,ln -sf /dev/null $CONFFILE;mabox-compositor --restart;${me}")
|
||||
fi
|
||||
|
||||
for item in "$CONFDIR"/*.conf; do
|
||||
if [ -f "$item" ];then
|
||||
if [ "$(readlink $CONFFILE)" -ef "$item" ];then
|
||||
out+=("<big>綠</big> <u><b>${item##*/}</b></u>")
|
||||
else
|
||||
out+=("<big>祿</big> ${item##*/},ln -sf $item $CONFFILE;mabox-compositor --restart;${me}")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
out+=("^sep($EDIT_TITLE)")
|
||||
if [ -f "$CONFFILE" ];then
|
||||
if [ ! "$(readlink $CONFFILE)" -ef "/dev/null" ];then
|
||||
out+=(" $EDIT,xdg-open $CONFFILE")
|
||||
fi
|
||||
fi
|
||||
out+=(" $OPENDIR,exo-open --launch FileManager $CONFDIR")
|
||||
|
||||
|
||||
|
||||
|
||||
if [[ "$1" == "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
|
||||
|
||||
CNF_DIR="$HOME/.config/colorizer"
|
||||
CNF_FILE="$CNF_DIR/colorizer.conf"
|
||||
source "$CNF_FILE"
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" ${arrow_string_left} $_COLORIZER_ROOT,colorizer -s")
|
||||
out+=(" ${arrow_string_left} ${arrow_string_left} $_LEFTSIDEPANEL,mb-jgtools places")
|
||||
|
||||
if [[ "$colorizer_size" == "full" ]];then
|
||||
eval $(xdotool getdisplaygeometry --shell)
|
||||
MENU_HEIGHT_MIN="$HEIGHT"
|
||||
MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
|
||||
jgtools_radius=0
|
||||
menu_margin_x="0"
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
fi
|
||||
|
||||
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
||||
MENU_PADDING_TOP=$((jgtools_padding + 150))
|
||||
|
||||
#WALLPAPER
|
||||
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2)
|
||||
THUMBDIR="$HOME/.cache/colorizer/thumbs"
|
||||
mkdir -p ${THUMBDIR}
|
||||
NAME=${WALLPATH////_}
|
||||
if [[ "${NAME}" =~ ^_home_.* ]]; then
|
||||
n=${#HOME}
|
||||
((n++))
|
||||
NAME=${NAME:${n}}
|
||||
fi
|
||||
THUMB="${THUMBDIR}/${NAME}.png"
|
||||
if [[ ! -f "$THUMB" ]]
|
||||
then
|
||||
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
|
||||
fi
|
||||
|
||||
mkconfigfile
|
||||
|
||||
[[ "$GR" == "1" ]] && clr=${GR_FROM} || clr=${FG}
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
@rect,,$((jgtools_padding+4)),$((jgtools_padding + 116)),262,28,0,left,top,#222222 20,#222222 70,
|
||||
@icon,,$((jgtools_padding+4)),$((jgtools_padding+82)),64,64,4,left,top,,,/usr/share/icons/hicolor/scalable/apps/compton.svg
|
||||
#@text,,$((jgtools_padding + 10)),$((jgtools_padding + 106)),100,28,0,left,top,#FFFFFF ,${WINCLR},<span size='41600' font_family='Ubuntu'><big></big></span>
|
||||
@text,,$((jgtools_padding + 88)),$((jgtools_padding + 116)),180,28,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'>Mabox <b>Compositor</b> settings</span>
|
||||
|
||||
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
|
||||
printf '%s\n' "${out[@]}"
|
||||
|
||||
88
usr/bin/jgsoftware-pipe
Executable file
88
usr/bin/jgsoftware-pipe
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
declare -a Internet=(chromium palemoon thunderbird filezilla deluge discord telegram-desktop rustdesk-bin)
|
||||
declare -a Multimedia=(kodi vlc obs-studio audacious smplayer)
|
||||
declare -a Grafika=(gimp inkscape blender scribus)
|
||||
declare -a Gry=(0ad warzone2100 wesnoth steam lutris )
|
||||
declare -a Biuro=(abiword gnumeric)
|
||||
declare -a Ebook=(calibre fbreader)
|
||||
declare -a Backup=(timeshift)
|
||||
declare -a Wirtualizacja=(virtualbox gnome-boxes)
|
||||
declare -a categories=(Internet Multimedia Grafika Biuro Ebook Gry Backup Wirtualizacja)
|
||||
INSTALL="Instaluj"
|
||||
LAUNCH="Uruchom"
|
||||
TITLE="Popularne programy"
|
||||
INSTALL_PRINT="Instaluj manjaro printer"
|
||||
CONFIGURE_PRINT="Konfiguracja drukarek"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
;;
|
||||
es*)
|
||||
declare -a Internet=(chromium palemoon thunderbird filezilla deluge discord telegram-desktop rustdesk-bin)
|
||||
declare -a Multimedia=(kodi vlc obs-studio audacious smplayer)
|
||||
declare -a Graficos=(gimp inkscape blender scribus)
|
||||
declare -a Juegos=(0ad warzone2100 wesnoth steam lutris)
|
||||
declare -a Oficina=(abiword gnumeric)
|
||||
declare -a LibrosE=(calibre fbreader)
|
||||
declare -a Respaldo=(timeshift)
|
||||
declare -a Virtualizacion=(virtualbox gnome-boxes)
|
||||
declare -a categories=(Internet Multimedia Graficos Juegos Oficina LibrosE Respaldo Virtualizacion)
|
||||
INSTALL="Instalar"
|
||||
LAUNCH="Abrir"
|
||||
TITLE="Programas populares"
|
||||
INSTALL_PRINT="Instalar soporte de impresión"
|
||||
CONFIGURE_PRINT="Configurar impresoras"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
;;
|
||||
*)
|
||||
declare -a Internet=(chromium palemoon thunderbird filezilla deluge discord telegram-desktop rustdesk-bin)
|
||||
declare -a Multimedia=(kodi vlc obs-studio audacious smplayer)
|
||||
declare -a Graphics=(gimp inkscape blender scribus)
|
||||
declare -a Games=(0ad warzone2100 wesnoth steam lutris)
|
||||
declare -a Office=(abiword gnumeric)
|
||||
declare -a Ebook=(calibre fbreader)
|
||||
declare -a Backup=(timeshift)
|
||||
declare -a Virtualization=(virtualbox gnome-boxes)
|
||||
declare -a categories=(Internet Multimedia Graphics Office Ebook Games Backup Virtualization)
|
||||
INSTALL="Install"
|
||||
LAUNCH="Launch"
|
||||
TITLE="Popular programs"
|
||||
INSTALL_PRINT="Install Printing Support"
|
||||
CONFIGURE_PRINT="Configure Printers"
|
||||
REMOVE="Remove this menu from panel"
|
||||
;;
|
||||
esac
|
||||
menus+=("^sep($TITLE)")
|
||||
# Printing
|
||||
if type 'system-config-printer' &> /dev/null; then
|
||||
menus+=("$CONFIGURE_PRINT,gksu system-config-printer")
|
||||
else
|
||||
menus+=("$INSTALL_PRINT,pamac-installer manjaro-printer")
|
||||
fi
|
||||
menus+=("^sep()")
|
||||
|
||||
# All categories
|
||||
for group in "${categories[@]}"; do
|
||||
lst="$group[@]"
|
||||
menus+=("${group},^checkout(${group})")
|
||||
lines+=("^tag(${group})")
|
||||
for element in "${!lst}"; do
|
||||
if ! type "$element" &> /dev/null; then
|
||||
lines+=("$INSTALL ${element^},pamac-installer $element")
|
||||
else
|
||||
lines+=("$LAUNCH ${element^},$element")
|
||||
fi
|
||||
done
|
||||
|
||||
done
|
||||
menus+=("^sep()")
|
||||
|
||||
printf '%s\n' "${menus[@]}"
|
||||
if [ $1 == "-r" ]; then
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_softwarepipe=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${lines[@]}"
|
||||
#echo "grafika,^checkout(grafika)"
|
||||
#echo -e "^tag(grafika)\ngimp,czy\nblender\ninkscap"
|
||||
|
||||
111
usr/bin/jgssh
Executable file
111
usr/bin/jgssh
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/bin/bash
|
||||
# Daniel Napora 2021 <napcok@gmail.com>
|
||||
#: jgssh - pipemenu for connecting to hosts defined in ~/.ssh/config
|
||||
#: Usage: jgssh ( )
|
||||
#:
|
||||
#:
|
||||
case $LANG in
|
||||
pl*)
|
||||
SSH_CONN="Połączenia SSH"
|
||||
CONNECT="Połącz z"
|
||||
TERM="Terminal"
|
||||
FM="Menadżer plików"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
EDIT="Edytuj"
|
||||
;;
|
||||
es*)
|
||||
SSH_CONN="Hosts SSH"
|
||||
CONNECT="Conectar a"
|
||||
TERM="Terminal"
|
||||
FM="Gestor de archivos"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
EDIT="Editar"
|
||||
;;
|
||||
*)
|
||||
SSH_CONN="SSH hosts"
|
||||
CONNECT="Connect to"
|
||||
TERM="Terminal"
|
||||
FM="File Manager"
|
||||
REMOVE="Remove this menu from panel"
|
||||
EDIT="Edit"
|
||||
;;
|
||||
esac
|
||||
mkdir -p "$HOME/.ssh"
|
||||
|
||||
__usage() {
|
||||
grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done
|
||||
exit
|
||||
}
|
||||
|
||||
__mklist() {
|
||||
hostlist=$(sed -ne 's/^[[:blank:]]*[Hh][Oo][Ss][Tt][[:blank:]]\{1,\}\([^#*?%]*\)\(#.*\)\{0,1\}$/\1/p' ~/.ssh/config)
|
||||
out+=("^sep($SSH_CONN)")
|
||||
for host in $hostlist;
|
||||
do
|
||||
out+=("$host,^checkout($host)")
|
||||
out2+=("^tag($host)")
|
||||
out2+=("^sep($CONNECT $host)")
|
||||
out2+=("<big></big> $TERM,^term(ssh $host)")
|
||||
out2+=(" $FM,pcmanfm $HOME sftp://$host/")
|
||||
done
|
||||
out+=("^sep()")
|
||||
out+=("$EDIT <i>~/.ssh/config</i>, xdg-open $HOME/.ssh/config")
|
||||
}
|
||||
|
||||
__removable() {
|
||||
__mklist
|
||||
out+=("^sep()")
|
||||
out+=("<i>$REMOVE</i>,mb-setvar places_sshpipe=false;mb-jgtools places")
|
||||
__ret
|
||||
}
|
||||
|
||||
__standalone() {
|
||||
__mklist
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
menu_margin_x=${submenu_spacing:-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
|
||||
|
||||
}
|
||||
|
||||
__ret() {
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
"-r") __removable ;;
|
||||
"-s") __standalone ;;
|
||||
"-h"|"--help") __usage ;;
|
||||
*) __usage ;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
158
usr/bin/jgsysinfo-pipe
Executable file
158
usr/bin/jgsysinfo-pipe
Executable file
@@ -0,0 +1,158 @@
|
||||
#!/bin/bash
|
||||
# jgsysinfo-pipe - native jgmenu pipemenu with some system informations
|
||||
#
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
KERNEL="Jądro:"
|
||||
PKGS="Zainstalowane pakiety:"
|
||||
RESOLUTION="Rozdzielczość:"
|
||||
DF_HEADER="System plików ~~ Typ ~~ Rozmiar ~ Użyte ~ Wolne ~ % ~ Punkt mont."
|
||||
CPU_RAM="CPU ~ RAM ~ Swap | Użyte/Całość"
|
||||
NETWORK="Sieć"
|
||||
DOWNLOADED="pobrano"
|
||||
UPLOADED="wysłano"
|
||||
DATETIME="Data ~ Godzina"
|
||||
DATE="Data:"
|
||||
WEEK="Tydzień:"
|
||||
DAY="Dzień:"
|
||||
TIME="Godzina:"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
;;
|
||||
es*)
|
||||
KERNEL="Kernel"
|
||||
PKGS="Paquetes instalados:"
|
||||
RESOLUTION="Resolución:"
|
||||
DF_HEADER="S.ficheros ~ Tipo ~ Tamaño ~ Usados ~ Disp ~ % ~ Montado en"
|
||||
CPU_RAM="CPU ~ RAM ~ Swap | Usados/Tamaño"
|
||||
NETWORK="Red"
|
||||
DOWNLOADED="downloaded"
|
||||
UPLOADED="uploaded"
|
||||
DATETIME="Fecha ~ Hora"
|
||||
DATE="Fecha:"
|
||||
WEEK="Semana:"
|
||||
DAY="Día:"
|
||||
TIME="Hora:"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
;;
|
||||
*)
|
||||
KERNEL="Kernel:"
|
||||
PKGS="Installed pkgs:"
|
||||
RESOLUTION="Resolution:"
|
||||
DF_HEADER="Filesystem ~~ Type ~~ Total ~ Used ~ Free ~ % ~ Mount"
|
||||
CPU_RAM="CPU ~ RAM ~ Swap | Used/Total "
|
||||
NETWORK="Network"
|
||||
DOWNLOADED="downloaded"
|
||||
UPLOADED="uploaded"
|
||||
DATETIME="Date ~ Time"
|
||||
DATE="Data:"
|
||||
WEEK="Week:"
|
||||
DAY="Day:"
|
||||
TIME="Time:"
|
||||
REMOVE="Remove this menu from panel"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
Host=$(uname -n)
|
||||
System=$(uname -s)
|
||||
Release=$(uname -r)
|
||||
Arch=$(uname -m)
|
||||
Lsb_rel=$(lsb_release -rs)
|
||||
Lsb_code=$(lsb_release -cs)
|
||||
NetworkDevice1=$(ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//")
|
||||
|
||||
#NetDev1ip=$(ip address | grep '192.168' | awk '{ print $2}' | sed s:\/.*::g)
|
||||
NetDev1ip=$(ip address | grep "$NetworkDevice1$" | awk '{ print $2}' | sed s:\/.*::g)
|
||||
NetDev1down=$(/sbin/ifconfig "$NetworkDevice1" | grep "RX packets" |awk '{print $6,$7}')
|
||||
NetDev1up=$(/sbin/ifconfig "$NetworkDevice1" | grep "TX packets" |awk '{print $6,$7}' )
|
||||
|
||||
MemTotal=$(echo "scale = 2; ("$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
|
||||
MemFree=$(echo "scale = 2; ("$(grep MemFree: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) + ("$(grep -m 1 Cached: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
|
||||
MemUsed=$(echo "scale = 2; ("$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) - (("$(grep MemFree: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) + ("$(grep -m 1 Cached: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024))" | bc)
|
||||
|
||||
SwpTotal=$(echo "scale = 2; ("$(grep SwapTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
|
||||
SwpFree=$(echo "scale = 2; ("$(grep SwapFree: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
|
||||
SwpUsed=$(echo "scale = 2; ("$(grep SwapTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) - ("$(cat /proc/meminfo | grep SwapFree: | awk '{print $2}' | sed 's/k//')" /1024)" | bc)
|
||||
|
||||
MemUsedPercent=$(echo "scale = 2; (("$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) - (("$(grep MemFree: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) + ("$(grep -m 1 Cached: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024))) / ("$(cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)
|
||||
SwpUsedPercent=$(echo "scale = 2; (("$(grep SwapTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) - ("$(grep SwapFree: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024)) / ("$(grep SwapTotal: /proc/meminfo | awk '{print $2}' | sed 's/k//')" /1024) *100" | bc)
|
||||
|
||||
CPUmodel=$(grep -m 1 "model name" /proc/cpuinfo | sed 's/.*: //')
|
||||
CPUfreq=$(grep -m 1 "cpu MHz" /proc/cpuinfo | sed 's/.*: //')
|
||||
CPUcache=$(grep -m 1 "cache size" /proc/cpuinfo | sed 's/.*: //')
|
||||
|
||||
DateDate=$(date '+Date ~ %Y.%m.%d. (%a)')
|
||||
DateWeek=$(date '+Week ~ %W')
|
||||
DateDay=$(date '+ Day ~ %j')
|
||||
DateTime=$(date '+Time ~ %H:%M [%Z]')
|
||||
UpTime=$(uptime | sed 's/.* up //' | sed 's/[0-9]* us.*//' | sed 's/ day, /d/' | sed 's/ days, /d /' | sed 's/:/h /' | sed 's/ min//'| sed 's/,/m/' | sed 's/ / /')
|
||||
|
||||
|
||||
out+=("^sep($USER @ $Host)")
|
||||
|
||||
#out+=("Mabox Linux $Lsb_rel <i>$Lsb_code</i>")
|
||||
|
||||
out+=("$(printf "<tt>%+30s</tt> %s,%s" "$KERNEL" "$Release" "manjaro-settings-manager -m msm_kernel")")
|
||||
out+=("$(printf "<tt>%+29s</tt> %s,%s" "$PKGS" "$(pacman -Q|wc -l)" "pamac-manager")")
|
||||
out+=("$(printf "<tt>%+31s</tt> %s,%s" "$RESOLUTION" "$(xdpyinfo | awk '/^ +dimensions/ {print $2}')" "arandr")")
|
||||
out+=("^sep($DF_HEADER)")
|
||||
#out+=("$(df -HlT | grep -E '^/')")
|
||||
|
||||
|
||||
#df -HlT | grep -E '^/' | while read line ; do
|
||||
#out+=("$(printf "<tt>%s %s %s %s %s %s %s</tt>" "$line")")
|
||||
#done
|
||||
|
||||
##out+=("<tt>$SizeMountPoint1</tt>")
|
||||
#out+=("<tt>$SizeMountPoint2</tt>")
|
||||
out2+=("^sep($CPU_RAM)")
|
||||
out2+=("RAM used: $MemUsed MB/$MemTotal MB ~ $MemUsedPercent%")
|
||||
out2+=("Swp used: $SwpUsed MB/$SwpTotal MB ~ $SwpUsedPercent%")
|
||||
out2+=("^sep()")
|
||||
out2+=("CPU ~ $CPUmodel")
|
||||
out2+=("CPU @ $CPUfreq MHz ~ CPU Cache: $CPUcache")
|
||||
out2+=("^sep($NETWORK ~ "$NetworkDevice1" ")
|
||||
out2+=("$NetworkDevice1 ~ ip: $NetDev1ip")
|
||||
out2+=("$NetworkDevice1 ~ $DOWNLOADED: ${NetDev1down:1:-1}")
|
||||
out2+=("$NetworkDevice1 ~ $UPLOADED: ${NetDev1up:1:-1}")
|
||||
out2+=("^sep($DATETIME)")
|
||||
out2+=("$(printf "<tt>%+29s</tt> %s" $DATE "$(date '+%Y.%m.%d (%a)')")")
|
||||
out2+=("$(printf "<tt>%+30s</tt> %s" $WEEK "$(date '+%W')")")
|
||||
out2+=("$(printf "<tt>%+30s</tt> %s" $DAY "$(date '+%j')")")
|
||||
out2+=("$(printf "<tt>%+29s</tt> %s" $TIME "$(date '+%H:%M [%Z]')")")
|
||||
out2+=("^sep()")
|
||||
out2+=("$(printf "<tt>%+29s</tt> %s" Uptime: "$UpTime")")
|
||||
|
||||
|
||||
|
||||
### RUN
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
|
||||
MENU_PADDING_TOP=0
|
||||
MENU_HALIGN="center"
|
||||
MENU_VALIGN="center"
|
||||
jgmenu_icon_size=0
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(df -HlT | grep -E '^/'|awk '{print "\"\"\"<tt>"$0"</tt>\"\"\",^pipe(jgbrowser "$7")"}')
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out[@]}"
|
||||
df -HlT | grep -E '^/'|awk '{print "\"\"\"<tt>"$0"</tt>\"\"\",^pipe(jgbrowser "$7")"}'
|
||||
printf '%s\n' "${out2[@]}"
|
||||
if [ $1 == "-r" ]; then
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_sysinfopipe=false;mb-jgtools places"
|
||||
fi
|
||||
705
usr/bin/jgtint2-pipe
Executable file
705
usr/bin/jgtint2-pipe
Executable file
@@ -0,0 +1,705 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Dynamic menu - helper to configure tint2 panels
|
||||
|
||||
# Favorited fonts list
|
||||
if [ -f "$HOME/.config/mabox/fonts.list" ];then
|
||||
mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list)
|
||||
else
|
||||
mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list)
|
||||
cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/
|
||||
fi
|
||||
|
||||
TINT2PATH="$HOME/.config/tint2"
|
||||
TINT2RC="$TINT2PATH/tint2rc"
|
||||
TZEN="mb-tint2-manager"
|
||||
|
||||
me="jgtint2-pipe -s"
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
LNG="pl"
|
||||
TITLE="Konfiguracja Panelu"
|
||||
PANEL="Panel"
|
||||
_FLOATING_PANEL="Pływający panel"
|
||||
POSITION="Pozycja"
|
||||
SIZE="Rozmiar"
|
||||
WIDTH="Szerokość"
|
||||
HEIGHT="Wysokość"
|
||||
MARGIN="Margines"
|
||||
PADDING="Odstęp"
|
||||
COMPACT="Kompaktowy ?"
|
||||
AUTOHIDE="Autoukrywanie ?"
|
||||
SIZEHIDDEN="Rozmiar gdy ukryty"
|
||||
_FONTS="Czcionki"
|
||||
_TASK_FONT="Zadania"
|
||||
_TASKBARNAME_FONT="Numer pulpitu"
|
||||
_EDIT_FAVFONTS="Edytuj ulubione czcionki"
|
||||
ICONS="Ikony"
|
||||
CLOCK="Zegar"
|
||||
CLOCK_LINE1="Zegar linia 1"
|
||||
CLOCK_LINE2="Zegar linia 2"
|
||||
NONE="brak"
|
||||
TASKBAR="Pasek zadań i przyciski"
|
||||
_TASKBAR_NAME="Pokaż nazwę pulpitu (numer)"
|
||||
_DISTR_SIZE="Podziel przestrzeń między paskami zadań"
|
||||
_TASKS_ALIGNMENT="Wyrównanie zadań do"
|
||||
MOUSE_EVENTS="Akcje myszy"
|
||||
RESETMOUSE="Przywróć domyślne"
|
||||
MOUSE_LEFT="Lewy klik"
|
||||
MOUSE_RIGHT="Prawy klik"
|
||||
MOUSE_MIDDLE="Środkowy klik"
|
||||
MOUSE_UP="Kółko Góra"
|
||||
MOUSE_DOWN="Kółko Dół"
|
||||
_DESKTOPS="<b>Pulpity</b> (obszary robocze)"
|
||||
_ADD_DESKTOP="<b>Dodaj</b> pulpit"
|
||||
_REMOVE_LAST="<b>Usuń ostatni</b> pulpit"
|
||||
APPEARANCE="Wygląd przycisków"
|
||||
SHOW_BOTH="Ikony i tekst"
|
||||
SHOW_ICON="Ikony"
|
||||
SHOW_TEXT="Tekst"
|
||||
CENTER_TEXT="Tekst wycentrowany"
|
||||
BUTTON_WIDTH="Wielkość przycisku"
|
||||
FILL="Wypełnij pasek zadań"
|
||||
FITICON="Jak ikony"
|
||||
TOOLTIPS="Podpowiedzi..."
|
||||
TOOLTIPS_NONE="Nie pokazuj"
|
||||
SHOW_TOOLTIPS="Podpowiedzi"
|
||||
THUMBNAILS="Podpowiedz i Miniaturki"
|
||||
RESET="Resetuj panel"
|
||||
TOP="Góra"
|
||||
BOTTOM="Dół"
|
||||
TOPLEFT="Góra po lewej"
|
||||
TOPRIGHT="Góra po prawej"
|
||||
LEFT="Lewa"
|
||||
RIGHT="Prawa"
|
||||
BOTTOMLEFT="Dół po lewej"
|
||||
BOTTOMRIGHT="Dół po prawej"
|
||||
HORIZONTAL="Poziomo"
|
||||
VERTICAL="Pionowo"
|
||||
SPACING="Odstęp"
|
||||
YES="Tak"
|
||||
NO="Nie"
|
||||
RUNNING_TINT2="Działające Tint2"
|
||||
DEFAULT_TINT2RC="Domyślny tint2rc"
|
||||
ADVANCED="Zaawansowane..."
|
||||
EDIT_TINT2="Edytuj plik konfiguracyjny"
|
||||
APPS="Programy (Launcher)"
|
||||
LAUNCHERS="Dodaj/usuń programy..."
|
||||
TINT2_EDITOR="Wybierz pliki Tint2 do edycji..."
|
||||
TINT2_CONFIGURE="Konfiguracja panelu tint2"
|
||||
CHOOSE_TINT2="Wybierz konfigurację panelu..."
|
||||
_PANEL_CONFIGS="Dostępne panele"
|
||||
_OPEN_CFG_DIR="Otwórz katalog z konfiguracjami"
|
||||
RESTART_TINT2="Restartuj Panel"
|
||||
RELOAD_TINT2="Przeładuj Panel"
|
||||
CONFIGURE="Konfiguruj (GUI)"
|
||||
REMOVE="Usuń to menu z panelu"
|
||||
TRAY_HWMON="Monitor zasobów w trayu"
|
||||
START="Uruchom/Włącz"
|
||||
STOP="Zatrzymaj/Wyłącz"
|
||||
MEM="Pamięć"
|
||||
NET="Użycie sieci"
|
||||
DISC_IO="IO Dysku"
|
||||
;;
|
||||
es*)
|
||||
LNG="en"
|
||||
TITLE="Panel Tint2"
|
||||
PANEL="Panel"
|
||||
_FLOATING_PANEL="Floating panel"
|
||||
POSITION="Position"
|
||||
SIZE="Size"
|
||||
WIDTH="Width"
|
||||
HEIGHT="Height"
|
||||
MARGIN="Margin"
|
||||
PADDING="Padding"
|
||||
COMPACT="Compact?"
|
||||
AUTOHIDE="Autohide?"
|
||||
SIZEHIDDEN="Size when hidden:"
|
||||
_FONTS="Fonts"
|
||||
_TASK_FONT="Task font"
|
||||
_TASKBARNAME_FONT="Taskbar name font"
|
||||
_EDIT_FAVFONTS="Edit favorite fonts list"
|
||||
ICONS="Icon theme"
|
||||
CLOCK="Clock"
|
||||
CLOCK_LINE1="Clock line 1"
|
||||
CLOCK_LINE2="Clock line 2"
|
||||
NONE="none"
|
||||
TASKBAR="Taskbar"
|
||||
_TASKBAR_NAME="Show taskbar name (number)"
|
||||
_DISTR_SIZE="Distribute size between taskbars"
|
||||
_TASKS_ALIGNMENT="Task alignment"
|
||||
MOUSE_EVENTS="Mouse events"
|
||||
MOUSE_EVENTS="Mouse events"
|
||||
RESETMOUSE="Reset to defaults"
|
||||
MOUSE_LEFT="Left click"
|
||||
MOUSE_RIGHT="Right click"
|
||||
MOUSE_MIDDLE="Middle click"
|
||||
MOUSE_UP="Wheel Up"
|
||||
MOUSE_DOWN="Wheel Down"
|
||||
_DESKTOPS="<b>Desktops</b> (workspaces)"
|
||||
_ADD_DESKTOP="<b>Add new</b> desktop"
|
||||
_REMOVE_LAST="<b>Remove last</b> desktop"
|
||||
APPEARANCE="Buttons Appearance"
|
||||
SHOW_BOTH="Icons and text"
|
||||
SHOW_ICON="Show icon"
|
||||
SHOW_TEXT="Show text"
|
||||
CENTER_TEXT="Center text"
|
||||
BUTTON_WIDTH="Button width"
|
||||
FILL="Fill taskbar"
|
||||
FITICON="Fit icon size"
|
||||
TOOLTIPS_NONE="None"
|
||||
TOOLTIPS="Tooltips..."
|
||||
SHOW_TOOLTIPS="Show tooltips"
|
||||
THUMBNAILS="Thumbnails"
|
||||
RESET="Reset panel to defaults"
|
||||
TOP="Top"
|
||||
BOTTOM="Bottom"
|
||||
TOPLEFT="TopLeft"
|
||||
TOPRIGHT="TopRight"
|
||||
LEFT="Left"
|
||||
RIGHT="Right"
|
||||
BOTTOMLEFT="BottomLeft"
|
||||
BOTTOMRIGHT="BottomRight"
|
||||
HORIZONTAL="Horizontal"
|
||||
VERTICAL="Vertical"
|
||||
SPACING="Spacing"
|
||||
YES="Yes"
|
||||
NO="No"
|
||||
RUNNING_TINT2="Panel(es) en ejecución"
|
||||
DEFAULT_TINT2RC="Panel tint2rc x defecto"
|
||||
ADVANCED="Advanced..."
|
||||
EDIT_TINT2="Edición manual panel"
|
||||
APPS="Launchers"
|
||||
LAUNCHERS="Add/Remove Launchers..."
|
||||
TINT2_EDITOR="Elegir panel Tint2 a editar"
|
||||
TINT2_CONFIGURE="Editor gráfico"
|
||||
CHOOSE_TINT2="Elegir un panel..."
|
||||
_PANEL_CONFIGS="Available Configurations"
|
||||
_OPEN_CFG_DIR="Open config dir"
|
||||
RESTART_TINT2="Reiniciar panel"
|
||||
RELOAD_TINT2="Reload panel"
|
||||
CONFIGURE="Editor gráfico"
|
||||
REMOVE="Eliminar este menú del panel"
|
||||
TRAY_HWMON="Systray HW monitor"
|
||||
START="Start/Enable"
|
||||
STOP="Stop/Disable"
|
||||
MEM="Memory"
|
||||
NET="Network usage"
|
||||
DISC_IO="Disc IO"
|
||||
;;
|
||||
*)
|
||||
LNG="en"
|
||||
TITLE="Configure Panel"
|
||||
PANEL="Panel"
|
||||
_FLOATING_PANEL="Floating panel"
|
||||
POSITION="Position"
|
||||
SIZE="Size"
|
||||
WIDTH="Width"
|
||||
HEIGHT="Height"
|
||||
MARGIN="Margin"
|
||||
PADDING="Padding"
|
||||
COMPACT="Compact?"
|
||||
AUTOHIDE="Autohide?"
|
||||
SIZEHIDDEN="Size when hidden:"
|
||||
_FONTS="Fonts"
|
||||
_TASK_FONT="Task"
|
||||
_TASKBARNAME_FONT="Taskbar name"
|
||||
_EDIT_FAVFONTS="Edit favorite fonts list"
|
||||
ICONS="Icon theme"
|
||||
CLOCK="Clock"
|
||||
CLOCK_LINE1="Clock line 1"
|
||||
CLOCK_LINE2="Clock line 2"
|
||||
NONE="none"
|
||||
TASKBAR="Taskbar"
|
||||
_TASKBAR_NAME="Show taskbar name (number)"
|
||||
_DISTR_SIZE="Distribute size between taskbars"
|
||||
_TASKS_ALIGNMENT="Task alignment"
|
||||
MOUSE_EVENTS="Mouse events"
|
||||
RESETMOUSE="Reset to defaults"
|
||||
MOUSE_LEFT="Left click"
|
||||
MOUSE_RIGHT="Right click"
|
||||
MOUSE_MIDDLE="Middle click"
|
||||
MOUSE_UP="Wheel Up"
|
||||
MOUSE_DOWN="Wheel Down"
|
||||
_DESKTOPS="<b>Desktops</b> (workspaces)"
|
||||
_ADD_DESKTOP="<b>Add new</b> desktop"
|
||||
_REMOVE_LAST="<b>Remove last</b> desktop"
|
||||
APPEARANCE="Buttons Appearance"
|
||||
SHOW_BOTH="Icons and text"
|
||||
SHOW_ICON="Icon only"
|
||||
SHOW_TEXT="Text only"
|
||||
CENTER_TEXT="Centered"
|
||||
BUTTON_WIDTH="Button width"
|
||||
FILL="Fill taskbar"
|
||||
FITICON="Fit icon size"
|
||||
TOOLTIPS="Tooltips..."
|
||||
TOOLTIPS_NONE="None"
|
||||
SHOW_TOOLTIPS="Only tooltips"
|
||||
THUMBNAILS="Tooltips and Thumbnails"
|
||||
RESET="Reset panel to defaults"
|
||||
TOP="Top"
|
||||
BOTTOM="Bottom"
|
||||
TOPLEFT="TopLeft"
|
||||
TOPRIGHT="TopRight"
|
||||
LEFT="Left"
|
||||
RIGHT="Right"
|
||||
BOTTOMLEFT="BottomLeft"
|
||||
BOTTOMRIGHT="BottomRight"
|
||||
HORIZONTAL="Horizontal"
|
||||
VERTICAL="Vertical"
|
||||
SPACING="Spacing"
|
||||
YES="Yes"
|
||||
NO="No"
|
||||
RUNNING_TINT2="Running Tint2"
|
||||
DEFAULT_TINT2RC="Default tint2rc"
|
||||
ADVANCED="Advanced..."
|
||||
EDIT_TINT2="Edit config file"
|
||||
APPS="Launchers"
|
||||
LAUNCHERS="Add/Remove Launchers..."
|
||||
TINT2_EDITOR="Choose Tint2 to edit"
|
||||
TINT2_CONFIGURE="Configure tint2 panel"
|
||||
CHOOSE_TINT2="Choose Panel config..."
|
||||
RESTART_TINT2="Restart Panel"
|
||||
RELOAD_TINT2="Reload Panel"
|
||||
_PANEL_CONFIGS="Available Configurations"
|
||||
_OPEN_CFG_DIR="Open config dir"
|
||||
CONFIGURE="Configure (GUI)"
|
||||
REMOVE="Remove this menu from panel"
|
||||
TRAY_HWMON="Systray HW monitor"
|
||||
START="Start/Enable"
|
||||
STOP="Stop/Disable"
|
||||
MEM="Memory"
|
||||
NET="Network usage"
|
||||
DISC_IO="Disc IO"
|
||||
;;
|
||||
esac
|
||||
getvalues () {
|
||||
read VE HO OR <<< "$(grep panel_position ${TINT} | cut -d'=' -f2)"
|
||||
read W H <<< "$(grep panel_size ${TINT} | cut -d'=' -f2)"
|
||||
read HOR VERT <<< "$(grep panel_margin ${TINT} | cut -d'=' -f2)"
|
||||
read PHOR PVERT SPACE <<< "$(grep panel_padding ${TINT} | cut -d'=' -f2)"
|
||||
read SHRINK <<< "$(grep panel_shrink ${TINT} | cut -d'=' -f2)"
|
||||
read HIDE <<< "$(grep "autohide " ${TINT} | cut -d'=' -f2)"
|
||||
read ICONTHEME <<< "$(grep "launcher_icon_theme" ${TINT} | cut -d'=' -f2)"
|
||||
read PANELITEMS <<< "$(grep "panel_items" ${TINT} | cut -d'=' -f2)"
|
||||
[[ "$OR" == "horizontal" ]] && WIDTH=${HEIGHT}
|
||||
}
|
||||
|
||||
qactions () {
|
||||
[[ "$HOR" -gt 1 ]] && out+=("<big></big> $_FLOATING_PANEL,t2ctl postype edge ${TINT};$me") || out+=("<big></big> $_FLOATING_PANEL,t2ctl postype float ${TINT};$me")
|
||||
#out+=("<tt>$(printf "%-20s %20s" "$POSITION" "[ <b>$VE $HO</b> ]")</tt>,^checkout(ppos$i)")
|
||||
#out+=("<tt>$(printf "%-20s %20s" "$SIZE" "[ <b>$W</b> ]")</tt>,^checkout(pwidth$i)")
|
||||
#out+=("<tt>$(printf "%-20s %20s" "$WIDTH" "[ <b>$H</b> ]")</tt>,^checkout(pheight$i)")
|
||||
#out+=("<tt>$(printf "%-20s %20s" "$MARGIN" "[ <b>$HOR $VERT</b> ]")</tt>,^checkout(pmargin$i)")
|
||||
#out+=("<tt>$(printf "%-20s %20s" "$PADDING" "[ <b>$PHOR $PVERT $SPACE</b> ]")</tt>,^checkout(ppadding$i)")
|
||||
#[[ "$HIDE" == 0 ]] && out+=("<big></big> <tt>$(printf "%-20s %20s" "$AUTOHIDE" "")</tt>,^checkout(phide$i)") || out+=("<big></big> <tt>$(printf "%-20s %20s" "$AUTOHIDE" "")</tt>,^checkout(phide$i)")
|
||||
#out+=("^sep()")
|
||||
out+=("$POSITION [ <b>$VE $HO</b> ],^checkout(ppos$i)")
|
||||
out+=("$SIZE [ <b>$W</b> ],^checkout(pwidth$i)")
|
||||
out+=("$WIDTH [ <b>$H</b> ],^checkout(pheight$i)")
|
||||
out+=("$MARGIN [ <b>$HOR $VERT</b> ],^checkout(pmargin$i)")
|
||||
out+=("$PADDING [ <b>$PHOR $PVERT $SPACE</b> ],^checkout(ppadding$i)")
|
||||
[[ "$HIDE" == 0 ]] && out+=("<big></big> $AUTOHIDE,^checkout(phide$i)") || out+=("<big></big> $AUTOHIDE,^checkout(phide$i)")
|
||||
out+=("^sep()")
|
||||
|
||||
out+=("$ICONS [ <b>$ICONTHEME</b> ],^checkout(iconthemes$i)")
|
||||
# Clock
|
||||
#if [[ "$PANELITEMS" == *C* ]]; then
|
||||
#read TF1 <<< "$(grep "time1_format" ${TINT} | cut -d'=' -f2)"
|
||||
#read TF2 <<< "$(grep "time2_format" ${TINT} | cut -d'=' -f2)"
|
||||
|
||||
#out+=("^sep($CLOCK)")
|
||||
#out+=("$CLOCK_LINE1 [ <b> $(date "+${TF1}") </b> ],^checkout(cl1$i)")
|
||||
#out+=("$CLOCK_LINE2 [ <b> $(date "+${TF2}") </b> ],^checkout(cl2$i)")
|
||||
#out2+=("^tag(cl1$i)")
|
||||
#out2+=("^sep($CLOCK_LINE1)")
|
||||
#out2+=("<b>$(date +"%H:%M")</b> <small>(%H:%M)</small>,t2ctl clockline1 '%H:%M' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%I:%M %p")</b> <small>(%I:%M %p)</small>,t2ctl clockline1 '%I:%M %p' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%-I:%M %p")</b> <small>(%I-:%M %p)</small>,t2ctl clockline1 '%-I:%M %p' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%H:%M:%S")</b> <small>(%H:%M:%S)</small>,t2ctl clockline1 '%H:%M:%S' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%H:%M (%a)")</b> <small>(%H:%M (%a))</small>,t2ctl clockline1 '%H:%M (%a)' ${TINT};$me")
|
||||
|
||||
#out2+=("^tag(cl2$i)")
|
||||
#out2+=("^sep($CLOCK_LINE2)")
|
||||
#out2+=("$NONE,t2ctl clockline2 none ${TINT};$me")
|
||||
#out2+=("^sep()")
|
||||
#out2+=("<b>$(date +"%A %d %B")</b> <small>(%A %d %B)</small>,t2ctl clockline2 '%A %d %B' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%a %d %b")</b> <small>(%a %d %b)</small>,t2ctl clockline2 '%a %d %b' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%x")</b> <small>(%x)</small>,t2ctl clockline2 '%x' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%m-%d-%Y")</b> <small>(%m-%d-%Y)</small>,t2ctl clockline2 '%m-%d-%Y' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%F")</b> <small>(%F)</small>,t2ctl clockline2 '%F' ${TINT};$me")
|
||||
#out2+=("<b>$(date +"%e.%m.%y")</b> <small>(%e.%m.%y)</small>,t2ctl clockline2 '%e.%m.%y' ${TINT};$me")
|
||||
#fi
|
||||
# END Clock
|
||||
# Taskbar
|
||||
if [[ "$PANELITEMS" == *T* ]]; then
|
||||
read TEXT <<< "$(grep task_text ${TINT} | cut -d'=' -f2)"
|
||||
read ICON <<< "$(grep 'task_icon ' ${TINT} | cut -d'=' -f2)"
|
||||
read CENTERED <<< "$(grep 'task_centered' ${TINT} | cut -d'=' -f2)"
|
||||
read TOOLTIP <<< "$(grep 'task_tooltip' ${TINT} | cut -d'=' -f2)"
|
||||
read THUMBNAIL <<< "$(grep 'task_thumbnail' ${TINT} | cut -d'=' -f2)"
|
||||
read TB_WIDTH TB_HEIGHT <<< "$(grep 'task_maximum_size' ${TINT} | cut -d'=' -f2)"
|
||||
read MLEFT <<< "$(grep 'mouse_left' ${TINT} | cut -d'=' -f2)"
|
||||
read MMIDDLE <<< "$(grep 'mouse_middle' ${TINT} | cut -d'=' -f2)"
|
||||
read MRIGHT <<< "$(grep 'mouse_right' ${TINT} | cut -d'=' -f2)"
|
||||
read MUP <<< "$(grep 'mouse_scroll_up' ${TINT} | cut -d'=' -f2)"
|
||||
read MDOWN <<< "$(grep 'mouse_scroll_down' ${TINT} | cut -d'=' -f2)"
|
||||
read TASK_ALIGN <<< "$(grep 'task_align' ${TINT} | cut -d'=' -f2)"
|
||||
read TASKBAR_NAME <<< "$(grep 'taskbar_name' ${TINT} | cut -d'=' -f2)"
|
||||
read DISTR_SIZE <<< "$(grep 'taskbar_distribute_size' ${TINT} | cut -d'=' -f2)"
|
||||
IFS=' ' read -r -a TASK_FONT <<< "$(grep '.*task_font ' ${TINT} | cut -d"=" -f2)"
|
||||
## TASK FONT FAMILY and SIZE
|
||||
TASK_FSIZE="${TASK_FONT[-1]}"
|
||||
TASK_FFAMILY="${TASK_FONT[@]::${#TASK_FONT[@]}-1}"
|
||||
IFS=' ' read -r -a TNAME_FONT <<< "$(grep '.*taskbar_name_font ' ${TINT} | cut -d"=" -f2)"
|
||||
## TASKBAR NAME FONT FAMILY and SIZE
|
||||
TNAME_FSIZE="${TNAME_FONT[-1]}"
|
||||
TNAME_FFAMILY="${TNAME_FONT[@]::${#TNAME_FONT[@]}-1}"
|
||||
|
||||
out+=("^sep($TASKBAR)")
|
||||
|
||||
|
||||
out+=("$APPEARANCE,^checkout(taskappearance$i)")
|
||||
|
||||
out+=("$_TASKS_ALIGNMENT [ <b>$TASK_ALIGN</b> ],^checkout(talign)")
|
||||
out2+=("^tag(talign)")
|
||||
out2+=("^sep($_TASKS_ALIGNMENT)")
|
||||
for al in left center right;do
|
||||
[[ "$TASK_ALIGN" == "$al" ]] && out2+=("<big>綠</big> <b>$al</b>,$me") || out2+=("<big>祿</big> $al,t2ctl tasks_align $al ${TINT};$me")
|
||||
done
|
||||
[[ "$TASKBAR_NAME" == 1 ]] && out+=("<big></big> $_TASKBAR_NAME,t2ctl taskbar_name 0 ${TINT};$me") || out+=("<big></big> $_TASKBAR_NAME,t2ctl taskbar_name 1 ${TINT};$me")
|
||||
[[ "$DISTR_SIZE" == 1 ]] && out+=("<big></big> $_DISTR_SIZE,t2ctl taskbar_distribute_size 0 ${TINT};$me") || out+=("<big></big> $_DISTR_SIZE,t2ctl taskbar_distribute_size 1 ${TINT};$me")
|
||||
|
||||
### FONTS
|
||||
[[ "$TEXT" == 1 ]] && out+=("<big></big> $_TASK_FONT: [ <b>${TASK_FFAMILY} ${TASK_FSIZE}</b> ],^checkout(taskfont$i)")
|
||||
[[ "$TASKBAR_NAME" == 1 ]] && out+=("<big></big> $_TASKBARNAME_FONT: [ <b>${TNAME_FFAMILY} ${TNAME_FSIZE}</b> ],^checkout(tnamefont$i)")
|
||||
|
||||
out2+=("^tag(taskfont$i)")
|
||||
out2+=("^sep($_TASK_FONT)")
|
||||
out2+=("^sep(size)")
|
||||
sizes=(12 11 10 9 8)
|
||||
for n in "${sizes[@]}"
|
||||
do
|
||||
[[ "$TASK_FSIZE" == "$n" ]] && out2+=("<big>綠</big> <b>$n px</b>,$me") || out2+=("<big>祿</big> $n px,t2ctl task_fontsize $n ${TINT};$me")
|
||||
done
|
||||
if [ "${#favfonts[@]}" -gt 0 ];then
|
||||
out2+=("^sep(family)")
|
||||
for fon in "${favfonts[@]}";do
|
||||
[[ "$TASK_FFAMILY" == "$fon" ]] && out2+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,t2ctl task_fontfamily \"${fon}\" ${TINT};$me")
|
||||
done
|
||||
out2+=("^sep()")
|
||||
out2+=("<small> $_EDIT_FAVFONTS </small>,geany ~/.config/mabox/fonts.list")
|
||||
fi
|
||||
|
||||
out2+=("^tag(tnamefont$i)")
|
||||
out2+=("^sep($_TASKBARNAME_FONT)")
|
||||
out2+=("^sep(size)")
|
||||
for n in "${sizes[@]}"
|
||||
do
|
||||
[[ "$TNAME_FSIZE" == "$n" ]] && out2+=("<big>綠</big> <b>$n px</b>,$me") || out2+=("<big>祿</big> $n px,t2ctl taskbar_name_fontsize $n ${TINT};$me")
|
||||
done
|
||||
if [ "${#favfonts[@]}" -gt 0 ];then
|
||||
out2+=("^sep(family)")
|
||||
for fon in "${favfonts[@]}";do
|
||||
[[ "$TNAME_FFAMILY" == "$fon" ]] && out2+=("<big>綠</big> <span font_family=\"${fon}\">${fon}</span>,$me") || out2+=("<big>祿</big> <span font_family=\"${fon}\">${fon}</span>,t2ctl taskbar_name_fontfamily \"${fon}\" ${TINT};$me")
|
||||
done
|
||||
out2+=("^sep()")
|
||||
out2+=("<small> $_EDIT_FAVFONTS </small>,geany ~/.config/mabox/fonts.list")
|
||||
fi
|
||||
### END FONTS
|
||||
|
||||
out+=("<big></big> $MOUSE_EVENTS,^checkout(mouseevents$i)")
|
||||
mouseactions=(none close toggle iconify shade toggle_iconify maximize_restore desktop_left desktop_right next_task prev_task)
|
||||
|
||||
out2+=("^tag(mouseevents$i)")
|
||||
out2+=("^sep($MOUSE_EVENTS)")
|
||||
out2+=("$RESETMOUSE,t2ctl mousereset ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
out2+=("<tt>$(printf "%-16s %1s" "$MOUSE_LEFT" "[ <b>$MLEFT</b> ]")</tt>,^checkout(mleft$i)")
|
||||
out2+=("<tt>$(printf "%-16s %1s" "$MOUSE_RIGHT" "[ <b>$MRIGHT</b> ]")</tt>,^checkout(mright$i)")
|
||||
out2+=("<tt>$(printf "%-16s %1s" "$MOUSE_MIDDLE" "[ <b>$MMIDDLE</b> ]")</tt>,^checkout(mmiddle$i)")
|
||||
out2+=("<tt>$(printf "%-16s %1s" "$MOUSE_UP" "[ <b>$MUP</b> ]")</tt>,^checkout(mup$i)")
|
||||
out2+=("<tt>$(printf "%-16s %1s" "$MOUSE_DOWN" "[ <b>$MDOWN</b> ]")</tt>,^checkout(mdown$i)")
|
||||
|
||||
out3+=("^tag(mleft$i)" "^sep($MOUSE_LEFT)")
|
||||
for n in "${mouseactions[@]}";do out3+=("$n,t2ctl mleft $n ${TINT};$me"); done
|
||||
|
||||
out3+=("^tag(mright$i)" "^sep($MOUSE_RIGHT)")
|
||||
for n in "${mouseactions[@]}";do out3+=("$n,t2ctl mright $n ${TINT};$me"); done
|
||||
|
||||
out3+=("^tag(mmiddle$i)" "^sep($MOUSE_MIDDLE)")
|
||||
for n in "${mouseactions[@]}";do out3+=("$n,t2ctl mmiddle $n ${TINT};$me"); done
|
||||
|
||||
out3+=("^tag(mup$i)" "^sep($MOUSE_UP)")
|
||||
for n in "${mouseactions[@]}";do out3+=("$n,t2ctl mup $n ${TINT};$me"); done
|
||||
|
||||
out3+=("^tag(mdown$i)" "^sep($MOUSE_DOWN)")
|
||||
for n in "${mouseactions[@]}";do out3+=("$n,t2ctl mdown $n ${TINT};$me"); done
|
||||
|
||||
|
||||
out2+=("^tag(taskappearance$i)")
|
||||
out2+=("^sep($APPEARANCE)")
|
||||
[[ "$ICON" = 1 && "$TEXT" = 1 ]] && out2+=("<big>綠</big> <b>$SHOW_BOTH</b>,$me")||out2+=("<big>祿</big> $SHOW_BOTH,t2ctl tb_both 1 ${TINT};$me")
|
||||
[[ "$TEXT" = 1 && "$ICON" = 0 ]] && out2+=("<big>綠</big> <b>$SHOW_TEXT</b>,$me")||out2+=("<big>祿</big> $SHOW_TEXT,t2ctl tb_text 1 ${TINT};$me")
|
||||
[[ "$ICON" = 1 && "$TEXT" = 0 ]] && out2+=("<big>綠</big> <b>$SHOW_ICON</b>,$me")||out2+=("<big>祿</big> $SHOW_ICON,t2ctl tb_icon 1 ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
[[ "$CENTERED" = 1 ]] && out2+=("<big></big> $CENTER_TEXT,t2ctl tb_centered 0 ${TINT};$me")||out2+=("<big></big> $CENTER_TEXT,t2ctl tb_centered 1 ${TINT};$me")
|
||||
#out2+=("^sep()")
|
||||
#out2+=("$BUTTON_WIDTH [ <b>$TB_WIDTH</b> ],^checkout(tbwidth$i)")
|
||||
#out3+=("^tag(tbwidth$i)")
|
||||
out2+=("^sep($BUTTON_WIDTH)")
|
||||
#out3+=("^sep()")
|
||||
#out3+=("$FITICON,t2ctl tb_width icon ${TINT};$me")
|
||||
tsizes=(100 120 150 180 200)
|
||||
for ts in "${tsizes[@]}"
|
||||
do
|
||||
[[ "$TB_WIDTH" == "$ts" ]] && out2+=("<big>綠</big> <b>$ts px</b>") || out2+=("<big>祿</big> $ts px,t2ctl tb_width $ts ${TINT};$me")
|
||||
done
|
||||
out2+=("^sep()")
|
||||
[[ "$TB_WIDTH" == "0" ]] && out2+=("<big>綠</big> <b>$FILL</b>,t2ctl tb_width 0 ${TINT};$me") || out2+=("<big>祿</big> $FILL,t2ctl tb_width 0 ${TINT};$me")
|
||||
|
||||
out2+=("^sep($TOOLTIPS)")
|
||||
[[ "$TOOLTIP" = 0 && "$THUMBNAIL" = 0 ]] && out2+=("<big>綠</big> <b>$TOOLTIPS_NONE</b>,t2ctl tb_tooltip_none 0 ${TINT};$me")||out2+=("<big>祿</big> $TOOLTIPS_NONE,t2ctl tb_tooltip_none 1 ${TINT};$me")
|
||||
[[ "$TOOLTIP" = 1 && "$THUMBNAIL" = 0 ]] && out2+=("<big>綠</big> <b>$SHOW_TOOLTIPS</b>,t2ctl tb_tooltip 0 ${TINT};$me")||out2+=("<big>祿</big> $SHOW_TOOLTIPS,t2ctl tb_tooltip 1 ${TINT};$me")
|
||||
[[ "$TOOLTIP" = 1 && "$THUMBNAIL" = 1 ]] && out2+=("<big>綠</big> <b>$THUMBNAILS</b>,t2ctl tb_thumbnail 0 ${TINT};$me")||out2+=("<big>祿</big> $THUMBNAILS,t2ctl tb_thumbnail 1 ${TINT};$me")
|
||||
out2+=("")
|
||||
|
||||
desktops=$(wmctrl -d |wc -l)
|
||||
out+=("$_DESKTOPS [ <b>$desktops</b> ],^checkout(desktops)")
|
||||
out2+=("^tag(desktops)")
|
||||
out2+=("^sep($_DESKTOPS)")
|
||||
out2+=(" $_ADD_DESKTOP,obxml desktops $((desktops+1));$me")
|
||||
[[ "$desktops" -gt "1" ]] && out2+=(" $_REMOVE_LAST,obxml desktops $((desktops-1));$me")
|
||||
|
||||
fi ### END TASKBAR
|
||||
|
||||
|
||||
out2+=("^tag(iconthemes$i)")
|
||||
for item in "/usr/share/icons"/*; do
|
||||
if [[ -d $item ]]; then
|
||||
out2+=("${item##*/},t2ctl icontheme ${item##*/} ${TINT};$me")
|
||||
fi
|
||||
done
|
||||
|
||||
out2+=("^tag(ppos$i)")
|
||||
out2+=("^sep($POSITION)")
|
||||
out2+=("^sep($HORIZONTAL)")
|
||||
out2+=(" $TOP,t2ctl position tch ${TINT};$me")
|
||||
out2+=(" $BOTTOM,t2ctl position bch ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
out2+=(" $TOPLEFT,t2ctl position tlh ${TINT};$me")
|
||||
out2+=(" $TOPRIGHT,t2ctl position trh ${TINT};$me")
|
||||
out2+=(" $BOTTOMLEFT,t2ctl position blh ${TINT};$me")
|
||||
out2+=(" $BOTTOMRIGHT,t2ctl position brh ${TINT};$me")
|
||||
out2+=("^sep($VERTICAL)")
|
||||
out2+=(" $LEFT,t2ctl position clv ${TINT};$me")
|
||||
out2+=(" $RIGHT,t2ctl position crv ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
out2+=(" $TOPLEFT,t2ctl position tlv ${TINT};$me")
|
||||
out2+=(" $TOPRIGHT,t2ctl position trv ${TINT};$me")
|
||||
out2+=(" $BOTTOMLEFT,t2ctl position blv ${TINT};$me")
|
||||
out2+=(" $BOTTOMRIGHT,t2ctl position brv ${TINT};$me")
|
||||
out2+=("^tag(pwidth$i)")
|
||||
out2+=("^sep($SIZE)")
|
||||
for si in 100% 95% 90% 80% 75% 60% 50%;do
|
||||
[[ "${W}" == "$si" ]] && out2+=("<big>綠</big> <b>${si}</b>,$me") || out2+=("<big>祿</big> ${si},t2ctl width ${si} ${TINT};$me")
|
||||
done
|
||||
#out2+=("100%,t2ctl width 100% ${TINT};$me")
|
||||
#out2+=("95%,t2ctl width 95% ${TINT};$me")
|
||||
#out2+=("90%,t2ctl width 90% ${TINT};$me")
|
||||
#out2+=("80%,t2ctl width 80% ${TINT};$me")
|
||||
#out2+=("75%,t2ctl width 75% ${TINT};$me")
|
||||
#out2+=("60%,t2ctl width 60% ${TINT};$me")
|
||||
out2+=("^sep()")
|
||||
[[ "$SHRINK" == 0 ]] && out2+=("<big></big> $COMPACT,t2ctl shrink 1 ${TINT};$me ") || out2+=("<big></big> $COMPACT,t2ctl shrink 0 ${TINT};$me")
|
||||
|
||||
|
||||
|
||||
out2+=("")
|
||||
out2+=("^tag(pheight$i)")
|
||||
out2+=("^sep($WIDTH)")
|
||||
heights=(24 28 32 36 40 48)
|
||||
for hi in "${heights[@]}"
|
||||
do
|
||||
[[ "$H" == "$hi" ]] && out2+=("<big>綠</big> <b>$hi px</b>,t2ctl height $hi ${TINT};$me") || out2+=("<big>祿</big> $hi px,t2ctl height $hi ${TINT};$me")
|
||||
done
|
||||
out2+=("^tag(pmargin$i)")
|
||||
out2+=("^sep($MARGIN)")
|
||||
margins=(0 1 2 4)
|
||||
#$HOR $VERT
|
||||
out2+=("^sep($HORIZONTAL)")
|
||||
for hor in "${margins[@]}"
|
||||
do
|
||||
[[ "$HOR" == "$hor" ]] && out2+=("<big>綠</big> <b>$hor px</b>,t2ctl marginh $hor ${TINT};$me") || out2+=("<big>祿</big> $hor px,t2ctl marginh $hor ${TINT};$me")
|
||||
done
|
||||
out2+=("^sep($VERTICAL)")
|
||||
for vert in "${margins[@]}"
|
||||
do
|
||||
[[ "$VERT" == "$vert" ]] && out2+=("<big>綠</big> <b>$vert px</b>,t2ctl marginv $vert ${TINT};$me") || out2+=("<big>祿</big> $vert px,t2ctl marginv $vert ${TINT};$me")
|
||||
done
|
||||
|
||||
#$PHOR $PVERT $SPACE
|
||||
out2+=("^tag(ppadding$i)")
|
||||
out2+=("^sep($PADDING)")
|
||||
out2+=("^sep($HORIZONTAL)")
|
||||
for phor in "${margins[@]}"
|
||||
do
|
||||
[[ "$PHOR" == "$phor" ]] && out2+=("<big>綠</big> <b>$phor px</b>,t2ctl paddingh $phor ${TINT};$me") || out2+=("<big>祿</big> $phor px,t2ctl paddingh $phor ${TINT};$me")
|
||||
done
|
||||
out2+=("")
|
||||
out2+=("^sep($VERTICAL)")
|
||||
for pvert in "${margins[@]}"
|
||||
do
|
||||
[[ "$PVERT" == "$pvert" ]] && out2+=("<big>綠</big> <b>$pvert px</b>,t2ctl paddingv $pvert ${TINT};$me") || out2+=("<big>祿</big> $pvert px,t2ctl paddingv $pvert ${TINT};$me")
|
||||
done
|
||||
|
||||
out2+=("^sep($SPACING)")
|
||||
for space in "${margins[@]}"
|
||||
do
|
||||
[[ "$SPACE" == "$space" ]] && out2+=("<big>綠</big> <b>$space px</b>,t2ctl spacing $space ${TINT};$me") || out2+=("<big>祿</big> $space px,t2ctl spacing $space ${TINT};$me")
|
||||
done
|
||||
|
||||
out2+=("^tag(phide$i)")
|
||||
out2+=("^sep($AUTOHIDE)")
|
||||
[[ "$HIDE" == 0 ]] && out2+=("<big>綠</big> $NO,t2ctl autohide 0 ${TINT}") || out2+=("<big>祿</big> $NO,t2ctl autohide 0 ${TINT}")
|
||||
[[ "$HIDE" == 0 ]] && out2+=("<big>祿</big> $YES,t2ctl autohide 1 ${TINT}") || out2+=("<big>綠</big> $YES,t2ctl autohide 1 ${TINT}")
|
||||
out2+=("^sep($SIZEHIDDEN)")
|
||||
out2+=("1,t2ctl hideheight 1 ${TINT}")
|
||||
out2+=("2,t2ctl hideheight 2 ${TINT}")
|
||||
out2+=("3,t2ctl hideheight 3 ${TINT}")
|
||||
out2+=("4,t2ctl hideheight 4 ${TINT}")
|
||||
out2+=("5,t2ctl hideheight 5 ${TINT}")
|
||||
}
|
||||
|
||||
# START HERE
|
||||
if [ $1 == "-s" ]; then
|
||||
out+=("^sep($TITLE)")
|
||||
else
|
||||
out+=("^sep(<tt>............$TITLE............</tt>)")
|
||||
fi
|
||||
|
||||
out+=("^sep($APPS)")
|
||||
out+=(" $LAUNCHERS,jgtint2launcher")
|
||||
if [ "$(pgrep -u $USER -f tint2)" ];then
|
||||
i=0
|
||||
#out+=("^sep($TINT2_CONFIGURE)")
|
||||
while read -r pid cmd; do
|
||||
if [[ ${cmd%% *} = tint2 ]]; then
|
||||
TINT=${cmd##* }
|
||||
TINT2=${TINT#$HOME/.config/tint2/}
|
||||
if [[ $TINT = tint2 ]];then
|
||||
TINT="$TINT2RC"
|
||||
TINT2="$DEFAULT_TINT2RC"
|
||||
fi
|
||||
out+=("^sep($PANEL: <i>$TINT2</i>)")
|
||||
((i=i+1))
|
||||
getvalues
|
||||
qactions
|
||||
out+=("^sep($ADVANCED)")
|
||||
out+=(" $EDIT_TINT2 <i>$TINT2</i>,geany $TINT")
|
||||
out+=(" $CONFIGURE <i>$TINT2</i>,tint2conf $TINT")
|
||||
if [ -f "/usr/share/mabox/lang/${LNG}/.config/tint2/${TINT2}" ];then
|
||||
out+=("^sep()")
|
||||
out+=("$RESET <i>$TINT2</i>,t2ctl reset ${TINT2};me")
|
||||
fi
|
||||
|
||||
fi
|
||||
done < <(pgrep -u $USER -a tint2)
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if command -v phwmon.py &>/dev/null; then
|
||||
PHWRUN="mabox-obstart phwmon"
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
out+=("^sep($TRAY_HWMON)")
|
||||
if [ "$(pgrep -u $USER -f phwmon.py)" ];then
|
||||
out+=("$STOP,mb-setvar phwmon_monitor=false;sleep 2;$PHWRUN;$me")
|
||||
out+=("^sep()")
|
||||
[[ $phwmon_cpu = false ]] && out+=("<big></big> <i><s>CPU</s></i>,mb-setvar phwmon_cpu=true;$PHWRUN;$me") || out+=("<big></big> CPU,mb-setvar phwmon_cpu=false;$PHWRUN;$me")
|
||||
[[ $phwmon_mem = false ]] && out+=("<big></big> <i><s>$MEM</s></i>,mb-setvar phwmon_mem=true;$PHWRUN;$me") || out+=("<big></big> $MEM,mb-setvar phwmon_mem=false;$PHWRUN;$me")
|
||||
SW=$(swapon -s|wc -l)
|
||||
if [[ "$SW" > 0 ]];then
|
||||
[[ $phwmon_swap = false ]] && out+=("<big></big> <i><s>Swap</s></i>,mb-setvar phwmon_swap=true;$PHWRUN;$me") || out+=("<big></big> Swap,mb-setvar phwmon_swap=false;$PHWRUN;$me")
|
||||
fi
|
||||
[[ $phwmon_net = false ]] && out+=("<big></big> <i><s>$NET</s></i>,mb-setvar phwmon_net=true;$PHWRUN;$me") || out+=("<big></big> $NET,mb-setvar phwmon_net=false;$PHWRUN;$me")
|
||||
[[ $phwmon_io = false ]] && out+=("<big></big> <i><s>$DISC_IO</s></i>,mb-setvar phwmon_io=true;$PHWRUN;$me") || out+=("<big></big> $DISC_IO,mb-setvar phwmon_io=false;$PHWRUN;$me")
|
||||
else
|
||||
out+=("$START,mb-setvar phwmon_monitor=true;$PHWRUN;$me")
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
#out+=("^sep($EDIT_TINT2)")
|
||||
|
||||
# out+=("^sep()")
|
||||
|
||||
out+=("^sep($TITLE)")
|
||||
out+=("$CHOOSE_TINT2 ,^checkout(configs)")
|
||||
out2+=("^tag(configs)")
|
||||
out2+=("^sep($_PANEL_CONFIGS)")
|
||||
for confpath in ~/.config/tint2/*.tint2rc;do
|
||||
confname="${confpath##*/}"
|
||||
name="${confname%.*}"
|
||||
if [[ "${name}" =~ "launcher" ]] || [[ "${name}" =~ "dock" ]] || [[ "${name}" =~ "switch" ]];then
|
||||
:
|
||||
else
|
||||
out2+=("${name},t2ctl switchto ${confpath};${me}")
|
||||
fi
|
||||
done
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> $_OPEN_CFG_DIR,exo-open ~/.config/tint2/")
|
||||
out+=("^sep()")
|
||||
#out+=("$CHOOSE_TINT2,$TZEN")
|
||||
out+=("<big></big> $RESTART_TINT2,mb-tint2restart")
|
||||
out+=("<big>北</big> $RELOAD_TINT2,killall -SIGUSR1 tint2")
|
||||
|
||||
if [ $1 == "-s" ]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
POSITION_MODE=${2:-center}
|
||||
JGWIDTH=340
|
||||
TABS=170
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
|
||||
if [ "$1" == "-r" ]; then
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_tint2pipe=false;mb-jgtools places"
|
||||
fi
|
||||
90
usr/bin/jgtint2launcher
Executable file
90
usr/bin/jgtint2launcher
Executable file
@@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
# jgtint2launcher - Add/Remove applications to Tint2 panel launcher
|
||||
#
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
TITLE="Dodaj/usuń programy do panelu Tint2"
|
||||
TYPE_TO_SEARCH="Pisz aby Wyszukać"
|
||||
CURRENT="Wyzwalacze"
|
||||
OPENDIR="Otwórz"
|
||||
ADD="dodaj"
|
||||
DEL="usuń"
|
||||
ALL="wszystkie";;
|
||||
es*)
|
||||
TITLE="Add/Remove Tint2 panel launchers"
|
||||
TYPE_TO_SEARCH="Buscar"
|
||||
CURRENT="Launchers"
|
||||
OPENDIR="Abrir"
|
||||
ADD="add"
|
||||
DEL="remove"
|
||||
ALL="all";;
|
||||
*)
|
||||
TITLE="Add/Remove Tint2 panel launchers"
|
||||
TYPE_TO_SEARCH="Type to Search"
|
||||
CURRENT="Launchers"
|
||||
OPENDIR="Open"
|
||||
ADD="add"
|
||||
DEL="remove"
|
||||
ALL="all";;
|
||||
|
||||
esac
|
||||
: ${JGMENU_RESOURCE_OPENER=xdg-open}
|
||||
LAUNCHERDIR="$HOME/.config/tint2/launcherapps"
|
||||
mkdir -p ${LAUNCHERDIR}
|
||||
APPSDIR="/usr/share/applications"
|
||||
|
||||
out+=("@text,,$(expr $jgtools_padding + 10),$(expr $jgtools_padding + 10),340,20,4,left,top,auto,#111111,<big><b>$TITLE</b></big>")
|
||||
out+=("@search,,34,29,292,20,4,left,top,auto,#262626,\"\"\"<big></big> <i>$TYPE_TO_SEARCH</i>\"\"\"")
|
||||
out+=("^sep($CURRENT)")
|
||||
out+=(" $OPENDIR <i>(~/.config/tint2/launcherapps)</i>,${JGMENU_RESOURCE_OPENER} $LAUNCHERDIR")
|
||||
out+=("^sep()")
|
||||
a=0
|
||||
for item in "$LAUNCHERDIR"/*.desktop; do
|
||||
if [[ -f $item ]]; then
|
||||
((a++))
|
||||
filename=${item##*/}
|
||||
filename=${filename^}
|
||||
out+=("$DEL <b>${filename%.*}</b>,rm $item;killall -SIGUSR1 tint2;jgtint2launcher")
|
||||
fi
|
||||
done
|
||||
if [[ $a -gt 1 ]]; then
|
||||
out+=("^sep()")
|
||||
out+=("$DEL <b>$ALL</b>: (<b>$a</b>),rm -f $LAUNCHERDIR/*.desktop;killall -SIGUSR1 tint2;jgtint2launcher")
|
||||
fi
|
||||
|
||||
out+=("^sep($ADD...)")
|
||||
out+=(" $OPENDIR <i>(/usr/share/applications)</i>,${JGMENU_RESOURCE_OPENER} $APPSDIR")
|
||||
out+=("^sep()")
|
||||
for item in "$APPSDIR"/*.desktop; do
|
||||
filename=${item##*/}
|
||||
filename=${filename^}
|
||||
out+=("$ADD <b>${filename%.*}</b>,cp \"$item\" $LAUNCHERDIR;killall -SIGUSR1 tint2;jgtint2launcher")
|
||||
done
|
||||
### RUN
|
||||
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
MENU_PADDING_TOP=48
|
||||
MENU_HALIGN="center"
|
||||
MENU_VALIGN="center"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=340
|
||||
MENU_HEIGHT_MAX=480
|
||||
|
||||
POSITION_MODE=${2:-center}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
printf '%s\n' "${out[@]}"
|
||||
exit 0
|
||||
|
||||
|
||||
955
usr/bin/jgwallpaperchanger
Executable file
955
usr/bin/jgwallpaperchanger
Executable file
@@ -0,0 +1,955 @@
|
||||
#!/bin/bash
|
||||
# jgwallpaperchanger - panel executor/dynamic menu (or submenu) to configure/set wallpapers
|
||||
#
|
||||
|
||||
if [[ $1 == "-r" || "$1" == "-d" ]];then
|
||||
me="${0##*/} -s"
|
||||
else
|
||||
me="${0##*/} ${1:--s}"
|
||||
fi
|
||||
## Favorited wp list
|
||||
FAVWP="$HOME/.config/mabox/wp_fav.csv"
|
||||
|
||||
#SLIDESHOW CONF
|
||||
CONFIG_DIR="$HOME/.config/mbwallpaper"
|
||||
CONF_FILE="$CONFIG_DIR/mbwallpaper.conf"
|
||||
WALLPAPERS_LIST="$CONFIG_DIR/wplist"
|
||||
|
||||
## SYSTEM AND USER SAVED THEMES
|
||||
OB_SYSTHEMES="/usr/share/mabox-colorizer/colorschemes/ob.csv"
|
||||
OB_USERTHEMES="$HOME/.config/colorizer/openbox/userthemes.csv"
|
||||
|
||||
# Make config directory if not exist
|
||||
mkdir -p $CONFIG_DIR
|
||||
|
||||
# If config file not exist create one with defaults
|
||||
if [ ! -f $CONF_FILE ]; then
|
||||
cat <<EOF > ${CONF_FILE}
|
||||
# Directory with wallpapers
|
||||
wallpaper_dir=/usr/share/backgrounds/
|
||||
# Rotate time in seconds
|
||||
interval=10
|
||||
# Tint2 panel executor button left click action
|
||||
t2_button_lclick_action=random
|
||||
EOF
|
||||
fi
|
||||
|
||||
# read config variables from file
|
||||
source <(grep = $CONF_FILE)
|
||||
wallpaper_dir2=${wallpaper_dir/$HOME/\~}
|
||||
#notify-send.sh "Wallpaper Dir" "${wallpaper_dir}"
|
||||
|
||||
wp_icon=${wp_icon:-"wide"}
|
||||
|
||||
#WP_DIRS
|
||||
CNF_FILE="$HOME/.config/mabox/wallp_dirs.conf"
|
||||
if [ ! -f $CNF_FILE ]; then
|
||||
cat <<EOF > ${CNF_FILE}
|
||||
# User wallpapers directories - one per line
|
||||
# Used by "Random", "Choose wallpaper" PCmanFM wrapper, "Slideshow", Preview and set" utils
|
||||
# From File Manager set wallpapers using context (right click) menu
|
||||
~/wallpapers/
|
||||
EOF
|
||||
fi
|
||||
|
||||
lclick(){
|
||||
case $t2_button_lclick_action in
|
||||
random) mbwallpaper -o;;
|
||||
randfav) jgwallpaperchanger randomfav;;
|
||||
choose) pcmanwp;;
|
||||
preview) mbwallpaper -c;;
|
||||
menu) jgwallpaperchanger ipc;;
|
||||
slideshow) run_wallpaperslideshow;;
|
||||
window) ycolorizer;;
|
||||
colmenu) colorizer -s;;
|
||||
*) mbwallpaper -o;;
|
||||
esac
|
||||
}
|
||||
wheelup() {
|
||||
case $t2_button_wheelup_action in
|
||||
random) mbwallpaper -o;;
|
||||
win-switch) skippy-xd --expose;;
|
||||
desk-switch) skippy-xd --paging;;
|
||||
win-prev) skippy-xd --switch --prev;;
|
||||
win-next) skippy-xd --switch --next;;
|
||||
show-desk) show_desktop;;
|
||||
*) show_desktop;;
|
||||
esac
|
||||
}
|
||||
wheeldown() {
|
||||
case $t2_button_wheeldown_action in
|
||||
random) mbwallpaper -o;;
|
||||
win-switch) skippy-xd --expose;;
|
||||
desk-switch) skippy-xd --paging;;
|
||||
win-prev) skippy-xd --switch --prev;;
|
||||
win-next) skippy-xd --switch --next;;
|
||||
show-desk) show_desktop;;
|
||||
*) show_desktop;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
main(){
|
||||
case $LANG in
|
||||
pl*)
|
||||
_TITLE="Tapety i <b>stylizacja</b> pulpitu"
|
||||
_WALLPAPERS="Tapety"
|
||||
_RANDWALL="<b>Losowa</b> tapeta"
|
||||
_FAVORITES="Ulubione..."
|
||||
_FAVORITES_WP="Ulubione tapety"
|
||||
_RAND_FAV="Losowa z Ulubionych"
|
||||
_ADD_FAV="<b>Dodaj bieżącą</b> do Ulubionych"
|
||||
_REMOVE_FROM_FAV="Usuń z Ulubionych"
|
||||
_AND_SET_RANDOM="... i ustaw losową"
|
||||
_YES_REMOVE="Tak, usuń"
|
||||
_EDIT_FAV="Edytuj Ulubione"
|
||||
_DEFAULT_WP="Przywróć <b>domyślną</b>"
|
||||
_EDIT_WPDIRS="Edytuj katalogi z tapetami"
|
||||
_GENERATOR="<b>Generuj</b> <small>(ImageMagick)</small>..."
|
||||
_CHOOSE_WP="<b>Wybierz</b> tapetę..."
|
||||
_OPEN_DIR="Otwórz katalog i..."
|
||||
_USE_CONTEXTMENU="<small>użyj menu kontekstowego</small>"
|
||||
_SLIDESHOW_DESC="Pokaz slajdów"
|
||||
_SLIDESHOW="pokaz slajdów"
|
||||
_ABOUT_SLIDESHOW="O pokazie slajdów"
|
||||
_STARTS="Uruchom Pokaz slajdów <small>(<i>zatrzymany</i>)</small>"
|
||||
_STOPS="Zatrzymaj Pokaz slajdów <small>(<i>działający - interwał: $interval sek.</i>)</small>"
|
||||
_INTERVAL="Interwał slajdów"
|
||||
_INTERVAL_DESC="Interwał Pokazu Slajdów"
|
||||
_SEC="sekund"
|
||||
_WPDIR="Kolekcje tapet"
|
||||
_WPDIRS="Katalogi z tapetami"
|
||||
_WPDIRS_DESC="<small><i>dla <b>losowa</b>/<b>podgląd</b>/<b>pokaz slajdów</b></i></small>"
|
||||
_TOTAL="Razem"
|
||||
_WPS="tapety w"
|
||||
_DIRS="katalogach"
|
||||
_LEFTPANEL="Lewy panel"
|
||||
_OBTHEME="Motyw Openbox"
|
||||
_MENUPANELS="Menu i Panele"
|
||||
_COLORIZER_HELP="Okno główne i Pomoc"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> menu główne"
|
||||
_COLORIZER_FONTS="Konfiguruj <b>Czcionki</b>"
|
||||
_COLORIZER_PICOM="Kompozytor <b>Picom</b>"
|
||||
_COLORIZER_OB="Moduł <b>Openbox</b>"
|
||||
_COLORIZER_MENU="Moduł <b>Menu</b>"
|
||||
_COLORIZER_CONKY="<b>Menadżer</b> Widżetów <b>Conky</b>"
|
||||
_COLORIZER_PYRADIO="Moduł <b>PyRadio</b>"
|
||||
_COLORIZER_CAVA="Moduł <b>Cava</b>"
|
||||
_PANEL_ICON_ACTIONS="Ikona na panelu i akcje"
|
||||
_WIDE_ICON="Szeroka ikona"
|
||||
|
||||
_B_LC_ACTION="lewy klik"
|
||||
_B_LC_ACTION="<i>lewy-klik</i>"
|
||||
_P_B_LC_ACTION="Po lewym kliku w przycisk na panelu"
|
||||
_B_WU_ACTION="<i>kółko-w-górę</i>"
|
||||
_P_B_WU_ACTION="Akcja dla kółko-w-górę"
|
||||
_B_WD_ACTION="<i>kółko-w-dół</i>"
|
||||
_P_B_WD_ACTION="Akcja dla kółko w dół"
|
||||
_RAND="losuj"
|
||||
_CHOOSE="wybierz"
|
||||
_WALL_MENU="menu tapet"
|
||||
_WALL_MENU_DESC="Menu Tapet"
|
||||
_PREVIEW="podgląd"
|
||||
_COL_WINDOW="okno"
|
||||
_COL_MENU="menu"
|
||||
_SHOW_DESK="show-desk"
|
||||
_WIN_SWITCH="win-switch"
|
||||
_DESK_SWITCH="desk-switch"
|
||||
_RANDOM_DESC="Ustaw <b>losową</b> tapetę"
|
||||
_RANDOMFAV_DESC="Ustaw <b>losową</b> z <b>ulubionych</b>"
|
||||
_CHOOSE_DESC="<b>Wybierz</b> tapetę (z menu kontekstowego)"
|
||||
_PREVIEW_DESC="<b>Podgląd</b> <i>użyj</i> <span bgcolor='#333333' color='#d3d3d3'> <small></small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small></small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small>Enter</small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small>Esc</small> </span>"
|
||||
_COL_WINDOW_DESC="Colorizer - <b>okno</b>"
|
||||
_COL_MENU_DESC="Colorizer - dynamiczne <b>menu</b>"
|
||||
_SHOW_DESK_DESC="Pokaż pulpit"
|
||||
_WIN_SWITCH_DESC="Wybierz Okno (skippy-xd)"
|
||||
_DESK_SWITCH_DESC="Wybierz Pulpit (skippy-xd)"
|
||||
_GOBACK="<i>powrót</i>"
|
||||
|
||||
_AUTOTHEMING="Auto theming (beta)"
|
||||
_ON_WP_CHANGE="(po zmianie tapety)"
|
||||
_AUTOTH_SETTINGS="Ustawienia Auto theming"
|
||||
_APPLY_COLORSCHEME_TO="Zastosuj kolory tapety do..."
|
||||
_APPLY_TO_ALL="<b>Wszystko</b>"
|
||||
_APPLY_REVERSE="<b>Wszystko</b> odwrotnie (jasny 易 ciemny)"
|
||||
_APPLY_ONLY_TO="Zastosuj tylko do..."
|
||||
_RESET_WP_THEMES="Reset tapety i motywów"
|
||||
_ENABLED="włączony"
|
||||
_DISABLED="wyłączony"
|
||||
_LIGHTBG="<b>jasny</b> wariant"
|
||||
_DARKBG="<b>ciemny</b> wariant"
|
||||
_NONE="<b>none</b> wyłączone"
|
||||
|
||||
_DESKTOP_STYLING="Stylizacja Pulpitu"
|
||||
_OB_WD="<b>OpenBox</b> Dekoracje Okien"
|
||||
_MABOX_MENUS=" <b>Menu</b> Maboxa"
|
||||
SYSTEM_THEMES="Systemowe"
|
||||
YOUR_THEMES="Moje motywy"
|
||||
SAVE_CURRTHEME="Zapisz aktualną kobfigurację jako..."
|
||||
OPEN_THEMEFILE="Odwórz plik z motywami w edytorze"
|
||||
THEME="Motyw"
|
||||
APPLY="Zastosuj"
|
||||
APPLY_THEME="Pełny motyw (kolory, czcionki i rozmiar)"
|
||||
APPLY_SCHEME="Tylko kolory"
|
||||
DELETE="Usuń"
|
||||
DELETE_THEME="Usuń motyw"
|
||||
OBTHEME_LBL="Motyw OpenBox"
|
||||
MONOCHROMATIC="Monochromatyczny"
|
||||
CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..."
|
||||
GENERATEFROMWP="Generuj z kolorów tapety..."
|
||||
EXACT="Dokładny"
|
||||
LIGHTBG="Jasne tło"
|
||||
DARKBG="Ciemne tło"
|
||||
RANDOMIZE="Generuj losowo"
|
||||
|
||||
;;
|
||||
*)
|
||||
_TITLE="Wallpaper & Desktop <b>styling</b>"
|
||||
_WALLPAPERS="Wallpapers"
|
||||
_RANDWALL="<b>Random</b> Wallpaper"
|
||||
_FAVORITES="Favorite..."
|
||||
_FAVORITES_WP="Favorite Wallpapers"
|
||||
_RAND_FAV="Random from Favorites"
|
||||
_ADD_FAV="<b>Add current</b> to favorites"
|
||||
_REMOVE_FROM_FAV="Remove from Favorites"
|
||||
_AND_SET_RANDOM="... and set random"
|
||||
_YES_REMOVE="Yes, remove"
|
||||
_EDIT_FAV="Edit Favorites"
|
||||
_DEFAULT_WP="Restore <b>default</b>"
|
||||
_EDIT_WPDIRS="Edit Wallpaper dirs"
|
||||
_GENERATOR="<b>Generate</b> <small>(ImageMagick)</small>..."
|
||||
_CHOOSE_WP="<b>Choose</b> Wallpaper"
|
||||
_OPEN_DIR="Open directory and..."
|
||||
_USE_CONTEXTMENU="<small>use context menu</small>"
|
||||
_SLIDESHOW_DESC="Wallpaper <b>Slideshow</b>"
|
||||
_SLIDESHOW="slideshow"
|
||||
_ABOUT_SLIDESHOW="About Slideshow"
|
||||
_STARTS="Start Slideshow <small>(<i>stopped</i>)</small>"
|
||||
_STOPS="Stop Slideshow <small>(<i>running - interval: $interval sec.</i>)</small>"
|
||||
_INTERVAL="Interval"
|
||||
_INTERVAL_DESC="Slideshow Interval"
|
||||
_SEC="seconds"
|
||||
_WPDIR="Wallpaper <b>Collections</b>"
|
||||
_WPDIRS="Directories with Wallpapers"
|
||||
_WPDIRS_DESC="<small><i>for <b>random</b>/<b>preview</b>/<b>slideshow</b> utils</i></small>"
|
||||
_TOTAL="Total"
|
||||
_WPS="wallpapers in"
|
||||
_DIRS="dirs"
|
||||
_LEFTPANEL="Left panel"
|
||||
_OBTHEME="Openbox Theme"
|
||||
_MENUPANELS="Menus/Panels"
|
||||
_COLORIZER_CONKY="<b>Conky</b> Widget <b>Manager</b>"
|
||||
_COLORIZER_HELP="Main Window and Help"
|
||||
_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
|
||||
_COLORIZER_FONTS="Configure <b>Fonts</b>"
|
||||
_COLORIZER_PICOM="<b>Compositor</b> settings <b>(Picom)</b>"
|
||||
_PANEL_ICON_ACTIONS="Panel icon and actions"
|
||||
_WIDE_ICON="Wide icon"
|
||||
_B_LC_ACTION="<i>left-click</i>"
|
||||
_P_B_LC_ACTION="Panel icon left-click action"
|
||||
_B_WU_ACTION="<i>wheel-up</i>"
|
||||
_P_B_WU_ACTION="Panel icon wheel-up action"
|
||||
_B_WD_ACTION="<i>wheel-down</i>"
|
||||
_P_B_WD_ACTION="Panel icon wheel-down action"
|
||||
_RAND="random"
|
||||
_CHOOSE="choose"
|
||||
_WALL_MENU="wallmenu"
|
||||
_WALL_MENU_DESC="Wallpaper Menu"
|
||||
_PREVIEW="preview and set"
|
||||
_COL_WINDOW="window"
|
||||
_COL_MENU="menu"
|
||||
_SHOW_DESK="show-desk"
|
||||
_WIN_SWITCH="win-switch"
|
||||
_DESK_SWITCH="desk-switch"
|
||||
_RANDOM_DESC="Set <b>random</b> wallpaper"
|
||||
_RANDOMFAV_DESC="Set <b>random</b> from <b>favorites</b>"
|
||||
_CHOOSE_DESC="<b>Choose</b> wallpaper (<i>from context menu</i>)"
|
||||
_PREVIEW_DESC="<b>Preview</b> & set <i>use</i> <span bgcolor='#333333' color='#d3d3d3'> <small></small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small></small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small>Enter</small> </span> <span bgcolor='#333333' color='#d3d3d3'> <small>Esc</small> </span>"
|
||||
_COL_WINDOW_DESC="Colorizer - <b>window</b>"
|
||||
_COL_MENU_DESC="Colorizer - dynamic <b>menu</b>"
|
||||
_SHOW_DESK_DESC="Toggle ShowDesktop"
|
||||
_WIN_SWITCH_DESC="Windows Switcher (skippy-xd)"
|
||||
_DESK_SWITCH_DESC="Desktop Switcher (skippy-xd)"
|
||||
_GOBACK="<i>go back</i>"
|
||||
|
||||
_AUTOTHEMING="Auto theming (beta)"
|
||||
_ON_WP_CHANGE="(on wallpaper change)"
|
||||
_AUTOTH_SETTINGS="Auto theming settings"
|
||||
_APPLY_COLORSCHEME_TO="Apply wallpaper colors to..."
|
||||
_APPLY_TO_ALL="<b>All</b> elements"
|
||||
_APPLY_REVERSE="<b>All</b> elements inversely (dark 易 light)"
|
||||
_APPLY_ONLY_TO="Apply only to..."
|
||||
_RESET_WP_THEMES="Reset (wallpaper and themes)"
|
||||
_ENABLED="enabled"
|
||||
_DISABLED="disabled"
|
||||
_LIGHTBG="<b>light</b> variant"
|
||||
_DARKBG="<b>dark</b> variant"
|
||||
_NONE="<b>none</b> (disabled)"
|
||||
|
||||
_DESKTOP_STYLING="Desktop styling"
|
||||
_OB_WD="<b>OpenBox</b> Window Decorations"
|
||||
_MABOX_MENUS="Mabox <b>Menus</b>"
|
||||
_CHANGE_THEME="Change theme"
|
||||
_CLICK_TO_APPLY="<i>click to apply</i>"
|
||||
SYSTEM_THEMES="System themes..."
|
||||
YOUR_THEMES="Your themes..."
|
||||
THEME="Theme"
|
||||
_GENERATE="Generate..."
|
||||
MONOCHROMATIC="Monochromatic <i>(pick color)</i>"
|
||||
CHOOSE_AND_PICK="Choose variant and pick color..."
|
||||
GENERATEFROMWP="...from wallpaper colors..."
|
||||
EXACT="exact"
|
||||
LIGHTBG="light variant"
|
||||
DARKBG="dark variant"
|
||||
RANDOMIZE="Random"
|
||||
_MORE_OPTIONS="<i>need more options?</i>"
|
||||
_COLOR_TUNING="<i>color tuning?</i>"
|
||||
_SAVE_OWN="<i>save/delete own themes?</i>"
|
||||
_USE="<i>use...</i>"
|
||||
;;
|
||||
esac
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
help="\nBased on <a href='https://forum.maboxlinux.org/t/chwp-desktop-wallpaper-changer/496'>idea</a> of Mabox forum member Shwaybo.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n"
|
||||
|
||||
# WALLPAPER FAVORITES
|
||||
if [[ ! -f "${FAVWP}" ]];then
|
||||
cat <<EOF > ${FAVWP}
|
||||
# Favorite wallpapers
|
||||
# LABEL(NAME),PATH_TO_WALLPAPER_FILE
|
||||
EOF
|
||||
fi
|
||||
# Wallpath
|
||||
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2)
|
||||
wallpap=${WALLPATH/$HOME/\~}
|
||||
|
||||
#notify-send.sh "Wallpaper" "$wallpap"
|
||||
# Read favorites
|
||||
fav=0
|
||||
isfav=0
|
||||
while IFS=, read -r label wpfile
|
||||
do
|
||||
if [[ "${wallpap}" == "${wpfile}" ]];then
|
||||
#notify-send.sh "FAV" "${wpfile}"
|
||||
favs+=("\"\"\"<big>綠</big> ${label}\"\"\",^checkout(delfav)")
|
||||
out3+=("^tag(delfav)")
|
||||
out3+=("^sep($_REMOVE_FROM_FAV)")
|
||||
out3+=("^sep(<small>$_AND_SET_RANDOM ?</small>)")
|
||||
out3+=("\"\"\"$_YES_REMOVE <b>${label}</b>\"\"\",jgwallpaperchanger remfav ${wpfile:1};$me")
|
||||
isfav=1
|
||||
else
|
||||
favs+=("\"\"\"<big>祿</big> ${label}\"\"\",nitrogen --set-scaled --save $wpfile;$me")
|
||||
fi
|
||||
((fav++))
|
||||
done < <(sort $FAVWP |grep -v '^\s*$\|^#\|^\s*#')
|
||||
#done < <(grep -v '^\s*$\|^#\|^\s*#' "$FAVWP")
|
||||
|
||||
out+=("^sep($_WALLPAPERS)")
|
||||
[[ "$1" == "-s" || "$1" == "ipc" || "$1" == "-d" ]] && : || out+=("^sep($_WALLPAPERS)")
|
||||
if ! pgrep -f "mbwallpaper -s" > /dev/null; then
|
||||
#out+=("$NITROGEN,nitrogen")
|
||||
out+=("<big></big> $_RANDWALL,mbwallpaper -o;$me")
|
||||
out+=("<span fgcolor='red'><big></big></span> $_FAVORITES [ <b>$fav</b> ],^checkout(favwp)")
|
||||
out2+=("^tag(favwp)")
|
||||
out2+=("^sep($_FAVORITES_WP)")
|
||||
if [[ "$wallpap" != "/usr/share/backgrounds/marek-piwnicki-FgagFhxW4Sc-unsplash.jpg" ]]; then
|
||||
out2+=("<big></big> $_DEFAULT_WP,nitrogen --set-scaled --save /usr/share/backgrounds/marek-piwnicki-FgagFhxW4Sc-unsplash.jpg;$me")
|
||||
out2+=("^sep()")
|
||||
|
||||
else
|
||||
isfav=1
|
||||
fi
|
||||
out2+=("<big></big> $_RAND_FAV,jgwallpaperchanger randomfav;$me")
|
||||
out2+=("^sep()")
|
||||
|
||||
if [[ "${isfav}" != "1" ]];then
|
||||
out2+=("<span fgcolor='red'><big></big></span> $_ADD_FAV,jgwallpaperchanger addfav ${wallpap};$me")
|
||||
out2+=("^sep()")
|
||||
fi
|
||||
out2+=("${favs[@]}")
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> $_EDIT_FAV,xdg-open $FAVWP")
|
||||
|
||||
|
||||
|
||||
#out+=("<big></big> $_CHOOSE_WP,pcmanwp")
|
||||
out+=("<big></big> $_CHOOSE_WP,^checkout(choosefromdirs)")
|
||||
out2+=("^tag(choosefromdirs)")
|
||||
out2+=("^sep($_OPEN_DIR)")
|
||||
out2+=("^sep($_USE_CONTEXTMENU)")
|
||||
### Needed for CHOOSE_WP and WPDIRS (Collections)
|
||||
readarray -t wpdirs < <(grep -v '^\s*$\|^#\|^\s*\#' "$CNF_FILE")
|
||||
|
||||
[[ -d "$(xdg-user-dir PICTURES)/imagick" ]] && wallp=$(shopt -s nullglob ; set -- $(xdg-user-dir PICTURES)/imagick/*.{jpg,JPG,jpeg,JPEG,png,PNG,webp,WEBP,avif,AVIF} ; echo $#)
|
||||
if [[ "$wallp" -gt "1" ]];then
|
||||
imagickdir="$(xdg-user-dir PICTURES)/imagick"
|
||||
imagickdir=${imagickdir/$HOME/\~}
|
||||
wpdirs=("$imagickdir" "${wpdirs[@]}")
|
||||
fi
|
||||
|
||||
wpdirs=("/usr/share/backgrounds/" "${wpdirs[@]}")
|
||||
|
||||
wpimgs=0
|
||||
for dir in "${wpdirs[@]}"
|
||||
do
|
||||
wpdir=${dir/\~/$HOME}
|
||||
wallp=$(shopt -s nullglob ; set -- $wpdir/*.{jpg,JPG,jpeg,JPEG,png,PNG,avif,AVIF,webp,WEBP} ; echo $#)
|
||||
out2+=("<small>(${wallp})</small> ${dir},pcmanfm ${dir}")
|
||||
wpimgs=$((wpimgs+wallp))
|
||||
done
|
||||
|
||||
out+=("^sep()")
|
||||
out+=("<big>易</big> $_PREVIEW_DESC,mbwallpaper -c")
|
||||
out+=("<big></big> $_SLIDESHOW_DESC,^checkout(sshow)")
|
||||
out+=("<big></big> $_GENERATOR,^pipe(jgwallpapergenerate)")
|
||||
out+=("^sep()")
|
||||
|
||||
out2+=("^tag(wpdirs)")
|
||||
out2+=("^sep($_WPDIRS)")
|
||||
out2+=("^sep($_WPDIRS_DESC)")
|
||||
|
||||
|
||||
#notify-send.sh "DIRS" "${#wpdirs[@]}"
|
||||
|
||||
|
||||
wpimgs=0
|
||||
for dir in "${wpdirs[@]}"
|
||||
do
|
||||
wpdir=${dir/\~/$HOME}
|
||||
wallp=$(shopt -s nullglob ; set -- $wpdir/*.{jpg,JPG,jpeg,JPEG,png,PNG,avif,AVIF,webp,WEBP} ; echo $#)
|
||||
[[ "$wallpaper_dir2" == "${dir}" ]] && out2+=("<big>綠</big> <small>(${wallp})</small> <b>${dir}</b>") || out2+=("<big>祿</big> <small>(${wallp})</small> ${dir},mbwallpaper changedir ${dir};$me")
|
||||
wpimgs=$((wpimgs+wallp))
|
||||
done
|
||||
out2+=("^sep($_TOTAL: <b>$wpimgs</b> $_WPS <b>${#wpdirs[@]}</b> $_DIRS)")
|
||||
out2+=("<big></big> $_EDIT_WPDIRS,xdg-open $CNF_FILE")
|
||||
out+=("<big></big> $_WPDIR [ <b>${#wpdirs[@]}</b> ],^checkout(wpdirs)")
|
||||
|
||||
else
|
||||
out+=("<big></big> $_STOPS,killall mbwallpaper;pkill -f 'yad --not';$me")
|
||||
fi
|
||||
|
||||
|
||||
out1+=("^tag(sshow)")
|
||||
out1+=("^sep($_SLIDESHOW_DESC)")
|
||||
out1+=("<big></big> $_STARTS,run_wallpaperslideshow")
|
||||
out1+=("^sep($_INTERVAL_DESC)")
|
||||
[[ "${interval}" == "10" ]] && out1+=("<big>綠</big> 10s,mb-setvar interval=10 $CONF_FILE;$me") || out1+=("<big>祿</big> 10s,mb-setvar interval=10 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "30" ]] && out1+=("<big>綠</big> 30s,mb-setvar interval=30 $CONF_FILE;$me") || out1+=("<big>祿</big> 30s,mb-setvar interval=30 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "60" ]] && out1+=("<big>綠</big> 1m ,mb-setvar interval=60 $CONF_FILE;$me") || out1+=("<big>祿</big> 1m,mb-setvar interval=60 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "120" ]] && out1+=("<big>綠</big> 2m ,mb-setvar interval=120 $CONF_FILE;$me") || out1+=("<big>祿</big> 2m,mb-setvar interval=120 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "300" ]] && out1+=("<big>綠</big> 5m ,mb-setvar interval=300 $CONF_FILE;$me") || out1+=("<big>祿</big> 5m,mb-setvar interval=300 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "600" ]] && out1+=("<big>綠</big> 10m ,mb-setvar interval=600 $CONF_FILE;$me") || out1+=("<big>祿</big> 10m,mb-setvar interval=600 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "900" ]] && out1+=("<big>綠</big> 15m ,mb-setvar interval=900 $CONF_FILE;$me") || out1+=("<big>祿</big> 15m,mb-setvar interval=900 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "1800" ]] && out1+=("<big>綠</big> 30m ,mb-setvar interval=1800 $CONF_FILE;$me") || out1+=("<big>祿</big> 30m,mb-setvar interval=1800 $CONF_FILE;$me")
|
||||
[[ "${interval}" == "3600" ]] && out1+=("<big>綠</big> 1h ,mb-setvar interval=3600 $CONF_FILE;$me") || out1+=("<big>祿</big> 1h,mb-setvar interval=3600 $CONF_FILE;$me")
|
||||
#out1+=("<big></big> $EDITCONF ,xdg-open $CONF_FILE")
|
||||
#out1+=("<big></big> $OPENDIR,pcmanfm -n $wallpaper_dir")
|
||||
out1+=("^sep()")
|
||||
out1+=("$_ABOUT_SLIDESHOW,\"\"\"notify-send.sh -u critical -i mbcc 'Wallpaper Changer - rotate desktop wallpaper every n-seconds' \"$help\" \"\"\"")
|
||||
|
||||
#WALLPAPER and wallpaper colors
|
||||
WALLPALDIR="$HOME/.cache/colorizer/palettes"
|
||||
|
||||
THUMBDIR="$HOME/.cache/colorizer/thumbs"
|
||||
mkdir -p ${THUMBDIR}
|
||||
NAME=${WALLPATH////_}
|
||||
if [[ "${NAME}" =~ ^_home_.* ]]; then
|
||||
n=${#HOME}
|
||||
((n++))
|
||||
NAME=${NAME:${n}}
|
||||
fi
|
||||
ext="${WALLPATH##*.}"
|
||||
THUMB="${THUMBDIR}/${NAME}.png"
|
||||
if [[ ! -f "$THUMB" ]]; then
|
||||
magick ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
|
||||
fi
|
||||
# wp colors
|
||||
if [ ! -f "$WALLPALDIR/$NAME.clr" ]; then
|
||||
if [ "$ext" == "avif" ];then
|
||||
magick ${WALLPATH} -resize 25% /tmp/out.jpg
|
||||
magick /tmp/out.jpg -colors 12 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
|
||||
else
|
||||
magick ${WALLPATH} -resize 25% -colors 12 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr"
|
||||
fi
|
||||
fi
|
||||
|
||||
mapfile -t w < "$WALLPALDIR/$NAME.clr"
|
||||
#if [[ "${#w[@]}" -lt 8 ]]; then
|
||||
#w+=("#2e3440" "#4c566a" "#5e81ac" "#bf616b" "#b48ead" "#a3be8c" "#ebcb8b" "#d8dee9" "#eceff4")
|
||||
#fi
|
||||
|
||||
### AUT0 THEMING
|
||||
### AUTOTHEMING
|
||||
COLORIZER_CONF="$HOME/.config/colorizer/colorizer.conf"
|
||||
source ${COLORIZER_CONF}
|
||||
|
||||
out+=("^sep($_AUTOTHEMING)")
|
||||
out+=("^sep(<i><small>$_ON_WP_CHANGE</small></i>)")
|
||||
|
||||
out+=("<big></big> $_APPLY_COLORSCHEME_TO,^checkout(applyto)")
|
||||
out2+=("^tag(applyto)")
|
||||
[[ "${2}" == "applyto" ]] && out2+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
out2+=("^sep($_APPLY_COLORSCHEME_TO)")
|
||||
out2+=("<big></big> $_APPLY_TO_ALL,w2theme colorize;$me applyto")
|
||||
out2+=("<big>敏</big> $_APPLY_REVERSE,w2theme reverse;$me applyto")
|
||||
out2+=("^sep($_APPLY_ONLY_TO)")
|
||||
out2+=("^sep(Menu)")
|
||||
out2+=(" $_LIGHTBG,w2theme menu light;$me applyto")
|
||||
out2+=(" $_LIGHTBG 2,w2theme menu light2;$me applyto")
|
||||
out2+=(" $_DARKBG,w2theme menu dark;$me applyto")
|
||||
out2+=(" $_DARKBG 2,w2theme menu dark2;$me applyto")
|
||||
out2+=("^sep(Conky)")
|
||||
out2+=(" $_LIGHTBG,w2theme conky light;$me applyto")
|
||||
out2+=(" $_DARKBG,w2theme conky dark;$me applyto")
|
||||
out2+=("^sep(OpenBox)")
|
||||
out2+=(" $_LIGHTBG,w2theme ob light;$me applyto")
|
||||
out2+=(" $_DARKBG,w2theme ob dark;$me applyto")
|
||||
[[ "${2}" == "applyto" ]] && out2+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
|
||||
out+=("^sep()")
|
||||
|
||||
|
||||
[[ "$wall2themes" == "yes" ]] && out+=("<big></big> $_AUTOTH_SETTINGS,^checkout(autotheming)") || out+=("<big></big> $_AUTOTH_SETTINGS,^checkout(autotheming)")
|
||||
|
||||
out2+=("^tag(autotheming)")
|
||||
[[ "${2}" == "autoth" ]] && out2+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
out2+=("^sep($_AUTOTH_SETTINGS (beta))")
|
||||
[[ "$wall2themes" == "yes" ]] && out2+=("<big>綠</big> $_ENABLED") || out2+=("<big>祿</big> $_ENABLED,mb-setvar wall2themes=yes $COLORIZER_CONF;$me")
|
||||
[[ "$wall2themes" != "yes" ]] && out2+=("<big>綠</big> $_DISABLED") || out2+=("<big>祿</big> $_DISABLED,mb-setvar wall2themes=no $COLORIZER_CONF;$me")
|
||||
|
||||
out2+=("^sep(<i>OpenBox</i>)")
|
||||
[[ "$wall2themes_ob" == "light" ]] && out2+=("<big>綠</big> $_LIGHTBG") || out2+=("<big>祿</big> $_LIGHTBG,mb-setvar wall2themes_ob=light $COLORIZER_CONF;$me autoth")
|
||||
[[ "$wall2themes_ob" == "dark" ]] && out2+=("<big>綠</big> $_DARKBG") || out2+=("<big>祿</big> $_DARKBG,mb-setvar wall2themes_ob=dark $COLORIZER_CONF;$me autoth")
|
||||
out2+=("^sep()")
|
||||
[[ "$wall2themes_ob" == "none" ]] && out2+=("<big>綠</big> $_NONE") || out2+=("<big>祿</big> $_NONE,mb-setvar wall2themes_ob=none $COLORIZER_CONF;$me autoth")
|
||||
out2+=("^sep(<i>Menu</i>)")
|
||||
[[ "$wall2themes_menu" == "light" ]] && out2+=("<big>綠</big> $_LIGHTBG") || out2+=("<big>祿</big> $_LIGHTBG,mb-setvar wall2themes_menu=light $COLORIZER_CONF;$me autoth")
|
||||
[[ "$wall2themes_menu" == "dark" ]] && out2+=("<big>綠</big> $_DARKBG") || out2+=("<big>祿</big> $_DARKBG,mb-setvar wall2themes_menu=dark $COLORIZER_CONF;$me autoth")
|
||||
out2+=("^sep()")
|
||||
[[ "$wall2themes_menu" == "none" ]] && out2+=("<big>綠</big> $_NONE") || out2+=("<big>祿</big> $_NONE,mb-setvar wall2themes_menu=none $COLORIZER_CONF;$me autoth")
|
||||
out2+=("^sep(<i>Conky</i>)")
|
||||
[[ "$wall2themes_conky" == "light" ]] && out2+=("<big>綠</big> $_LIGHTBG") || out2+=("<big>祿</big> $_LIGHTBG,mb-setvar wall2themes_conky=light $COLORIZER_CONF;$me autoth")
|
||||
[[ "$wall2themes_conky" == "dark" ]] && out2+=("<big>綠</big> $_DARKBG") || out2+=("<big>祿</big> $_DARKBG,mb-setvar wall2themes_conky=dark $COLORIZER_CONF;$me autoth")
|
||||
out2+=("^sep()")
|
||||
[[ "$wall2themes_conky" == "none" ]] && out2+=("<big>綠</big> $_NONE") || out2+=("<big>祿</big> $_NONE,mb-setvar wall2themes_conky=none $COLORIZER_CONF;$me autoth")
|
||||
|
||||
out2+=("^sep(PyRadio / Cava)")
|
||||
out2+=("PyRadio and Cava,^checkout(pycava)")
|
||||
out3+=("^tag(pycava)")
|
||||
out3+=("^sep(Pyradio)")
|
||||
[[ "$wall2themes_pyradio" == "light" ]] && out3+=("<big>綠</big> $_LIGHTBG") || out3+=("<big>祿</big> $_LIGHTBG,mb-setvar wall2themes_pyradio=light $COLORIZER_CONF;$me autoth")
|
||||
[[ "$wall2themes_pyradio" == "dark" ]] && out3+=("<big>綠</big> $_DARKBG") || out3+=("<big>祿</big> $_DARKBG,mb-setvar wall2themes_pyradio=dark $COLORIZER_CONF;$me autoth")
|
||||
out3+=("^sep()")
|
||||
[[ "$wall2themes_pyradio" == "none" ]] && out3+=("<big>綠</big> $_NONE") || out3+=("<big>祿</big> $_NONE,mb-setvar wall2themes_pyradio=none $COLORIZER_CONF;$me autoth")
|
||||
out3+=("^sep(Cava)")
|
||||
out3+=("^sep(<small><i>not implemented yet</i></small>)")
|
||||
out3+=("Use Colorizer Cava,colorizer-cava -s")
|
||||
|
||||
|
||||
palettes=$(shopt -s nullglob ; set -- $WALLPALDIR/*.clr ; echo $#)
|
||||
if [[ "$palettes" -gt "1" ]];then
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> Remove cached palletes (<b>$palettes</b>),rm $WALLPALDIR/*.clr;$me")
|
||||
fi
|
||||
|
||||
[[ "${2}" == "autoth" ]] && out2+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
out+=("^sep()")
|
||||
out+=("<big></big> $_RESET_WP_THEMES,w2theme resetall;$me")
|
||||
|
||||
|
||||
### STYLES
|
||||
out+=("^sep($_DESKTOP_STYLING)")
|
||||
out+=("<big></big> $_OB_WD,^checkout(obox)")
|
||||
out+=("<big></big> $_MABOX_MENUS,^checkout(jgmenus)")
|
||||
|
||||
case "$2" in
|
||||
obox)option="--checkout=obox";;
|
||||
jgmenus)option="--checkout=jgmenus";;
|
||||
conky)option="--checkout=conky";;
|
||||
autoth)option="--checkout=autotheming";;
|
||||
applyto)option="--checkout=applyto";;
|
||||
*)option="";;
|
||||
esac
|
||||
|
||||
## OPENBOX
|
||||
out1+=("^tag(obox)")
|
||||
out1+=("^sep($_OB_WD)")
|
||||
[[ "${2}" == "obox" ]] && out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
|
||||
out1+=("^sep($SYSTEM_THEMES)" "^sep()")
|
||||
n=1
|
||||
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
out1+=("<big><span bgcolor='${abg}' fgcolor='${afg}'><span bgcolor='${abgto}'> </span><small> <tt>$(printf '%-20s' "${scheme_name}")</tt> </small><span bgcolor='${abgto}'> </span></span> <span bgcolor='${nbgto}'> </span><span bgcolor='${nbg}' fgcolor='${nfg}'><small> <tt><i>in</i></tt> </small></span><span bgcolor='${nbgto}'> </span></big>,obtctl applytheme sys ${n};$me obox" "^sep()")
|
||||
done < <(tail -n +2 "$OB_SYSTHEMES")
|
||||
|
||||
# OB User themes
|
||||
if [ "$(grep -c ^ $OB_USERTHEMES)" -gt "1" ];then
|
||||
out1+=("^sep($YOUR_THEMES)" "^sep()")
|
||||
n=1
|
||||
while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
out1+=("<big><span bgcolor='${abg}' fgcolor='${afg}'><span bgcolor='${abgto}'> </span><small> <tt>$(printf '%-20s' "${scheme_name}")</tt> </small><span bgcolor='${abgto}'> </span></span> <span bgcolor='${nbgto}'> </span><span bgcolor='${nbg}' fgcolor='${nfg}'><small> <tt><i>in</i></tt> </small></span><span bgcolor='${nbgto}'> </span></big>,obtctl applytheme usr ${n};$me obox" "^sep()")
|
||||
done < <(tail -n +2 "$OB_USERTHEMES")
|
||||
fi
|
||||
|
||||
out1+=("^sep($_GENERATE)")
|
||||
out1+=("<big></big> $RANDOMIZE,obtctl randomizer;$me obox")
|
||||
out1+=("<big></big> $MONOCHROMATIC,^checkout(monoch)")
|
||||
out2+=("^tag(monoch)")
|
||||
out2+=("^sep(<i>$CHOOSE_AND_PICK</i>)")
|
||||
out2+=("<big></big> $LIGHTBG...,obtctl mono pick light stylemenu")
|
||||
out2+=("<big></big> $DARKBG...,obtctl mono pick dark stylemenu")
|
||||
out1+=("^sep(<i>$GENERATEFROMWP</i>)" "^sep()")
|
||||
out1+=("<big></big> <span bgcolor='${w[-2]}' fgcolor='#222222'> <span bgcolor='${w[-4]}'> </span> $LIGHTBG <span bgcolor='${w[-4]}'> </span> </span>,w2theme ob light;$me obox" "^sep()")
|
||||
out1+=("<big></big> <span bgcolor='${w[2]}' fgcolor='#E5E5E5'> <span bgcolor='${w[4]}'> </span> $DARKBG <span bgcolor='${w[4]}'> </span> </span>,w2theme ob dark;$me obox")
|
||||
out1+=("^sep()")
|
||||
|
||||
out1+=("^sep($_MORE_OPTIONS)")
|
||||
out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)")
|
||||
out1+=("$_USE <b>Colorizer OpenBox</b>,colorizer-ob -s")
|
||||
[[ "${2}" == "obox" ]] && out1+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
|
||||
|
||||
## JGMENUS
|
||||
MENU_SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/menus.csv"
|
||||
MENU_USERSCHEMES="$HOME/.config/colorizer/menus/userschemes2.csv"
|
||||
JG_SYS_AMOUNT=$(cat $MENU_SYSSCHEMES |wc -l)
|
||||
JG_USR_AMOUNT=$(cat $MENU_USERSCHEMES |wc -l)
|
||||
out1+=("^tag(jgmenus)")
|
||||
out1+=("^sep($_MENUPANELS)")
|
||||
[[ "${2}" == "jgmenus" ]] && out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
out1+=("^sep($_CHANGE_THEME)")
|
||||
#out1+=("<big></big> $SYSTEM_THEMES ($((JG_SYS_AMOUNT-1))),^checkout(jg_sys)")
|
||||
#out2+=("^tag(jg_sys)")
|
||||
#out2+=("^sep($_CLICK_TO_APPLY)")
|
||||
|
||||
n=1
|
||||
while IFS="|" read -r mbg mbga mbgt mbgta mborder mbordera tbg tbga tfg tfga tborder tbordera normbg normbga nfg nfga sbg sbga sfg sfga sborder sbordera sepfg sepfga b r p ss ibor irad a al sephal grad scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
case "$grad" in
|
||||
none)icon="";;
|
||||
top)icon="";;
|
||||
right)icon="";;
|
||||
bottom)icon="";;
|
||||
left)icon="";;
|
||||
top_left)icon="";;
|
||||
top_right)icon="";;
|
||||
bottom_left)icon="";;
|
||||
bottom_right)icon="";;
|
||||
esac
|
||||
out1+=("<big><span bgcolor='${mbg}' fgcolor='${nfg}'> <tt><small>$(printf '%-18s' "${scheme_name}")</small></tt><span bgcolor='${tbg}' fgcolor='${tfg}'> <small><b>title</b></small> </span> <span bgcolor='${sbg}' fgcolor='${sfg}'> <small>[ sel ]</small> </span> <span bgcolor='${mbgt}'> <small>${icon}</small> </span></span></big>,jgctl applyscheme sys $n;$me jgmenus" "^sep()")
|
||||
done < <(tail -n +2 "$MENU_SYSSCHEMES")
|
||||
|
||||
# Menu User schemes
|
||||
if [ "$(grep -c ^ $MENU_USERSCHEMES)" -gt "1" ];then
|
||||
out1+=("^sep()")
|
||||
out1+=("<big></big> $YOUR_THEMES ($((JG_USR_AMOUNT-1))),^checkout(jg_usr)")
|
||||
out2+=("^tag(jg_usr)")
|
||||
out2+=("^sep($_CLICK_TO_APPLY)")
|
||||
n=1
|
||||
while IFS="|" read -r mbg mbga mbgt mbgta mborder mbordera tbg tbga tfg tfga tborder tbordera normbg normbga nfg nfga sbg sbga sfg sfga sborder sbordera sepfg sepfga b r p ss ibor irad a al sephal grad scheme_name
|
||||
do
|
||||
((n=n+1))
|
||||
case "$grad" in
|
||||
none)icon="";;
|
||||
top)icon="";;
|
||||
right)icon="";;
|
||||
bottom)icon="";;
|
||||
left)icon="";;
|
||||
top_left)icon="";;
|
||||
top_right)icon="";;
|
||||
bottom_left)icon="";;
|
||||
bottom_right)icon="";;
|
||||
esac
|
||||
out2+=("<big><span bgcolor='${mbg}' fgcolor='${nfg}'> <small><tt>$(printf '%-18s' "${scheme_name}")</tt></small><span bgcolor='${tbg}' bgalpha='${tbga}%' fgcolor='${tfg}'> <small><b>title</b></small> </span> <span bgcolor='${sbg}' bgalpha='${sbga}%' fgcolor='${sfg}'> <small>[ sel ]</small> </span> <span bgcolor='${mbgt}'> <small>${icon}</small> </span></span></big>,jgctl applyscheme usr ${n};$me jgmenus" "^sep()")
|
||||
done < <(tail -n +2 "$MENU_USERSCHEMES")
|
||||
fi
|
||||
|
||||
out1+=("^sep($_GENERATE)")
|
||||
out1+=("<big></big> $RANDOMIZE,jgctl randomscheme;$me jgmenus")
|
||||
out1+=("<big></big> $MONOCHROMATIC,^checkout(monoch_menu)")
|
||||
out2+=("^tag(monoch_menu)")
|
||||
out2+=("^sep(<i>$CHOOSE_AND_PICK</i>)")
|
||||
out2+=("<big></big> $EXACT...,jgctl mono pick exact stylemenu")
|
||||
out2+=("^sep()")
|
||||
out2+=("<big></big> $LIGHTBG...,jgctl mono pick light stylemenu")
|
||||
out2+=("<big></big> $DARKBG...,jgctl mono pick dark stylemenu")
|
||||
out1+=("^sep($GENERATEFROMWP)")
|
||||
out1+=("<big></big> <span bgcolor='${w[-3]}'> <span bgcolor='${w[-5]}'> <span bgcolor='${w[-1]}' fgcolor='${w[1]}'> </span> </span> </span> $LIGHTBG,w2theme menu light;$me jgmenus")
|
||||
out1+=("<big></big> <span bgcolor='${w[1]}'> <span bgcolor='${w[4]}'> <span bgcolor='${w[2]}' fgcolor='${w[-2]}'> </span> </span> </span> $DARKBG,w2theme menu dark;$me jgmenus")
|
||||
|
||||
out1+=("^sep($_MORE_OPTIONS)")
|
||||
out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)")
|
||||
out1+=("$_USE <b>Colorizer Menu</b> module,colorizer-menus -s")
|
||||
|
||||
[[ "${2}" == "jgmenus" ]] && out1+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()")
|
||||
|
||||
|
||||
## CONKIES
|
||||
out+=("^sep()")
|
||||
out+=("<big></big> $_COLORIZER_CONKY,colorizer-conky -s")
|
||||
|
||||
|
||||
|
||||
|
||||
#out+=("^sep()")
|
||||
#out+=("<big></big> $_COLORIZER_FONTS,colorizer-fonts -s")
|
||||
#out+=("^sep()")
|
||||
#out+=("<big></big> $_COLORIZER_PICOM,jgpicom-pipe -s")
|
||||
out+=("^sep()")
|
||||
#out+=("$_COLORIZER_HELP,ycolorizer")
|
||||
out+=("<big></big> $_COLORIZER_ROOT,colorizer -s")
|
||||
|
||||
### RUN
|
||||
if [[ $1 == "-s" || $1 == "-c" || $1 == "-u" || $1 == "ipc" || $1 == "-d" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
|
||||
|
||||
case "$1" in
|
||||
-s) out+=(" ${arrow_string_left} $_LEFTPANEL,mb-jgtools places");;
|
||||
-c) out+=(" ${arrow_string_left} Colorizer,colorizer -s");;
|
||||
-u) out+=(" ${arrow_string_left} Settings menu,mb-jgtools settings");;
|
||||
-d) POSITION_MODE=pointer;;
|
||||
ipc) POSITION_MODE=${1:-fixed}
|
||||
#out+=("^sep(Mabox Colorizer)")
|
||||
while read -r pid cmd; do
|
||||
if [[ ${cmd%% *} = tint2 ]]; then
|
||||
TINT=${cmd##* }
|
||||
if grep mb-t2wall $TINT; then
|
||||
#notify-send.sh "AAA" "Found"
|
||||
t2execp=true
|
||||
fi
|
||||
fi
|
||||
done < <(pgrep -u $USER -a tint2)
|
||||
|
||||
out+=("^sep($_PANEL_ICON_ACTIONS)")
|
||||
if [[ "${t2execp}" == "true" ]];then
|
||||
[[ "${wp_icon}" == "wide" ]] && out+=("<big></big> $_WIDE_ICON,mb-setvar wp_icon=square $CONF_FILE;tint2-send refresh-execp mb-t2wall;${me}") || out+=("<big></big> $_WIDE_ICON,mb-setvar wp_icon=wide $CONF_FILE;tint2-send refresh-execp mb-t2wall;${me}")
|
||||
out+=("^sep()")
|
||||
fi
|
||||
|
||||
# left-click
|
||||
case $t2_button_lclick_action in
|
||||
random) out+=(" $_B_LC_ACTION <b>[ $_RAND ]</b>,^checkout(laction)");;
|
||||
randfav) out+=(" $_B_LC_ACTION <b>[ randfav ]</b>,^checkout(laction)");;
|
||||
choose) out+=(" $_B_LC_ACTION <b>[ $_CHOOSE ]</b>,^checkout(laction)");;
|
||||
preview) out+=(" $_B_LC_ACTION <b>[ $_PREVIEW ]</b>,^checkout(laction)");;
|
||||
menu) out+=(" $_B_LC_ACTION <b>[ $_WALL_MENU ]</b>,^checkout(laction)");;
|
||||
slideshow) out+=(" $_B_LC_ACTION <b>[ $_SLIDESHOW ]</b>,^checkout(laction)");;
|
||||
window) out+=(" $_B_LC_ACTION <b>[ $_COL_WINDOW ]</b>,^checkout(laction)");;
|
||||
colmenu) out+=(" $_B_LC_ACTION <b>[ $_COL_MENU ]</b>,^checkout(laction)");;
|
||||
*) out+=(" $_B_LC_ACTION <b>[ $_CHOOSE ]</b>,^checkout(laction)");;
|
||||
esac
|
||||
|
||||
out2+=("^tag(laction)")
|
||||
out2+=("^sep($_P_B_LC_ACTION)")
|
||||
[[ "$t2_button_lclick_action" == "random" ]] && out2+=("<big>綠</big> $_RANDOM_DESC") || out2+=("<big>祿</big> $_RANDOM_DESC,mb-setvar t2_button_lclick_action=random $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "randfav" ]] && out2+=("<big>綠</big> $_RANDOMFAV_DESC") || out2+=("<big>祿</big> $_RANDOMFAV_DESC,mb-setvar t2_button_lclick_action=randfav $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "choose" ]] && out2+=("<big>綠</big> $_CHOOSE_DESC") || out2+=("<big>祿</big> $_CHOOSE_DESC,mb-setvar t2_button_lclick_action=choose $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "preview" ]] && out2+=("<big>綠</big> $_PREVIEW_DESC") || out2+=("<big>祿</big> $_PREVIEW_DESC,mb-setvar t2_button_lclick_action=preview $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "menu" ]] && out2+=("<big>綠</big> $_WALL_MENU_DESC") || out2+=("<big>祿</big> $_WALL_MENU_DESC,mb-setvar t2_button_lclick_action=menu $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "slideshow" ]] && out2+=("<big>綠</big> $_SLIDESHOW_DESC") || out2+=("<big>祿</big> $_SLIDESHOW_DESC,mb-setvar t2_button_lclick_action=slideshow $CONF_FILE")
|
||||
out2+=("^sep()")
|
||||
[[ "$t2_button_lclick_action" == "window" ]] && out2+=("<big>綠</big> $_COL_WINDOW_DESC") || out2+=("<big>祿</big> $_COL_WINDOW_DESC,mb-setvar t2_button_lclick_action=window $CONF_FILE")
|
||||
[[ "$t2_button_lclick_action" == "colmenu" ]] && out2+=("<big>綠</big> $_COL_MENU_DESC") || out2+=("<big>祿</big> $_COL_MENU_DESC,mb-setvar t2_button_lclick_action=colmenu $CONF_FILE")
|
||||
|
||||
|
||||
if [[ "${t2execp}" == "true" ]];then
|
||||
#wheel-up
|
||||
t2_button_wheelup_action=${t2_button_wheelup_action:-show-desk}
|
||||
case $t2_button_wheelup_action in
|
||||
show-desk) out+=(" $_B_WU_ACTION <b>[ $_SHOW_DESK ]</b>,^checkout(wuaction)");;
|
||||
win-switch) out+=(" $_B_WU_ACTION <b>[ $_WIN_SWITCH ]</b>,^checkout(wuaction)");;
|
||||
desk-switch) out+=(" $_B_WU_ACTION <b>[ $_DESK_SWITCH ]</b>,^checkout(wuaction)");;
|
||||
win-next) out+=(" $_B_WU_ACTION <b>[ $_WIN_NEXT ]</b>,^checkout(wuaction)");;
|
||||
win-prev) out+=(" $_B_WU_ACTION <b>[ $_WIN_PREV ]</b>,^checkout(wuaction)");;
|
||||
random) out+=(" $_B_WU_ACTION <b>[ $_RAND ]</b>,^checkout(wuaction)");;
|
||||
esac
|
||||
out2+=("^tag(wuaction)")
|
||||
out2+=("^sep($_P_B_WU_ACTION)")
|
||||
[[ "$t2_button_wheelup_action" == "show-desk" ]] && out2+=("<big>綠</big> $_SHOW_DESK_DESC") || out2+=("<big>祿</big> $_SHOW_DESK_DESC,mb-setvar t2_button_wheelup_action=show-desk $CONF_FILE")
|
||||
[[ "$t2_button_wheelup_action" == "random" ]] && out2+=("<big>綠</big> $_RANDOM_DESC") || out2+=("<big>祿</big> $_RANDOM_DESC,mb-setvar t2_button_wheelup_action=random $CONF_FILE")
|
||||
[[ "$t2_button_wheelup_action" == "win-switch" ]] && out2+=("<big>綠</big> $_WIN_SWITCH_DESC") || out2+=("<big>祿</big> $_WIN_SWITCH_DESC,mb-setvar t2_button_wheelup_action=win-switch $CONF_FILE")
|
||||
[[ "$t2_button_wheelup_action" == "desk-switch" ]] && out2+=("<big>綠</big> $_DESK_SWITCH_DESC") || out2+=("<big>祿</big> $_DESK_SWITCH_DESC,mb-setvar t2_button_wheelup_action=desk-switch $CONF_FILE")
|
||||
# buggy skippy-xd or openbox bug
|
||||
#[[ "$t2_button_wheelup_action" == "win-next" ]] && out2+=("<big>綠</big> $_WIN_NEXT_DESC") || out2+=("<big>祿</big> $_WIN_NEXT_DESC,mb-setvar t2_button_wheelup_action=win-next $CONF_FILE")
|
||||
#[[ "$t2_button_wheelup_action" == "win-prev" ]] && out2+=("<big>綠</big> $_WIN_PREV_DESC") || out2+=("<big>祿</big> $_WIN_PREV_DESC,mb-setvar t2_button_wheelup_action=win-prev $CONF_FILE")
|
||||
|
||||
#wheel-down
|
||||
t2_button_wheeldown_action=${t2_button_wheeldown_action:-show-desk}
|
||||
case $t2_button_wheeldown_action in
|
||||
show-desk) out+=(" $_B_WD_ACTION <b>[ $_SHOW_DESK ]</b>,^checkout(wdaction)");;
|
||||
win-switch) out+=(" $_B_WD_ACTION <b>[ $_WIN_SWITCH ]</b>,^checkout(wdaction)");;
|
||||
desk-switch) out+=(" $_B_WD_ACTION <b>[ $_DESK_SWITCH ]</b>,^checkout(wdaction)");;
|
||||
win-next) out+=(" $_B_WD_ACTION <b>[ $_WIN_NEXT ]</b>,^checkout(wdaction)");;
|
||||
win-prev) out+=(" $_B_WD_ACTION <b>[ $_WIN_PREV ]</b>,^checkout(wdaction)");;
|
||||
random) out+=(" $_B_WD_ACTION <b>[ $_RAND ]</b>,^checkout(wdaction)");;
|
||||
esac
|
||||
out2+=("^tag(wdaction)")
|
||||
out2+=("^sep($_P_B_WD_ACTION)")
|
||||
[[ "$t2_button_wheeldown_action" == "show-desk" ]] && out2+=("<big>綠</big> $_SHOW_DESK_DESC") || out2+=("<big>祿</big> $_SHOW_DESK_DESC,mb-setvar t2_button_wheeldown_action=show-desk $CONF_FILE")
|
||||
[[ "$t2_button_wheeldown_action" == "random" ]] && out2+=("<big>綠</big> $_RANDOM_DESC") || out2+=("<big>祿</big> $_RANDOM_DESC,mb-setvar t2_button_wheeldown_action=random $CONF_FILE")
|
||||
[[ "$t2_button_wheeldown_action" == "win-switch" ]] && out2+=("<big>綠</big> $_WIN_SWITCH_DESC") || out2+=("<big>祿</big> $_WIN_SWITCH_DESC,mb-setvar t2_button_wheeldown_action=win-switch $CONF_FILE")
|
||||
[[ "$t2_button_wheeldown_action" == "desk-switch" ]] && out2+=("<big>綠</big> $_DESK_SWITCH_DESC") || out2+=("<big>祿</big> $_DESK_SWITCH_DESC,mb-setvar t2_button_wheeldown_action=desk-switch $CONF_FILE")
|
||||
#[[ "$t2_button_wheeldown_action" == "win-next" ]] && out2+=("<big>綠</big> $_WIN_NEXT_DESC") || out2+=("<big>祿</big> $_WIN_NEXT_DESC,mb-setvar t2_button_wheeldown_action=win-next $CONF_FILE")
|
||||
#[[ "$t2_button_wheeldown_action" == "win-prev" ]] && out2+=("<big>綠</big> $_WIN_PREV_DESC") || out2+=("<big>祿</big> $_WIN_PREV_DESC,mb-setvar t2_button_wheeldown_action=win-prev $CONF_FILE")
|
||||
fi
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
#. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=40
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
||||
MENU_PADDING_TOP=$((jgtools_padding + 150))
|
||||
|
||||
# colors on image
|
||||
n=0
|
||||
m=0
|
||||
X=$((jgtools_padding + 6))
|
||||
Y=$((jgtools_padding + 122))
|
||||
for i in "${w[@]}"
|
||||
do
|
||||
#if [[ "$n" -lt "13" ]];then
|
||||
#dots+=("@rect,,$((X + 20*n)),$((Y)),18,18,1,left,top,#FFFFFF 80,${i} 100,")
|
||||
#else
|
||||
#dots+=("@rect,,$((X + 20*m)),$((Y+20)),18,18,1,left,top,#FFFFFF 80,${i} 100,")
|
||||
if [[ "$n" -lt "13" ]];then
|
||||
dots+=("@rect,,$((X + 21*n)),$((Y)),22,22,0,left,top,#CCCCCC 100,${i} 100,")
|
||||
else
|
||||
:
|
||||
#dots+=("@rect,,$((X + 21*m)),$((Y+24)),22,22,0,left,top,#CCCCCC 100,${i} 100,")
|
||||
#((m=m+1))
|
||||
fi
|
||||
((n=n+1))
|
||||
done
|
||||
|
||||
|
||||
#TEMP POSITION:
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y="80"
|
||||
|
||||
mkconfigfile
|
||||
echo menu_height_mode=dynamic >> ${CONFIG_FILE}
|
||||
|
||||
if [[ "$wall2themes" == "yes" ]]; then
|
||||
AUTOTHEME_IND="
|
||||
@rect,,$((jgtools_padding+4)),$((jgtools_padding + 6)),262,20,0,left,top,#222222 20,#222222 70,
|
||||
@text,,$((jgtools_padding+8)),$((jgtools_padding + 6)),262,22,0,left,top,#FFFFFF,#222222 70, <span fgcolor='white'><big></big> </span> Auto theming <b><i>$_ENABLED</i></b> !
|
||||
"
|
||||
fi
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding )),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
${AUTOTHEME_IND}
|
||||
@rect,,$((jgtools_padding+4)),$((jgtools_padding + 94)),262,32,0,left,top,#222222 20,#222222 70,
|
||||
#@text,,$((jgtools_padding + 196)),$((jgtools_padding + 22)),100,28,0,left,top,#222222 30,${WINCLR},<span size='41600' font_family='Ubuntu'><big></big></span>
|
||||
#@text,,$((jgtools_padding + 194)),$((jgtools_padding + 20)),100,28,0,left,top,#FFFFFF 45,${WINCLR},<span size='41600' font_family='Ubuntu'><big></big></span>
|
||||
@text,,$((jgtools_padding + 14)),$((jgtools_padding + 94)),180,28,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'>$_TITLE</span>
|
||||
$(printf '%s\n' "${dots[@]}")
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out1[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} ${option} 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
printf '%s\n' "${out[@]}"
|
||||
|
||||
if [[ $1 == "-r" ]]; then
|
||||
case $LANG in
|
||||
pl*) REMOVE="Usuń to menu z panelu";;
|
||||
es*) REMOVE="Eliminar este menú del panel";;
|
||||
*) REMOVE="Remove this menu from panel";;
|
||||
esac
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$_REMOVE</i>,mb-setvar places_jgwallpaperchanger=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out1[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
}
|
||||
|
||||
icon(){
|
||||
if [[ "${wp_icon}" == "square" ]];then
|
||||
echo "$HOME/.config/mabox/wpicon.png"
|
||||
else
|
||||
echo "$HOME/.config/mabox/wpicon_wide.png"
|
||||
fi
|
||||
}
|
||||
addfav(){
|
||||
FAVWP="$HOME/.config/mabox/wp_fav.csv"
|
||||
#notify-send.sh "WP" "$1"
|
||||
case $LANG in
|
||||
pl*)
|
||||
TITLE="Dodaj do Ulubionych"
|
||||
TEXT="Nazwa dla tapety"
|
||||
LBL="Nazwa"
|
||||
;;
|
||||
*)
|
||||
TITLE="Add to favorites"
|
||||
TEXT="Set name/label for wallpaper"
|
||||
LBL="Name"
|
||||
;;
|
||||
esac
|
||||
wp="${1/$HOME/\~}"
|
||||
LABEL=$(yad --window-icon=emote-love --title="$TITLE" --center --width=300 --text-align=center --text="$TEXT" --entry --entry-label="$LBL")
|
||||
if [[ "${LABEL}" != "" ]];then
|
||||
echo "${LABEL},${wp}">> "${FAVWP}"
|
||||
fi
|
||||
}
|
||||
randomfav(){
|
||||
favs="$(wc -l $FAVWP| awk '{print $1}')"
|
||||
if [[ "$favs" -gt 3 ]];then
|
||||
IFS=, read name randwp <<< "$(tail --lines=+3 ${FAVWP} |shuf -n 1)"
|
||||
randwp="${randwp//\~/$HOME}"
|
||||
#notify-send.sh "random" "$name $randwp"
|
||||
nitrogen --set-scaled --save $randwp
|
||||
else
|
||||
mbwallpaper -o
|
||||
fi
|
||||
}
|
||||
remfav(){
|
||||
sd ".*$1\n" '' ${FAVWP}
|
||||
sleep 1
|
||||
randomfav
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
lclick) lclick;;
|
||||
wheelup) wheelup;;
|
||||
wheeldown) wheeldown;;
|
||||
icon) icon;;
|
||||
addfav)addfav "$2";;
|
||||
randomfav)randomfav "$2";;
|
||||
remfav)remfav "$2";;
|
||||
*) main "$@";;
|
||||
esac
|
||||
152
usr/bin/jgwallpapergenerate
Executable file
152
usr/bin/jgwallpapergenerate
Executable file
@@ -0,0 +1,152 @@
|
||||
#!/bin/bash
|
||||
# jgwallpapergenerate - submenu to generate wallpapers
|
||||
#
|
||||
CONFIG_DIR="$HOME/.config/mabox/tools"
|
||||
CONFIG_FILE="$CONFIG_DIR/mb-canvas.cfg"
|
||||
mkdir -p $CONFIG_DIR
|
||||
if [ ! -f $CONFIG_FILE ]; then
|
||||
cat <<EOF > ${CONFIG_FILE}
|
||||
# Imagetype extension avif or png
|
||||
# avif (recommended) faster and much smaller size
|
||||
extension=avif
|
||||
# Show preview window, and then decide to set as wallpaper or not
|
||||
# if no generated wallpaper will be applied immediately
|
||||
# yes (recommended) or no
|
||||
show_preview=yes
|
||||
EOF
|
||||
fi
|
||||
source <(grep = $CONFIG_FILE)
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
_TITLE="<b>Generator</b> tapet <small>(ImageMagick)</small>"
|
||||
_RANDCOLORS="Losowe kolory"
|
||||
_PICKCOLORS="Wybór kolorów..."
|
||||
_WALLPAPERMENU="Menu Tapety"
|
||||
_RANDOMEFFECT="<b>Losowy</b> efekt"
|
||||
_SOLID="<b>Jednolity</b> kolor"
|
||||
_BLURRED="<b>Rozmycie</b>"
|
||||
_LINEAR="Gradient <b>liniowy</b>"
|
||||
_RADIAL="Gradient <b>promieniowy</b>"
|
||||
_TWISTED="<b>Skręcony</b> gradient "
|
||||
_BILINEAR="Gradient <b>dwuliniowy</b>"
|
||||
_PLASMA="<b>Plazma</b>"
|
||||
_ONECOLOR="(jeden kolor)"
|
||||
_TWOCOLORS="(dwa kolory)"
|
||||
_FOURCOLORS="(cztery kolory)"
|
||||
_IMAGES="Utworzone obrazy"
|
||||
_OPENDIR="Otwórz katalog"
|
||||
_EMPTYDIR="Opróżnij katalog"
|
||||
_SETTINGS="Ustawienia"
|
||||
_PREVIEW="Pokaż podgląd"
|
||||
_IMG_FORMAT="<i>format obrazków</i>"
|
||||
_RECOMMENDED="(małe pliki - zalecany)"
|
||||
;;
|
||||
*)
|
||||
_TITLE="Wallpaper <b>Generator</b> <small>(ImageMagick)</small>"
|
||||
_RANDCOLORS="Random colors"
|
||||
_PICKCOLORS="Pick colors..."
|
||||
_WALLPAPERMENU="Wallpapers Menu"
|
||||
_RANDOMEFFECT="<b>Random</b> effect"
|
||||
_SOLID="<b>Solid</b> color"
|
||||
_BLURRED="<b>Blurred</b>"
|
||||
_LINEAR="<b>Linear</b> gradient"
|
||||
_RADIAL="<b>Radial</b> gradient"
|
||||
_TWISTED="<b>Twisted</b> gradient"
|
||||
_BILINEAR="<b>Bilinear</b> gradient"
|
||||
_PLASMA="<b>Plasma</b>"
|
||||
_ONECOLOR="(pick one color)"
|
||||
_TWOCOLORS="(pick two colors)"
|
||||
_FOURCOLORS="(pick four colors)"
|
||||
_IMAGES="Generated images"
|
||||
_OPENDIR="Open directory"
|
||||
_EMPTYDIR="Empty directory"
|
||||
_SETTINGS="Settings"
|
||||
_PREVIEW="Show preview"
|
||||
_IMG_FORMAT="<i>image format</i>"
|
||||
_RECOMMENDED="<i>(small filesize - recommended)</i>"
|
||||
;;
|
||||
esac
|
||||
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
DIR="$(xdg-user-dir PICTURES)/imagick"
|
||||
files="$(ls ${DIR}|wc -l)"
|
||||
du="$(du -sh ${DIR}|awk '{print $1}')"
|
||||
me="jgwallpapergenerate -s"
|
||||
|
||||
[[ "$1" != "-s" ]] && out+=("^sep($_TITLE)")
|
||||
out+=("^sep($_RANDCOLORS)")
|
||||
out+=("$_SOLID,mb-canvas -Ras;$me")
|
||||
out+=("$_BLURRED,mb-canvas -RaB;$me")
|
||||
out+=("$_LINEAR,mb-canvas -Ral;$me")
|
||||
out+=("$_RADIAL,mb-canvas -Rar;$me")
|
||||
out+=("$_TWISTED,mb-canvas -Rat;$me")
|
||||
out+=("$_BILINEAR,mb-canvas -Rab;$me")
|
||||
out+=("$_PLASMA,mb-canvas -Rap;$me")
|
||||
out+=("^sep()")
|
||||
out+=("$_RANDOMEFFECT,mb-canvas -Ra;$me")
|
||||
out+=("^sep($_PICKCOLORS)")
|
||||
out+=("$_SOLID $_ONECOLOR,mb-canvas -as;$me")
|
||||
out+=("$_LINEAR $_TWOCOLORS,mb-canvas -al;$me")
|
||||
out+=("$_RADIAL $_TWOCOLORS,mb-canvas -ar;$me")
|
||||
out+=("$_TWISTED $_TWOCOLORS,mb-canvas -at;$me")
|
||||
out+=("$_BILINEAR $_FOURCOLORS,mb-canvas -ab;$me")
|
||||
out+=("$_PLASMA,mb-canvas -ap;$me")
|
||||
if [ "$files" -gt "0" ]; then
|
||||
out+=("\"\"\"^sep($_IMAGES: $files - ${du})\"\"\"")
|
||||
out+=("<big></big> $_OPENDIR,xdg-open $DIR")
|
||||
out+=("<big></big> $_EMPTYDIR,rm ${DIR}/*.*;$me")
|
||||
fi
|
||||
out+=("^sep($_SETTINGS)")
|
||||
[[ "$show_preview" == "yes" ]] && out+=("<big></big> $_PREVIEW,mb-setvar show_preview=no $CONFIG_FILE;${me}") || out+=("<big></big> $_PREVIEW,mb-setvar show_preview=yes $CONFIG_FILE;${me}")
|
||||
out+=("^sep($_IMG_FORMAT)")
|
||||
[[ "$extension" == "avif" ]] && out+=("<big>綠</big> <b>avif</b> $_RECOMMENDED,mb-setvar extension=png $CONFIG_FILE;${me}") || out+=("<big>祿</big> avif $_RECOMMENDED,mb-setvar extension=avif $CONFIG_FILE;${me}")
|
||||
[[ "$extension" == "png" ]] && out+=("<big>綠</big> <b>png</b>,mb-setvar extension=avif $CONFIG_FILE;${me}") || out+=("<big>祿</big> png,mb-setvar extension=png $CONFIG_FILE;${me}")
|
||||
|
||||
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" ${arrow_string_left} ${arrow_string_left} $_WALLPAPERMENU,jgwallpaperchanger -s")
|
||||
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=40
|
||||
menu_margin_x=${submenu_spacing:-0}
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
|
||||
MENU_PADDING_TOP=$((jgtools_padding + 150))
|
||||
|
||||
THUMB=/usr/share/mabox/img/mb-canvas.png
|
||||
mkconfigfile
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@icon,,$((jgtools_padding )),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}
|
||||
@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,28,0,left,top,#222222 20,#222222 70,
|
||||
@text,,$((jgtools_padding + 201)),$((jgtools_padding + 92)),100,28,0,left,top,#DDDDDD 60,${WINCLR},<span size='41600' font_family='Ubuntu'><big></big></span>
|
||||
@text,,$((jgtools_padding + 4)),$((jgtools_padding + 116)),250,28,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'>$_TITLE </span>
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
printf '%s\n' "${out[@]}"
|
||||
|
||||
33
usr/bin/mabox-compositor
Executable file
33
usr/bin/mabox-compositor
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# mabox-compositor - script to start|stop|restart picom
|
||||
# by Daniel Napora <napcok@gmail.com>
|
||||
|
||||
. "$HOME/.config/mabox/mabox.conf"
|
||||
|
||||
backend=${picom_renderer:-glx}
|
||||
|
||||
start() {
|
||||
CONFIGFILE="$HOME/.config/picom.conf"
|
||||
if [ -f "$CONFIGFILE" ];then
|
||||
picom --backend "$backend" --config "$CONFIGFILE" &
|
||||
else
|
||||
picom --backend "$backend" --config /dev/null &
|
||||
fi
|
||||
}
|
||||
stop() {
|
||||
if [ $(pgrep -u $USER picom) ]; then
|
||||
killall -u $USER picom
|
||||
fi
|
||||
}
|
||||
restart(){
|
||||
stop
|
||||
sleep 0.25
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--start|start) start;;
|
||||
--stop|stop) stop;;
|
||||
--restart|restart) restart;;
|
||||
esac
|
||||
exit 0
|
||||
179
usr/bin/mabox-conky-pipemenu
Executable file
179
usr/bin/mabox-conky-pipemenu
Executable file
@@ -0,0 +1,179 @@
|
||||
#!/bin/bash
|
||||
# mabox-conky-pipemenu - an Openbox pipemenu for manipulating conky
|
||||
# Copyright (C) 2015 damo <damo@bunsenlabs.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
MB_COMMON_LIBDIR='/usr/lib/mabox/mabox-common'
|
||||
|
||||
CONKYDEFAULT="$HOME/.conkyrc"
|
||||
CONKYPATH="$HOME/.config/conky"
|
||||
CSESSIONFILE="$CONKYPATH/conky-sessionfile"
|
||||
SESSIONS="$CONKYPATH/saved-sessions"
|
||||
CZEN="mb-conky-manager"
|
||||
CSESSION="mb-conky-session"
|
||||
HELPFILE="/usr/share/mabox/mabox-docs/helpfile-conkyzen.txt"
|
||||
|
||||
if ! . "$MB_COMMON_LIBDIR/mabox-include.cfg" 2> /dev/null; then
|
||||
echo "Error: Failed to source mb-include.cfg in $MB_COMMON_LIBDIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e "$CSESSIONFILE" ] 2> /dev/null ; then
|
||||
echo "Error: Failed to locate conky-sessionfile in $CONKYPATH" >&2
|
||||
echo "conky -c $HOME/.conkyrc & sleep 1" > "$CSESSIONFILE"
|
||||
fi
|
||||
if [ ! -e "$SESSIONS" ] 2> /dev/null ; then
|
||||
echo "$0: Failed to locate saved-sessions in $CONKYPATH" >&2
|
||||
fi
|
||||
|
||||
declareDependencies yad
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
CHOOSE_CONKY="Wybierz Conky"
|
||||
NEW_SESSION="Nowa sesja Conky"
|
||||
RELOAD="Przeładuj Conky"
|
||||
SAVED_SESSIONS="Zachowane sesje"
|
||||
DEFAULT_CONKYRC="Domyślne conkyrc"
|
||||
RUNNING_CONKY="Działające Conky"
|
||||
EDIT_CONKY="Edytuj Conky"
|
||||
CONKY_EDITOR="Wybierz plik Conky do edycji..."
|
||||
NONE="Brak"
|
||||
DEFAULT="Domyślna";;
|
||||
es*)
|
||||
CHOOSE_CONKY="Elegir recuadro Conky"
|
||||
NEW_SESSION="Guardar sesión actual Conky"
|
||||
RELOAD="Recargar recuadros Conky"
|
||||
SAVED_SESSIONS="Sesiones Conky guardadas"
|
||||
DEFAULT_CONKYRC="Archivo conkyrc x defecto"
|
||||
RUNNING_CONKY="Recuadros en ejecución"
|
||||
EDIT_CONKY="Edición manual recuadro"
|
||||
CONKY_EDITOR="Editor de recuadro"
|
||||
NONE="Ninguno"
|
||||
DEFAULT="Default"
|
||||
;;
|
||||
*)
|
||||
CHOOSE_CONKY="Choose Conky"
|
||||
NEW_SESSION="New Conky session"
|
||||
RELOAD="Reload Conky"
|
||||
SAVED_SESSIONS="Saved sessions"
|
||||
DEFAULT_CONKYRC="Default conkyrc"
|
||||
RUNNING_CONKY="Running Conky"
|
||||
EDIT_CONKY="Edit Conky"
|
||||
CONKY_EDITOR="Conky Editor"
|
||||
NONE="None"
|
||||
DEFAULT="Default"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
getSessions(){ # read any saved sessions from save-sessions file
|
||||
menuSeparator "$SAVED_SESSIONS"
|
||||
#menuItem "$DEFAULT" "$CSESSION $CSESSIONFILE"
|
||||
if [ -e "$SESSIONS" ]
|
||||
then
|
||||
while read -r session ;do
|
||||
[[ -z $session ]] && continue # skip if line is blank
|
||||
menuItem "$session" "$CSESSION $session"
|
||||
done < "$SESSIONS"
|
||||
else
|
||||
echo "$0: Failed to locate saved-sessions in $CONKYPATH" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
loadChooserMenu(){
|
||||
if type "$CZEN" &>/dev/null;then # mb-conkyzen script found
|
||||
menuItem "$CHOOSE_CONKY" "$CZEN"
|
||||
fi
|
||||
}
|
||||
|
||||
loadNewsessionMenu(){
|
||||
if type "$CZEN" &>/dev/null;then # mb-conkyzen script found
|
||||
menuItem "$NEW_SESSION" "$CZEN -z"
|
||||
fi
|
||||
}
|
||||
|
||||
loadReloadMenu(){
|
||||
if type "$CSESSION" &>/dev/null;then # mb-conky-session script found
|
||||
menuItem "$RELOAD" "$CSESSION"
|
||||
fi
|
||||
}
|
||||
|
||||
loadSavedsessionSubmenu(){
|
||||
if type "$CSESSION" &>/dev/null;then # mb-conky-session script found
|
||||
menuSubmenu "Sessions" "$SAVED_SESSIONS"
|
||||
getSessions
|
||||
menuSubmenuEnd
|
||||
fi
|
||||
}
|
||||
|
||||
loadPinMenu(){
|
||||
if type mb-conkypin &>/dev/null;then
|
||||
menuItem "Ustaw pozycję Conky" "mb-conkypin"
|
||||
menuSeparator
|
||||
fi
|
||||
}
|
||||
|
||||
loadEditMenu(){
|
||||
if [[ $(pidof conky) ]];then
|
||||
menuSubmenu "RunningConky" "$RUNNING_CONKY"
|
||||
menuSeparator "$RUNNING_CONKY"
|
||||
while read -r session ;do # get running conkys from sessionfile
|
||||
[[ -z $session ]] && continue
|
||||
CPATH=$(echo "$session" | awk '{print $3}')
|
||||
CONKY=$(echo "$CPATH" | awk -F"/" '{print $(NF-1)"/"$NF }')
|
||||
menuItem "$CONKY" "xdg-open $CPATH"
|
||||
done < "$CSESSIONFILE"
|
||||
menuSubmenuEnd
|
||||
else
|
||||
menuItem "$NONE"
|
||||
fi
|
||||
}
|
||||
|
||||
getConkys(){
|
||||
menuSubmenu "EditConky" "$EDIT_CONKY"
|
||||
menuSeparator "$EDIT_CONKY"
|
||||
if type mb-conkyedit &>/dev/null;then # mb-conkyedit script found
|
||||
menuItem "$CONKY_EDITOR" "mb-conkyedit"
|
||||
loadEditMenu
|
||||
else
|
||||
loadEditMenu
|
||||
fi
|
||||
menuSubmenuEnd
|
||||
}
|
||||
|
||||
checkHelpfile(){
|
||||
DLG="yad --text-info --center --borders=20 \
|
||||
--title='BunsenLabs Conky Manager Help' \
|
||||
--window-icon=distributor-logo-bunsenlabs \
|
||||
--filename=$HELPFILE --fontname=Monospace \
|
||||
--width=650 --height=700 \
|
||||
--button=OK:0"
|
||||
if [[ -e $HELPFILE ]];then
|
||||
menuItem "Pomoc do Conky Manager" "$DLG"
|
||||
fi
|
||||
}
|
||||
|
||||
menuStart "Conkymenu" "Conky"
|
||||
menuSeparator "Conky"
|
||||
loadChooserMenu
|
||||
loadReloadMenu
|
||||
getConkys
|
||||
menuSeparator
|
||||
#loadPinMenu
|
||||
loadNewsessionMenu
|
||||
loadSavedsessionSubmenu
|
||||
#menuSeparator
|
||||
#checkHelpfile
|
||||
menuEnd
|
||||
187
usr/bin/mabox-include.cfg
Executable file
187
usr/bin/mabox-include.cfg
Executable file
@@ -0,0 +1,187 @@
|
||||
# cbpp-include.cfg - Variables and functions commonly used in custom scripts for
|
||||
# CrunchBang GNU/Linux <http://crunchbanglinux.org/>.
|
||||
# Ported to #!++ <https://crunchbangplusplus.org>
|
||||
# by Ben Young <computermouth@crunchbangplusplus.org>
|
||||
# Ported to Manjaro <https://manjaro.github.io/>
|
||||
# by Daniel Napora <napcok@gmail.com>
|
||||
|
||||
# Usage: say text [delayAfterText]
|
||||
say() {
|
||||
fold -s -w 76 <<< "$1" | sed 's/^/ /' # wraps text nicely and adds two leading spaces
|
||||
sleep "${2-0}"
|
||||
}
|
||||
|
||||
# Usage: prompt text [Y | N | Q]
|
||||
prompt() {
|
||||
local answer prompt default
|
||||
if [[ ${2^} = Q* ]]; then
|
||||
#say "$1"
|
||||
read -srn1 -p "$1" answer
|
||||
echo
|
||||
[[ ${answer,} = 'q' ]] && return 0 || return 1
|
||||
fi
|
||||
|
||||
if [[ ! $2 || ${2^} = Y* ]]; then
|
||||
prompt='Y/n'
|
||||
default='Y'
|
||||
elif [[ ${2^} = N* ]]; then
|
||||
prompt='y/N'
|
||||
default='N'
|
||||
fi
|
||||
|
||||
while true; do
|
||||
read -r -p "$1 [$prompt] " answer
|
||||
|
||||
[[ ! $answer ]] &&
|
||||
answer=$default
|
||||
|
||||
if [[ ${answer^} = Y* ]]; then
|
||||
say
|
||||
return 0
|
||||
elif [[ ${answer^} = N* ]]; then
|
||||
say
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Check the connection by downloading a file from ftp.debian.org. No disk space used.
|
||||
# Usage: connectiontest [attempts]
|
||||
# If attempt count is not specified or 0, then it will loop forever and exit(!) your main program with 1 exit status.
|
||||
connectiontest() {
|
||||
case $LANG in
|
||||
pl*)
|
||||
local TEXT_CHECKING='Sprawdzanie połączenia internetowego...'
|
||||
local TEXT_FAILED='Brak połączenia internetowego!'
|
||||
local TEXT_ASK_RETRY=$'\n\nTen skrypt wymaga działającego połączenia internetowego. Skonfiguruj połączenie internetowe, a następnie wciśnij dowolny klawisz, aby kontynuować, aby wyjść wciśnij "q".'
|
||||
local TEXT_ABORT='Skrypt przerwany.'
|
||||
local TEXT_OK='Test połączenia internetowego zakończył się powodzeniem!'
|
||||
;;
|
||||
*)
|
||||
local TEXT_CHECKING='Checking internet connection...'
|
||||
local TEXT_FAILED='Internet connection test failed!'
|
||||
local TEXT_ASK_RETRY=$'\n\nThis script requires a working internet connection. Please configure your internet connection, then hit any key to continue, else hit "q" to quit.'
|
||||
local TEXT_ABORT='Script aborted.'
|
||||
local TEXT_OK='Internet connection test passed!'
|
||||
;;
|
||||
esac
|
||||
|
||||
local -i i attempts=${1-0}
|
||||
for (( i=0; i < attempts || attempts == 0; i++ )); do
|
||||
say "$TEXT_CHECKING"
|
||||
if wget -O - 'http://ftp.debian.org/debian/README' &> /dev/null; then
|
||||
say "$TEXT_OK" 1
|
||||
return 0
|
||||
fi
|
||||
say "$TEXT_FAILED"
|
||||
if (( i == attempts - 1 )); then # if last attempt
|
||||
return 1
|
||||
elif prompt "$TEXT_ASK_RETRY" Q; then # if user wants to quit
|
||||
say "$TEXT_ABORT" 2
|
||||
(( attempts == 0 )) && exit 1 || return 1
|
||||
fi
|
||||
clear
|
||||
done
|
||||
}
|
||||
|
||||
menuStart() {
|
||||
echo ' <openbox_pipe_menu>'
|
||||
}
|
||||
|
||||
# Usage: menuItem label command
|
||||
menuItem() {
|
||||
echo " <item label=\"$1\">"
|
||||
echo ' <action name="Execute">'
|
||||
echo ' <command>'
|
||||
echo " $2"
|
||||
echo ' </command>'
|
||||
echo ' </action>'
|
||||
echo ' </item>'
|
||||
}
|
||||
|
||||
# Usage: menuSeparator [label]
|
||||
menuSeparator() {
|
||||
if [[ $1 ]]; then
|
||||
echo " <separator label=\"$1\"/>"
|
||||
else
|
||||
echo ' <separator/>'
|
||||
fi
|
||||
}
|
||||
|
||||
# Usage menuSubmenu id label # http://openbox.org/wiki/Help:Menus
|
||||
menuSubmenu() {
|
||||
echo " <menu id=\"$1\" label=\"$2\">"
|
||||
}
|
||||
|
||||
menuSubmenuEnd() {
|
||||
echo ' </menu>'
|
||||
}
|
||||
|
||||
menuEnd() {
|
||||
echo ' </openbox_pipe_menu>'
|
||||
}
|
||||
|
||||
# Usage: promptInstall title description package...
|
||||
promptInstall() {
|
||||
case $LANG in
|
||||
pl*)
|
||||
PROBLEM="Wystąpił problem podczas instalowania"
|
||||
HITANY=" Wciśnij dowolny klawisz aby spróbować ponownie, lub 'q' aby wyjść"
|
||||
INST="INSTALACJA"
|
||||
WILLINST="Ten skrypt zainstaluje"
|
||||
RUNNOW=" Uruchomić instalowanie?"
|
||||
UPD_SOURCES="Aktualizowanie źródeł..."
|
||||
INSTALLING="Instalowanie pakietu..."
|
||||
SUCCESFULLY="został zainstalowany."
|
||||
ANYKEYEXIT="Wciśnij dowolny klawisz aby wyjść..."
|
||||
;;
|
||||
*)
|
||||
PROBLEM="There was a problem installing"
|
||||
HITANY=" Hit any key to try again, or 'q' to quit..."
|
||||
INST="INSTALL"
|
||||
WILLINST="This script will install"
|
||||
RUNNOW=" Run the installer now?"
|
||||
UPD_SOURCES="Updating sources..."
|
||||
INSTALLING="Installing package..."
|
||||
SUCCESFULLY="has been installed successfully."
|
||||
ANYKEYEXIT="Hit any key to exit..."
|
||||
;;
|
||||
esac
|
||||
|
||||
while true; do # Repeat until there are no errors
|
||||
if [[ $TRYAGAIN ]]; then # previous try failed
|
||||
say
|
||||
say "$PROBLEM ${2,,}."
|
||||
say
|
||||
prompt "$HITANY" Q && return 1
|
||||
fi
|
||||
local TRYAGAIN=true
|
||||
|
||||
clear
|
||||
say
|
||||
say "$INST ${1^^}"
|
||||
say '------------------------'
|
||||
say "$WILLINST ${2,,}."
|
||||
say
|
||||
prompt "$RUNNOW" || return 0
|
||||
|
||||
clear
|
||||
connectiontest || continue
|
||||
|
||||
clear
|
||||
say "$UPD_SOURCES" 1
|
||||
sudo pacman -Syu
|
||||
|
||||
clear
|
||||
say "$INSTALLING" 1
|
||||
sudo pacman -S "${@:3}" || continue
|
||||
|
||||
clear
|
||||
say
|
||||
say "${2^} $SUCCESFULLY"
|
||||
say
|
||||
say "$ANYKEYEXIT"
|
||||
read -srn1
|
||||
return 0
|
||||
done
|
||||
}
|
||||
104
usr/bin/mabox-kb-pipemenu
Executable file
104
usr/bin/mabox-kb-pipemenu
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/bin/bash
|
||||
# mabox-kb-pipemenu - an Openbox pipemenu for displaying keybinds
|
||||
# Copyright (C) 2015 damo <damo@bunsenlabs.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# NB The keybinds in the menu are clickable, except for the Openbox
|
||||
# commands, which just exit the menu
|
||||
|
||||
# mb-kb is used to parse rc.xml and send the output to a textfile
|
||||
|
||||
MB_COMMON_LIBDIR="/usr/lib/mabox/mabox-common"
|
||||
USR_CFG_DIR="$HOME/.config/openbox"
|
||||
KBSCRIPT="mb-kb"
|
||||
RCPATH="$USR_CFG_DIR/rc.xml"
|
||||
KBTEXT="$USR_CFG_DIR/kbinds.txt"
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
BKP_EDIT="Backup oraz edycja rc.xml"
|
||||
DISPLAY_IN_WINDOW="Pokaż w nowym oknie"
|
||||
DISPLAY_IN_MENU="Pokaż w menu"
|
||||
WINDOW_COMMANDS="Zarządzanie oknami"
|
||||
RUN_COMMANDS="Klawisze uruchamiania"
|
||||
;;
|
||||
es*)
|
||||
BKP_EDIT="Respaldar y Editar archivo rc.xml"
|
||||
DISPLAY_IN_WINDOW="Mostrar Atajos de teclado en una nueva ventana"
|
||||
DISPLAY_IN_MENU="Mostrar Atajos de teclado en el menú"
|
||||
WINDOW_COMMANDS="Comandos para ventanas en Openbox"
|
||||
RUN_COMMANDS="'Ejecutar' commandos"
|
||||
;;
|
||||
*)
|
||||
BKP_EDIT="Backup and Edit rc.xml"
|
||||
DISPLAY_IN_WINDOW="Display Keybinds in new window"
|
||||
DISPLAY_IN_MENU="Display Keybinds in menu"
|
||||
WINDOW_COMMANDS="Openbox window commands"
|
||||
RUN_COMMANDS="'Run' commands"
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! . "$MB_COMMON_LIBDIR/mabox-include.cfg" 2> /dev/null; then
|
||||
echo $"Error: Failed to locate mabox-include.cfg in $MB_COMMON_LIBDIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# test if mb-kb exists in path
|
||||
if type "$KBSCRIPT" &> /dev/null;then
|
||||
# run script to write kbinds.txt, suppress terminal output
|
||||
"$KBSCRIPT" > /dev/null
|
||||
else
|
||||
menuStart
|
||||
menuSeparator "$KBSCRIPT is not available. Try installing mabox-utilities."
|
||||
menuEnd
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $1 = '--rcedit' ]];then # "Backup & Edit rc.xml" is chosen in menu
|
||||
# backup rc.xml first
|
||||
NOW=$(date +"%Y%m%d-%H%M")
|
||||
RCBKP="$RCPATH.$NOW"
|
||||
cp "$RCPATH" "$RCBKP"
|
||||
xdg-open "$RCPATH" # open rc.xml in default editor
|
||||
|
||||
fi
|
||||
|
||||
# pipemenu
|
||||
menuStart
|
||||
menuItem "$BKP_EDIT" "mabox-kb-pipemenu --rcedit"
|
||||
#menuItem "$GUI_EDIT" "obkey"
|
||||
menuSeparator
|
||||
menuItem "$DISPLAY_IN_WINDOW" "mb-kb --gui"
|
||||
menuSubmenu "Display keybinds" "$DISPLAY_IN_MENU"
|
||||
menuSeparator "$RUN_COMMANDS"
|
||||
while read -r a b c;do # write out 'Run' commands (clickable)
|
||||
if [[ "$a" = "x" ]];then
|
||||
curItem=$(printf "%-23s %s" "$b" "$c")
|
||||
menuItem "$curItem" "$c"
|
||||
fi
|
||||
done < "$KBTEXT"
|
||||
menuSeparator
|
||||
menuSeparator "$WINDOW_COMMANDS"
|
||||
while read -r a b c;do # write out Openbox commands (not clickable)
|
||||
if [[ "$a" = "o" ]];then
|
||||
curItem=$(printf "%-20s %s" "$b" "$c")
|
||||
menuItem "$curItem" "echo >/dev/null 2>&1"
|
||||
fi
|
||||
done < "$KBTEXT"
|
||||
|
||||
menuSubmenuEnd
|
||||
menuEnd
|
||||
|
||||
exit 0
|
||||
41
usr/bin/mabox-libreoffice-pipemenu
Executable file
41
usr/bin/mabox-libreoffice-pipemenu
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# ---------------------------------------------------------------------
|
||||
# An Openbox pipemenu for use with LibreOffice and CrunchBang Linux.
|
||||
# Written for CrunchBang Linux <http://crunchbang.org/>
|
||||
# by Philip Newborough (aka corenominal) <mail@philipnewborough.co.uk>
|
||||
# Ported to #!++ <https://crunchbangplusplus.org>
|
||||
# by Ben Young <computermouth@crunchbangplusplus.org>
|
||||
# Ported to Manjaro <https://manjaro.github.io/>
|
||||
# by Daniel Napora <napcok@gmail.com>
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
if ! . mabox-include.cfg 2> /dev/null; then
|
||||
echo ' Failed to locate mabox-include.cfg in PATH' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $1 = '--install' ]]; then
|
||||
terminator --title='Install LibreOffice' --command='mabox-libreoffice-pipemenu --install-lo'
|
||||
|
||||
elif [[ $1 = '--install-lo' ]]; then
|
||||
promptInstall 'LIBREOFFICE' 'LibreOffice' 'libreoffice-still'
|
||||
|
||||
else
|
||||
# Pipemenu
|
||||
menuStart
|
||||
|
||||
tools=('writer' 'calc' 'impress' 'draw' 'base')
|
||||
|
||||
for curTool in "${tools[@]}"; do
|
||||
if type "lo$curTool" &> /dev/null; then
|
||||
INSTALLED=true
|
||||
menuItem "${curTool^}" "lo$curTool"
|
||||
fi
|
||||
done
|
||||
|
||||
[[ ! $INSTALLED ]] &&
|
||||
menuItem 'Install LibreOffice' 'mabox-libreoffice-pipemenu --install'
|
||||
|
||||
menuEnd
|
||||
fi
|
||||
exit 0
|
||||
178
usr/bin/mabox-places-pipemenu
Executable file
178
usr/bin/mabox-places-pipemenu
Executable file
@@ -0,0 +1,178 @@
|
||||
#!/bin/sh
|
||||
# cb-places-pipemenu - a places openbox pipe menu
|
||||
# Copyright (C) 2010 John Crawley
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# Version 2012/09/27-cb
|
||||
|
||||
|
||||
# Ported to #!++ <https://crunchbangplusplus.org>
|
||||
# by Ben Young <computermouth@crunchbangplusplus.org>
|
||||
# Ported to Manjaro <https://manjaro.github.io/>
|
||||
# by Daniel Napora <napcok@gmail.com>
|
||||
|
||||
# NB The shell, not bash, is invoked in the hope that
|
||||
# dash will be used, as it is much faster.
|
||||
|
||||
# Usage: add
|
||||
# <menu id="places" label="Places" execute="/path/to/mabox-places-pipemenu ~/" />
|
||||
# to your .config/openbox/menu.xml
|
||||
|
||||
# or, if you want the "recent files" menu incorporated at the top, use:
|
||||
# <menu id="places" label="Places" execute="/path/to/mabox-places-pipemenu --recent ~/" />
|
||||
# make sure you have mabox-recent-files-pipemenu somewhere, and enter its path below.
|
||||
|
||||
# path to your "recent files" script, if you want to incorporate it:
|
||||
recent_script=/usr/bin/mabox-recent-files-pipemenu
|
||||
|
||||
# Command to open folders at "Browse here..." - any file manager
|
||||
open_folder_cmd=pcmanfm
|
||||
# Default command to open files with - others might be xdg-open, gnome-open, pcmanfm...
|
||||
default_open_cmd=exo-open # exo-open comes with thunar
|
||||
# Text editor of choice
|
||||
text_editor=geany
|
||||
|
||||
# function to open files with default open command, or alternative command for certain files
|
||||
# - add other conditions to choice
|
||||
open_file() {
|
||||
[ -x "$1" ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit executables instead of executing
|
||||
#[ -x "$1" ] && exec "terminator -e" "$1" # uncomment this and comment out previous line to run executables in terminal instead of editing
|
||||
[ "${1##*.}" = desktop ] && exec "$text_editor" "$1" # comment out this line if you don't want to edit .desktop files instead of executing
|
||||
exec "$default_open_cmd" "$1" # use default open command if above conditions not satisfied
|
||||
}
|
||||
|
||||
# extra dotfiles to display in HOME folder (dotfiles are hidden by default)
|
||||
# edit the list (space separated, surrounded by single quotes) or comment this line out, to taste:
|
||||
shown_dotfiles='.config .local .Xdefaults .bash_aliases .bashrc .fonts.conf .gtkrc-2.0.mine .profile .xsession-errors'
|
||||
|
||||
# By default, this script will display directories separately, before files.
|
||||
# To change this behaviour, see NOTE1, NOTE2 and NOTE3 below, near end of page.
|
||||
|
||||
#######################################################################
|
||||
|
||||
case $1 in
|
||||
# if "--open" option is sent as $1, open file ($2) instead of generating menu
|
||||
--open)
|
||||
open_file "$2"
|
||||
echo "$0 : failed to open $2" >&2
|
||||
exit;; # in case exec command fails
|
||||
# if "--recent" option is sent, incorporate "recent files" menu
|
||||
--recent)
|
||||
shift
|
||||
output='<openbox_pipe_menu>
|
||||
'
|
||||
if [ -x "$recent_script" ]
|
||||
then
|
||||
output="$output"'<separator label="Ostatnio otwierane..." />
|
||||
<menu execute="'"$recent_script"'" id="recent" label="files" />
|
||||
'
|
||||
else
|
||||
echo "$0 : cannot find executable script $recent_script" >&2
|
||||
fi;;
|
||||
*)
|
||||
output='<openbox_pipe_menu>
|
||||
';;
|
||||
esac
|
||||
|
||||
path="${1:-$HOME}" # default starting place is ~, otherwise $1
|
||||
path="$( echo "${path}"/ | tr -s '/' )" # ensure one final slash
|
||||
[ -d "$path" ] || { echo "$0 : $path is not a directory" >&2; exit 1; }
|
||||
|
||||
case "$path" in # only escape if string needs it
|
||||
*\&*|*\<*|*\>*|*\"*|*\'*) pathe=$(sed "s/\&/\&/g;s/</\</g;s/>/\>/g;s/\"/\"/g;s/'/\'/g;" <<XXX
|
||||
$path
|
||||
XXX
|
||||
)
|
||||
;;
|
||||
*)pathe=$path;;
|
||||
esac
|
||||
|
||||
case "$pathe" in
|
||||
*\&apos\;*) pathe_apos=$(sed 's/\'/\'\"\'\"\'/g;'<<XXX
|
||||
$pathe
|
||||
XXX
|
||||
)
|
||||
;;
|
||||
*) pathe_apos=$pathe;;
|
||||
esac
|
||||
|
||||
output="$output"'<separator label="'$pathe'" />
|
||||
<item label="Otwórz tutaj...">
|
||||
<action name="Execute">
|
||||
<command>
|
||||
''"$open_folder_cmd"'' ''"$pathe_apos"''
|
||||
</command>
|
||||
</action>
|
||||
</item>
|
||||
<separator />
|
||||
'
|
||||
|
||||
unset extra_entries directories_menu files_menu
|
||||
[ "$path" = "$HOME"/ ] && extra_entries="$shown_dotfiles"
|
||||
for i in "$path"* $extra_entries
|
||||
do
|
||||
[ -e "$i" ] || continue # only output code if file exists
|
||||
shortname="${i##*/}"
|
||||
case $shortname in
|
||||
*\&*|*\<*|*\>*|*\"*|*\'*) shortnamee=$(sed "s/\&/\&/g;s/</\</g;s/>/\>/g;s/\"/\"/g;s/'/\'/g;" <<XXX
|
||||
$shortname
|
||||
XXX
|
||||
)
|
||||
;;
|
||||
*) shortnamee=$shortname;;
|
||||
esac
|
||||
case $shortnamee in
|
||||
*\&apos\;*) shortnamee_apos=$(sed 's/\'/\'\"\'\"\'/g;'<<XXX
|
||||
$shortnamee
|
||||
XXX
|
||||
)
|
||||
;;
|
||||
*) shortnamee_apos=$shortnamee;;
|
||||
esac
|
||||
case $shortnamee in
|
||||
*_*) shortnamee_label=$(sed 's/_/__/g;'<<XXX
|
||||
$shortnamee
|
||||
XXX
|
||||
)
|
||||
;;
|
||||
*) shortnamee_label=$shortnamee;;
|
||||
esac
|
||||
[ -d "$i" ] && {
|
||||
# NOTE1 If you want directories and files listed together
|
||||
# change next line (directories_menu="$directories_menu"') to read: files_menu="$files_menu"' (note the one single quote at the end)
|
||||
directories_menu="$directories_menu"'
|
||||
<menu id="'"${pathe_apos}${shortnamee_apos}"'" label="'"$shortnamee_label"'" execute="''"$0"'' ''"${pathe_apos}${shortnamee_apos}"''" />'; continue; }
|
||||
files_menu="$files_menu"'
|
||||
<item label="'"$shortnamee_label"'">
|
||||
<action name="Execute">
|
||||
<command>
|
||||
''"$0"'' --open ''"${pathe_apos}${shortnamee_apos}"''
|
||||
</command>
|
||||
</action>
|
||||
</item>'
|
||||
done
|
||||
|
||||
[ -n "$directories_menu" ] && {
|
||||
# NOTE2 comment out next 2 lines if you don't want "Directories" label
|
||||
output="${output}"'<separator label="Katalogi" />
|
||||
'
|
||||
output="${output}${directories_menu}"'
|
||||
'; }
|
||||
[ -n "$files_menu" ] && {
|
||||
# NOTE3 comment out next 2 lines if you don't want "Files" label
|
||||
output="${output}"'<separator label="Pliki" />
|
||||
'
|
||||
output="${output}${files_menu}"'
|
||||
'; }
|
||||
output="${output}"'</openbox_pipe_menu>
|
||||
'
|
||||
printf '%s' "$output"
|
||||
exit
|
||||
33
usr/bin/mabox-printing-pipemenu
Executable file
33
usr/bin/mabox-printing-pipemenu
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# ---------------------------------------------------------------------
|
||||
# An Openbox pipemenu for configuring printing under CrunchBang Linux.
|
||||
# Written for CrunchBang Linux <http://crunchbanglinux.org/>
|
||||
# by Philip Newborough (aka corenominal) <mail@philipnewborough.co.uk>
|
||||
# Ported to #!++ <https://crunchbangplusplus.org>
|
||||
# by Ben Young <computermouth@crunchbangplusplus.org>
|
||||
# Ported to Manjaro <https://manjaro.github.io/>
|
||||
# by Daniel Napora <napcok@gmail.com>
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
if ! . mabox-include.cfg 2> /dev/null; then
|
||||
echo ' Failed to locate mabox-include.cfg in PATH' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $1 = '--install' ]]; then
|
||||
terminator --title='Install Printer Support' --command='mabox-printing-pipemenu --install-printing'
|
||||
|
||||
elif [[ $1 = '--install-printing' ]]; then
|
||||
promptInstall 'PRINTING SUPPORT' 'printing support' 'manjaro-printer'
|
||||
|
||||
else
|
||||
# Pipemenu
|
||||
menuStart
|
||||
if type 'system-config-printer' &> /dev/null; then
|
||||
menuItem 'Configure Printers' 'gksudo system-config-printer'
|
||||
else
|
||||
menuItem 'Install Printing Support' 'mabox-printing-pipemenu --install'
|
||||
fi
|
||||
menuEnd
|
||||
fi
|
||||
exit 0
|
||||
133
usr/bin/mabox-software-pipemenu
Executable file
133
usr/bin/mabox-software-pipemenu
Executable file
@@ -0,0 +1,133 @@
|
||||
#!/bin/bash
|
||||
# mabox-software-pipemenu - an Openbox pipemenu to manage software updates, install popular applications, etc.
|
||||
|
||||
MB_COMMON_LIBDIR="/usr/lib/mabox/mabox-common"
|
||||
|
||||
|
||||
if ! . "$MB_COMMON_LIBDIR/mabox-include.cfg" 2> /dev/null; then
|
||||
echo $"Error: Failed to locate mabox-include.cfg in $MB_COMMON_LIBDIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
SYSUPDATE="Aktualizacja systemu"
|
||||
MIRR_RANK="Ranking mirrorów"
|
||||
MIRROR_RANK="Tworzenie rankingu mirrorów"
|
||||
RENEWKEYS="Odnawianie kluczy"
|
||||
ALL="Wszystkie"
|
||||
GEOIP="Najbliższe (wg geoip)"
|
||||
SOFT_MANAGEMENT="Zarządzanie oprogramowaniem"
|
||||
POPULAR_APPS="Popularne programy"
|
||||
INSTALL="Instaluj"
|
||||
INSTALLING="Instalowanie"
|
||||
LAUNCH="Uruchom"
|
||||
GRAPHICS="Grafika"
|
||||
GAMES="Gry"
|
||||
OFFICE="Biuro"
|
||||
REG_MENU="Regeneruj Menu"
|
||||
;;
|
||||
*)
|
||||
SYSUPDATE="System update"
|
||||
MIRR_RANK="Rank mirrors"
|
||||
MIRROR_RANK="Create mirror rank"
|
||||
ALL="All"
|
||||
GEOIP="by geoip"
|
||||
RENEWKEYS="Renew keys"
|
||||
SOFT_MANAGEMENT="Software Management"
|
||||
POPULAR_APPS="Applications"
|
||||
INSTALL="Install"
|
||||
INSTALLING="Installing"
|
||||
LAUNCH="Launch"
|
||||
GRAPHICS="Graphics"
|
||||
GAMES="Games"
|
||||
OFFICE="Office"
|
||||
REG_MENU="Regenerate Menu"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ $1 = '--update' ]]; then
|
||||
pamac-manager --updates
|
||||
|
||||
elif [[ $1 = '--rank-all' ]]; then
|
||||
terminator --title="$MIRROR_RANK" --command='sudo pacman-mirrors -i -c all'
|
||||
elif [[ $1 = '--rank-geoip' ]]; then
|
||||
terminator --title="$MIRROR_RANK" --command='sudo pacman-mirrors -i --geoip'
|
||||
elif [[ $1 = '--fixkeys' ]]; then
|
||||
terminator --title="$RENEWKEYS" --command='sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring'
|
||||
else
|
||||
menuStart
|
||||
menuSeparator "$SOFT_MANAGEMENT"
|
||||
menuItem "$SYSUPDATE" "mabox-software-pipemenu --update"
|
||||
menuSubmenu 'rank' "$MIRR_RANK"
|
||||
menuItem "$ALL" "mabox-software-pipemenu --rank-all"
|
||||
menuItem "$GEOIP" "mabox-software-pipemenu --rank-geoip"
|
||||
menuSubmenuEnd
|
||||
menuItem "$RENEWKEYS" "mabox-software-pipemenu --fixkeys"
|
||||
menuSeparator "$POPULAR_APPS"
|
||||
menuSubmenu 'internet' 'Internet'
|
||||
internet=('chromium' 'palemoon-bin' 'opera' 'thunderbird')
|
||||
for curApp in "${internet[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
|
||||
menuSubmenu 'multimedia' 'Multimedia'
|
||||
multimedia=('kodi' 'audacious' 'vlc' 'smplayer' 'simplescreenrecorder')
|
||||
for curApp in "${multimedia[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
|
||||
menuSubmenu 'grafika' "$GRAPHICS"
|
||||
grafika=('gimp' 'inkscape' 'blender')
|
||||
for curApp in "${grafika[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
menuSubmenu 'gry' "$GAMES"
|
||||
gry=('playonlinux' 'steam-manjaro' 'lutris' 'wesnoth')
|
||||
for curApp in "${gry[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
menuSubmenu 'system' "System"
|
||||
system=('manjaro-printer' 'bleachbit' 'virtualbox')
|
||||
for curApp in "${system[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
menuSubmenu 'office' "$OFFICE"
|
||||
system=('abiword' 'gnumeric' 'libreoffice-still' 'libreoffice-fresh' 'cherrytree' 'zim')
|
||||
for curApp in "${system[@]}"; do
|
||||
if ! type "$curApp" &> /dev/null; then
|
||||
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
|
||||
else
|
||||
menuItem "$LAUNCH ${curApp^}" "$curApp"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
menuEnd
|
||||
fi
|
||||
exit 0
|
||||
114
usr/bin/mabox-tint2-pipemenu
Executable file
114
usr/bin/mabox-tint2-pipemenu
Executable file
@@ -0,0 +1,114 @@
|
||||
#!/bin/bash
|
||||
|
||||
# mabox-tint2-pipemenu - an Openbox pipemenu for tint2 manipulation
|
||||
# Copyright (C) 2015-2016 damo <damo@bunsenlabs.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
MB_COMMON_LIBDIR='/usr/lib/mabox/mabox-common'
|
||||
|
||||
TINT2PATH="$HOME/.config/tint2"
|
||||
TINT2RC="$TINT2PATH/tint2rc"
|
||||
TZEN="mb-tint2-manager"
|
||||
|
||||
if ! . "$MB_COMMON_LIBDIR/mabox-include.cfg" 2> /dev/null; then
|
||||
echo $"Error: Failed to source mabox-include.cfg in $MB_COMMON_LIBDIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
RUNNING_TINT2="Działające Tint2"
|
||||
DEFAULT_TINT2RC="Domyślny tint2rc"
|
||||
EDIT_TINT2="Edytuj Tint2"
|
||||
TINT2_EDITOR="Wybierz pliki Tint2 do edycji..."
|
||||
TINT2_EDITOR_GUI="tint2conf (GUI)"
|
||||
CHOOSE_TINT2="Wybierz Tint2"
|
||||
RESTART_TINT2="Restartuj Tint2"
|
||||
;;
|
||||
es*)
|
||||
RUNNING_TINT2="Panel(es) en ejecución"
|
||||
DEFAULT_TINT2RC="Panel tint2rc x defecto"
|
||||
EDIT_TINT2="Edición manual panel"
|
||||
TINT2_EDITOR="Elegir panel Tint2 a editar"
|
||||
TINT2_EDITOR_GUI="Editor gráfico"
|
||||
CHOOSE_TINT2="Elegir un panel"
|
||||
RESTART_TINT2="Reiniciar panel(es)"
|
||||
;;
|
||||
*)
|
||||
RUNNING_TINT2="Running Tint2"
|
||||
DEFAULT_TINT2RC="Default tint2rc"
|
||||
EDIT_TINT2="Edit Tint2"
|
||||
TINT2_EDITOR="Choose Tint2 to edit"
|
||||
TINT2_EDITOR_GUI="tint2conf (GUI)"
|
||||
CHOOSE_TINT2="Choose Tint2"
|
||||
RESTART_TINT2="Restart Tint2"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
loadTEditmenu(){
|
||||
menuSeparator
|
||||
menuItem "$DEFAULT_TINT2RC" "xdg-open $TINT2RC"
|
||||
if [ "$(pidof tint2)" ];then
|
||||
menuSubmenu "RunningTint2" "$RUNNING_TINT2"
|
||||
menuSeparator "$RUNNING_TINT2"
|
||||
pgrep -a tint2 | while read -r pid cmd; do
|
||||
if [[ ${cmd%% *} = tint2 ]]; then
|
||||
TINT=${cmd##* }
|
||||
TINT2=${TINT#$HOME/.config/}
|
||||
if [[ $TINT = tint2 ]];then
|
||||
TINT="$TINT2RC"
|
||||
TINT2="$DEFAULT_TINT2RC"
|
||||
fi
|
||||
menuItem "$TINT2" "xdg-open $TINT"
|
||||
fi
|
||||
done
|
||||
menuSubmenuEnd
|
||||
fi
|
||||
}
|
||||
|
||||
getTint2s(){
|
||||
menuSubmenu "EditTint2" "$EDIT_TINT2"
|
||||
menuSeparator "$EDIT_TINT2"
|
||||
menuItem "$TINT2_EDITOR_GUI" "tint2conf"
|
||||
if type mb-tint2edit &>/dev/null;then # mb-tint2edit script found
|
||||
menuItem "$TINT2_EDITOR" "mb-tint2edit"
|
||||
loadTEditmenu
|
||||
else
|
||||
loadTEditmenu
|
||||
fi
|
||||
menuSubmenuEnd
|
||||
}
|
||||
|
||||
loadChoosermenu(){
|
||||
if type $TZEN &>/dev/null;then # mb-tint2zen script found
|
||||
menuItem "$CHOOSE_TINT2" "$TZEN"
|
||||
fi
|
||||
}
|
||||
|
||||
loadRestartmenu(){
|
||||
if [ "$(pidof tint2)" ];then
|
||||
if type mb-tint2restart &>/dev/null;then # mb-tint2restart script found
|
||||
menuItem "$RESTART_TINT2" "mb-tint2restart"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
menuStart "Tintmenu" "Tint2"
|
||||
menuSeparator "Tint2 panel"
|
||||
loadChoosermenu
|
||||
loadRestartmenu
|
||||
getTint2s
|
||||
menuEnd
|
||||
355
usr/bin/mb-music
Executable file
355
usr/bin/mb-music
Executable file
@@ -0,0 +1,355 @@
|
||||
#!/bin/bash
|
||||
# mb-music - play Internet streams with mpv or PyRadio
|
||||
me="${0##*/} ipc"
|
||||
|
||||
wmctrl -R cavatransparent
|
||||
mkdir -p "$HOME/.config/mabox/mb-music/"
|
||||
|
||||
CONFFILE="$HOME/.config/mabox/mb-music/mb-music.conf" # NOT USED YET
|
||||
# If config file not exist create one with defaults
|
||||
#if [ ! -f $CONFFILE ]; then
|
||||
#cat <<EOF > ${CONFFILE}
|
||||
#
|
||||
#EOF
|
||||
#fi
|
||||
|
||||
# read config variables from file
|
||||
#source <(grep = $CONFFILE)
|
||||
|
||||
PLAYLIST="$HOME/.config/pyradio/stations.csv"
|
||||
PLAYLISTYT="$HOME/.config/mabox/mb-music/yt_music_list.csv"
|
||||
if [ ! -f $PLAYLISTYT ]; then
|
||||
cat <<EOF > ${PLAYLISTYT}
|
||||
Legendary Albums,-
|
||||
R.E.M. - Automatic fot the people 1992,https://www.youtube.com/watch?v=jBUjeOBzkIk
|
||||
Slayer - South of Heaven 1988,https://www.youtube.com/playlist?list=OLAK5uy_mbXSr6j7jvbIh26_xvtuWqY5Z84BcpxIM
|
||||
The Cure - Faith 1981,https://www.youtube.com/watch?v=fShNf-NdJx4
|
||||
Joy Division - Unknown Pleasures 1979,https://www.youtube.com/watch?v=oo7lt0lLOvg
|
||||
Pink Floyd - The Dark Side Of The Moon 1973,https://www.youtube.com/watch?v=k9ynZnEBtvw
|
||||
Programming music,-
|
||||
Meditate like a Witcher (10 hours),https://www.youtube.com/watch?v=-MJi7T4lX80
|
||||
Tabnine,https://www.youtube.com/watch?v=L_MupB3z1g4
|
||||
Anonymous Headquarters,https://www.youtube.com/watch?v=Z-VfaG9ZN_U
|
||||
Connection Lost,https://www.youtube.com/watch?v=l9nh1l8ZIJQ
|
||||
Infinity,https://www.youtube.com/watch?v=UoPpxj77Vi0
|
||||
Test Mode,https://www.youtube.com/watch?v=ka4KN2KEGmI
|
||||
Under the Deep,https://www.youtube.com/watch?v=rr0gvSS1OzE
|
||||
Brutal,https://www.youtube.com/watch?v=FS8XtrLqIxw
|
||||
Hidden Service,https://www.youtube.com/watch?v=1-_tyTJHgB8
|
||||
Easy Thoughts,https://www.youtube.com/watch?v=0V7X9fa0wco
|
||||
EOF
|
||||
fi
|
||||
|
||||
NOWPLAY="$HOME/.config/mabox/mb-music/.radio-mpv"
|
||||
NOWPLAYYT="$HOME/.config/mabox/mb-music/.yt-mpv"
|
||||
|
||||
menu() {
|
||||
case $LANG in
|
||||
pl*)
|
||||
_SNM="<b>Dźwięk i Muzyka</b>"
|
||||
_VOL="Sterowanie głośnością"
|
||||
_RADIO="Radio Internetowe"
|
||||
_PYRADIO="Uruchom <b>PyRadio</b>"
|
||||
_LISTEN="Słuchaj radia..."
|
||||
_EDITSTATIONS="Edytuj listę stacji radiowych"
|
||||
_RADIOBROWSER="Szukaj stacji online"
|
||||
_MPV="Odtwarzaj (za pomocą mpv - bez gui)"
|
||||
_CAVA="Wizualizacja (cava)"
|
||||
_STOP="Wyłącz"
|
||||
_PAUSE="Pauza"
|
||||
_PLAY="Graj"
|
||||
_YTMUSIC="Odtwarzacz MPV"
|
||||
_PLAYYT="Odtwarzaj..."
|
||||
_EDITMPVPLAYLIST="Edytuj listę MPV"
|
||||
_RESETMPVPLAYLIST="Resetuj playlistę MPV"
|
||||
_YES_RESET="Resetuj"
|
||||
_SETTINGS="Ustawienia"
|
||||
;;
|
||||
*)
|
||||
_SNM="<b>Music & Sound</b> Menu"
|
||||
_VOL="Volume Control"
|
||||
_RADIO="Internet Radio"
|
||||
_PYRADIO="Launch <b>PyRadio</b>"
|
||||
_LISTEN="Listen to the radio..."
|
||||
_EDITSTATIONS="Edit radio stations list"
|
||||
_RADIOBROWSER="Search Radio Stations online"
|
||||
_MPV="Play (with mpv - no gui)"
|
||||
_CAVA="Visualiser (cava)"
|
||||
_STOP="Quit"
|
||||
_PAUSE="Pause"
|
||||
_PLAY="Play"
|
||||
_YTMUSIC="MPV Player"
|
||||
_PLAYYT="Play..."
|
||||
_EDITMPVPLAYLIST="Edit MPV playlist"
|
||||
_RESETMPVPLAYLIST="Reset MPV playlist"
|
||||
_YES_RESET="Reset now"
|
||||
_SETTINGS="Settings"
|
||||
;;
|
||||
esac
|
||||
|
||||
#out+=("^sep($_SNM)")
|
||||
out+=(" $_VOL <span bgcolor='#333333' color='#d3d3d3'> <small> + v</small> </span>,pavucontrol")
|
||||
out+=("^sep($_RADIO)")
|
||||
out+=("$_PYRADIO <span bgcolor='#333333' color='#d3d3d3'> <small> + r</small> </span>,terminator --icon=/usr/share/icons/pyradio.png --geometry=564x440-20-20 -x pyradio -lt")
|
||||
|
||||
out+=("^sep()")
|
||||
NOWPL="0"
|
||||
|
||||
#pgrep -f radio-mpv > /dev/null && NOW="$(<"$NOWPLAY")" NOWPL="1" out0+=("<small> $STOP <i>$NOW</i></small>,pkill -f radio-mpv;pkill -f yt-mpv")
|
||||
|
||||
if pgrep -f radio-mpv > /dev/null
|
||||
then
|
||||
status="$(playerctl -p mpv status)"
|
||||
NOW="$(<"$NOWPLAY")" NOWPL="1"
|
||||
[[ "$status" == "Playing" ]] && out0+=(" <small>$_PAUSE</small>,playerctl -p mpv pause;${me}") || out0+=(" <small>$_PLAY</small>,playerctl -p mpv play;${me}")
|
||||
out0+=(" <small>$_STOP</small>,pkill -f radio-mpv;${me}")
|
||||
out0+=("^sep()")
|
||||
fi
|
||||
|
||||
out+=("$_LISTEN,^checkout(mpvradio)")
|
||||
out2+=("^tag(mpvradio)")
|
||||
|
||||
#out2+=("^sep($_LISTEN)")
|
||||
#mapfile -t stations < "$PLAYLIST"
|
||||
grp=0
|
||||
#while IFS=$'\r\n' read -r line
|
||||
while IFS=, read name url rest
|
||||
do
|
||||
# url=${line#*,}
|
||||
# name=${line%,*}
|
||||
#notify-send.sh "$name" "uerl ${url}"
|
||||
name=${name//&/&}
|
||||
name=${name/>/}
|
||||
name=${name/</}
|
||||
url=${url//[[:space:]]/}
|
||||
if [[ "${url}" == -* ]];then
|
||||
((grp++))
|
||||
out2+=("${name},^checkout(grupa${grp})")
|
||||
out3+=("^tag(grupa$grp)")
|
||||
out3+=("^sep($name)")
|
||||
else
|
||||
if [ ${grp} != "0" ];then
|
||||
out3+=("\"\"\"<small> ${name}</small>\"\"\",mb-music play \"${url}\" \"${name}\"")
|
||||
else
|
||||
out2+=("\"\"\"<small> ${name}</small>\"\"\",mb-music play \"${url}\" \"${name}\"")
|
||||
fi
|
||||
fi
|
||||
done <<< $(grep -v '^\s*$\|^#\|^\s*#' $PLAYLIST)
|
||||
|
||||
|
||||
out+=("^sep($_YTMUSIC)")
|
||||
#pgrep -f yt-mpv > /dev/null && NOW="$(<"$NOWPLAYYT")" NOWPL="1" out0+=("<small> $STOP <i>$NOW</i></small>,pkill -f yt-mpv;pkill -f radio-mpv")
|
||||
if pgrep -f yt-mpv > /dev/null
|
||||
then
|
||||
status="$(playerctl -p mpv status)"
|
||||
NOW="$(<"$NOWPLAYYT")" NOWPL="1"
|
||||
[[ "$status" == "Playing" ]] && out0+=(" <small>$_PAUSE</small>,playerctl -p mpv pause;${me}") || out0+=(" <small>$_PLAY</small>,playerctl -p mpv play;${me}")
|
||||
out0+=(" <small>$_STOP</small>,pkill -f yt-mpv;${me}")
|
||||
out0+=("^sep()")
|
||||
fi
|
||||
|
||||
n=$(grep -v '^\s*$\|^#\|^\s*#' ${PLAYLISTYT} |wc -l)
|
||||
|
||||
### List yt playlist
|
||||
if (( $n <= 24 ));then #flat view in rootmenu
|
||||
while IFS=$'\r\n' read -r line
|
||||
do
|
||||
url=${line#*,}
|
||||
name=${line%,*}
|
||||
name=${name//&/&}
|
||||
if [ ${url} == "-" ];then
|
||||
out+=("^sep(<small>$name</small>)")
|
||||
else
|
||||
[[ $name != "" ]] && out+=("\"\"\"<small> ${name}</small>\"\"\",mb-music playyt "\""${url}"\"" "\""${name}"\""")
|
||||
fi
|
||||
done <<< $(grep -v '^\s*$\|^#\|^\s*#' $PLAYLISTYT)
|
||||
elif (( $n <= 30 ));then # flat view in submenu
|
||||
out+=("$_PLAYYT ,^checkout(ytmusic)")
|
||||
out2+=("^tag(ytmusic)")
|
||||
out2+=("^sep($_YTMUSIC)")
|
||||
grp=0
|
||||
while IFS=$'\r\n' read -r line
|
||||
do
|
||||
url=${line#*,}
|
||||
name=${line%,*}
|
||||
name=${name//&/&}
|
||||
if [ ${url} == "-" ];then
|
||||
out2+=("^sep(<small>$name</small>)")
|
||||
else
|
||||
[[ $name != "" ]] && out2+=("\"\"\"<small> ${name}</small>\"\"\",mb-music playyt "\""${url}"\"" "\""${name}"\""")
|
||||
fi
|
||||
done <<< $(grep -v '^\s*$\|^#\|^\s*#' $PLAYLISTYT)
|
||||
out2+=("^sep()")
|
||||
out2+=("$_EDITPLAYLIST,xdg-open $PLAYLISTYT")
|
||||
else # n > 30
|
||||
out+=("$_PLAYYT ,^checkout(ytmusic)")
|
||||
out2+=("^tag(ytmusic)")
|
||||
out2+=("^sep($_YTMUSIC)")
|
||||
grp=0
|
||||
while IFS=$'\r\n' read -r line
|
||||
do
|
||||
url=${line#*,}
|
||||
name=${line%,*}
|
||||
name=${name//&/&}
|
||||
if [ ${url} == "-" ];then
|
||||
((grp++))
|
||||
out2+=("${name},^checkout(yt${grp})")
|
||||
out3+=("^tag(yt$grp)")
|
||||
out3+=("^sep($name)")
|
||||
else
|
||||
if [ ${grp} != "0" ];then
|
||||
out3+=("\"\"\" ${name}\"\"\",mb-music playyt "\""${url}"\"" "\""${name}"\""")
|
||||
else
|
||||
out2+=("\"\"\" ${name}\"\"\",mb-music playyt "\""${url}"\"" "\""${name}"\""")
|
||||
fi
|
||||
fi
|
||||
done <<< $(grep -v '^\s*$\|^#\|^\s*#' $PLAYLISTYT)
|
||||
|
||||
fi
|
||||
|
||||
out+=("^sep(VISUALIZER)")
|
||||
pgrep -f cavatransparent > /dev/null && out+=("$_STOP $_CAVA,mb-music cavakill;mb-music ipc" "Colorize Cava,colorizer-cava -s") || out+=(" $_CAVA,mb-music cavastart;mb-music ipc")
|
||||
|
||||
out+=("^sep()")
|
||||
out+=(" $_SETTINGS,^checkout(settings)")
|
||||
out2+=("^tag(settings)")
|
||||
out2+=("^sep($_RADIO)")
|
||||
out2+=(" $_EDITSTATIONS,xdg-open $PLAYLIST")
|
||||
out2+=(" $_RADIOBROWSER,xdg-open https://www.radio-browser.info")
|
||||
out2+=("^sep($_YTMUSIC)")
|
||||
out2+=(" $_EDITMPVPLAYLIST,xdg-open $PLAYLISTYT")
|
||||
out2+=(" $_RESETMPVPLAYLIST,^checkout(resetmpv)")
|
||||
out3+=("^tag(resetmpv)")
|
||||
out3+=("^sep($_RESETMPVPLAYLIST ?)")
|
||||
out3+=(" $_YES_RESET,rm ~/.config/mabox/mb-music/yt_music_list.csv;${me}")
|
||||
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" || "$1" == "ipc" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
menu_margin_x=4
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=$((jgtools_padding+102))
|
||||
MENU_HALIGN="right"
|
||||
JGWIDTH=$((300+2*jgtools_padding))
|
||||
|
||||
if [[ "$1" == "ipc" ]]; then
|
||||
POSITION_MODE="ipc"
|
||||
else
|
||||
POSITION_MODE="fixed"
|
||||
fi
|
||||
jgmenu_icon_size=0
|
||||
TABS=200
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
mkconfigfile
|
||||
|
||||
if [[ "$NOWPL" == "1" ]];then
|
||||
clr="#22FF22"
|
||||
read -r -d '' NOWPLAYLINES <<EOF
|
||||
#@rect,,${jgtools_padding},$((jgtools_padding+74)),298,24,0,left,top,,#222222 60,
|
||||
@rect,,$((jgtools_padding+16)),$((jgtools_padding+70)),$((JGWIDTH-2*jgtools_padding-32)),20,4,left,top,,#222222 75,
|
||||
@text,,$((jgtools_padding+20)),$((jgtools_padding+70)),$((JGWIDTH-2*jgtools_padding)),20,0,left,top,#FFFFFF 90,,""" <small>${NOW}</small>"""
|
||||
EOF
|
||||
else
|
||||
clr="#666666"
|
||||
read -r -d '' NOWPLAYLINES <<EOF
|
||||
@rect,,$((jgtools_padding+2)),$((jgtools_padding+72)),296,24,0,left,top,,#222222 70,
|
||||
@text,,$((jgtools_padding+6)),$((jgtools_padding+74)),$((JGWIDTH-2*jgtools_padding)),20,0,left,top,#FFFFFF 90,,""" ${_SNM} <span bgcolor='#333333' color='#d3d3d3'> <small> + m</small> </span>"""
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@rect,,${jgtools_padding},${jgtools_padding},300,100,4,left,top,,#111111 25,
|
||||
|
||||
@rect,,$((jgtools_padding+1)),$((jgtools_padding+63)),18,36,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+21)),$((jgtools_padding+43)),18,56,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+41)),$((jgtools_padding+38)),18,61,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+61)),$((jgtools_padding+13)),18,86,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+81)),$((jgtools_padding+43)),18,56,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+101)),$((jgtools_padding+53)),18,46,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+121)),$((jgtools_padding+33)),18,66,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+141)),$((jgtools_padding+53)),18,46,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+161)),$((jgtools_padding+83)),18,16,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+181)),$((jgtools_padding+93)),18,6,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+201)),$((jgtools_padding+97)),18,2,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+221)),$((jgtools_padding+86)),18,13,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+241)),$((jgtools_padding+80)),18,19,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+261)),$((jgtools_padding+58)),18,41,2,left,top,,${clr} 100,
|
||||
@rect,,$((jgtools_padding+281)),$((jgtools_padding+43)),18,56,2,left,top,,${clr} 100,
|
||||
|
||||
${NOWPLAYLINES}
|
||||
|
||||
$(printf '%s\n' "${out0[@]}")
|
||||
$(printf '%s\n' "${out[@]}")
|
||||
$(printf '%s\n' "${out2[@]}")
|
||||
$(printf '%s\n' "${out3[@]}")
|
||||
EOF
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf '%s\n' "${out0[@]}"
|
||||
printf '%s\n' "${out[@]}"
|
||||
printf '%s\n' "${out2[@]}"
|
||||
printf '%s\n' "${out3[@]}"
|
||||
}
|
||||
|
||||
play() {
|
||||
pkill -f radio-mpv
|
||||
pkill -f yt-mpv
|
||||
notify-send.sh "Playing now: " "$3" --icon=media-tape &
|
||||
echo "$3" > "$NOWPLAY"
|
||||
mpv --title=radio-mpv "$2" --input-ipc-server=/tmp/mpvsocket
|
||||
}
|
||||
playyt() {
|
||||
pkill -f yt-mpv
|
||||
pkill -f radio-mpv
|
||||
notify-send.sh "Playing now: " "$3" --icon=media-tape &
|
||||
echo "$3" > "$NOWPLAYYT"
|
||||
if [[ "$2" == *"playlist"* ]];then
|
||||
mpv --ytdl-raw-options="yes-playlist=" "$2" --no-video --title=yt-mpv --input-ipc-server=/tmp/mpvsocket
|
||||
else
|
||||
mpv "$2" --no-video --title=yt-mpv --input-ipc-server=/tmp/mpvsocket
|
||||
fi
|
||||
}
|
||||
|
||||
# Not really used
|
||||
stop() {
|
||||
stopyt
|
||||
pkill -f radio-mpv
|
||||
echo "" > "$NOWPLAY"
|
||||
}
|
||||
stopyt() {
|
||||
stop
|
||||
pkill -f yt-mpv
|
||||
echo "" > "$NOWPLAYYT"
|
||||
}
|
||||
cavastart() {
|
||||
cavakill
|
||||
transparent-cava ${1} ${2} &2>/dev/null &
|
||||
}
|
||||
cavakill() {
|
||||
pkill -f cavatransparent &
|
||||
}
|
||||
case "$1" in
|
||||
play) play "$1" "$2" "$3";;
|
||||
playyt) playyt "$1" "$2" "$3";;
|
||||
stop) stop;;
|
||||
stopyt) stopyt;;
|
||||
cavastart) cavastart "$2" "$3";;
|
||||
cavakill) cavakill;;
|
||||
ipc|*) menu "$1";;
|
||||
esac
|
||||
199
usr/bin/mb-places
Executable file
199
usr/bin/mb-places
Executable file
@@ -0,0 +1,199 @@
|
||||
#!/bin/bash
|
||||
# mb-places
|
||||
#
|
||||
. ~/.config/mabox/mabox.conf
|
||||
PLACES="$HOME/.config/mabox/places.csv"
|
||||
|
||||
gtkbookmarks() {
|
||||
if [ -f "$HOME/.config/gtk-3.0/bookmarks" ];then
|
||||
BOOKMARKS="$HOME/.config/gtk-3.0/bookmarks"
|
||||
else
|
||||
BOOKMARKS="$HOME/.gtk-bookmarks"
|
||||
fi
|
||||
if [[ -s "$BOOKMARKS" ]]; then
|
||||
case $LANG in
|
||||
pl*) GTK_BOOKMARKS="Zakładki";;
|
||||
es*) GTK_BOOKMARKS="Marcadores" ;;
|
||||
de*) GTK_BOOKMARKS="Lesezeichen" ;;
|
||||
*) GTK_BOOKMARKS="Bookmarks" ;;
|
||||
esac
|
||||
out+=("^sep($GTK_BOOKMARKS)")
|
||||
while read -r line
|
||||
do
|
||||
case $line in
|
||||
file*)
|
||||
uri=$(echo $line | cut -b 8- | cut -d' ' -f1 | sed 's/%20/ /g')
|
||||
label=$(echo $line | cut -d' ' -f2-4 | sed 's/%20/ /g')
|
||||
out+=(" ${label},^pipe(jgbrowser \"${uri}\" -b)")
|
||||
;;
|
||||
sftp*)
|
||||
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
|
||||
label=$(echo $line | cut -d' ' -f2 | sed 's/%20/ /g')
|
||||
out+=(" ${label}, pcmanfm -n ${uri}")
|
||||
;;
|
||||
ftp*)
|
||||
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
|
||||
label=$(echo $line | cut -d' ' -f2-4 | sed 's/%20/ /g')
|
||||
out+=(" ${label}, pcmanfm -n ${uri}")
|
||||
;;
|
||||
smb*)
|
||||
uri=$(echo $line | cut -d' ' -f1 | sed 's/%20/ /g')
|
||||
label=$(echo $line | cut -d' ' -f2 | sed 's/%20/ /g')
|
||||
out+=(" ${label}, pcmanfm -n ${uri}")
|
||||
;;
|
||||
esac
|
||||
done <"$BOOKMARKS"
|
||||
#printf "%b\n" "^sep($GTK_BOOKMARKS)"
|
||||
#printf '%s\n' "${dirs[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
main() {
|
||||
case $LANG in
|
||||
pl*)
|
||||
LABEL="Miejsca"
|
||||
ROOTDIR="Katalog główny"
|
||||
HOME_DIR="Katalog domowy"
|
||||
MOUNTPOINTS="Dyski (Punkty montowania)"
|
||||
SHOW_HIDDEN="Wyświetlanie ukrytych plików"
|
||||
EDIT="Edytuj"
|
||||
FILETOOLS="Narzędzia plikowe"
|
||||
INST="Instaluj"
|
||||
SETTINGS="Ustawienia"
|
||||
;;
|
||||
es*)
|
||||
LABEL="Places"
|
||||
ROOTDIR="Root Directory"
|
||||
HOME_DIR="Home Directory"
|
||||
MOUNTPOINTS="Discs (mount points)"
|
||||
SHOW_HIDDEN="Show hidden files"
|
||||
EDIT="Edit"
|
||||
FILETOOLS="File Tools"
|
||||
INST="Install"
|
||||
SETTINGS="Settings"
|
||||
;;
|
||||
*)
|
||||
LABEL="Places"
|
||||
ROOTDIR="Root Directory"
|
||||
HOME_DIR="Home Directory"
|
||||
MOUNTPOINTS="Discs (mount points)"
|
||||
SHOW_HIDDEN="Show hidden files"
|
||||
EDIT="Edit"
|
||||
FILETOOLS="File Tools"
|
||||
INST="Install"
|
||||
SETTINGS="Settings"
|
||||
;;
|
||||
esac
|
||||
|
||||
#if [ ! -f ${PLACES} ]; then
|
||||
#cat <<EOF > ${PLACES}
|
||||
out+=("^sep($LABEL <small>( + .)</small>)")
|
||||
out+=(" $HOME_DIR (<b>~</b>),^pipe(jgbrowser),folder-home")
|
||||
out+=(" $(basename $(xdg-user-dir DOWNLOAD)),^pipe(jgbrowser $(xdg-user-dir DOWNLOAD)),folder-download")
|
||||
out+=(" $(basename $(xdg-user-dir DOCUMENTS)),^pipe(jgbrowser $(xdg-user-dir DOCUMENTS)),folder-documents")
|
||||
out+=(" $(basename $(xdg-user-dir MUSIC)),^pipe(jgbrowser $(xdg-user-dir MUSIC)),folder-music")
|
||||
out+=(" $(basename $(xdg-user-dir PICTURES)),^pipe(jgbrowser $(xdg-user-dir PICTURES)),folder-pictures")
|
||||
out+=(" $(basename $(xdg-user-dir VIDEOS)),^pipe(jgbrowser $(xdg-user-dir VIDEOS)),folder-video")
|
||||
#^sep()
|
||||
# ~/.config,^pipe(jgbrowser ~/.config),folder
|
||||
#EOF
|
||||
#fi
|
||||
#mapfile -t out < "$PLACES"
|
||||
gtkbookmarks
|
||||
|
||||
out+=("^sep($MOUNTPOINTS)")
|
||||
while read DEVICE SIZE USED FREE PERCENT MOUNT
|
||||
do
|
||||
[[ "${#MOUNT}" -gt "10" ]] && MOUNTLBL=${MOUNT##*/} || MOUNTLBL=${MOUNT}
|
||||
[[ "${#MOUNTLBL}" -gt "10" ]] && MOUNTLBL=${MOUNTLBL:0:14}
|
||||
[[ "${MOUNT}" = *"media"* ]] && ICON="<big></big>" || ICON="<big></big>"
|
||||
out+=("$ICON $MOUNTLBL,^pipe(jgbrowser ${MOUNT})")
|
||||
done < <(df -h | grep '^/dev'| grep -v "boot" | grep -v 'loop')
|
||||
|
||||
out2+=("^tag(inst)")
|
||||
|
||||
out+=("^sep($FILETOOLS)")
|
||||
if hash pcmanfm &>/dev/null; then
|
||||
out+=("<big></big> PCManFM,pcmanfm,file-manager")
|
||||
fi
|
||||
if hash thunar &>/dev/null; then
|
||||
out+=("<big></big> Thunar,thunar,file-manager")
|
||||
fi
|
||||
if hash fsearch &>/dev/null; then
|
||||
out+=("<big></big> FSearch,fsearch,search")
|
||||
fi
|
||||
|
||||
if hash doublecmd &>/dev/null; then
|
||||
out+=("<big></big> Double Commander,doublecmd,doublecmd")
|
||||
else
|
||||
out2+=("$INST Double Commander,pamac-installer doublecmd-gtk2,package-manager-icon")
|
||||
fi
|
||||
|
||||
|
||||
if hash qdirstat &>/dev/null; then
|
||||
out+=("<big></big> QDirStat,qdirstat,qdirstat")
|
||||
else
|
||||
out2+=("$INST QDirStat,pamac-installer qdirstat,package-manager-icon")
|
||||
fi
|
||||
|
||||
if (( ${#out2[@]} > 1 )); then
|
||||
out+=("^sep()")
|
||||
out+=("$INST ...,^checkout(inst),package-manager-icon ")
|
||||
fi
|
||||
|
||||
out+=("^sep($SETTINGS)")
|
||||
[[ $jgbrowser_show_hidden = false ]] && out+=("<big></big> <i>$SHOW_HIDDEN</i>,mb-setvar jgbrowser_show_hidden=true;mb-places -s") || out+=("<big></big> $SHOW_HIDDEN,mb-setvar jgbrowser_show_hidden=false;mb-places -s")
|
||||
out+=(" $EDIT $LABEL,xdg-open $PLACES,geany")
|
||||
}
|
||||
|
||||
|
||||
### RUN
|
||||
main
|
||||
|
||||
if [[ "$1" == "-s" || "$1" == "ipc" || "$1" == "-d" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
|
||||
if [[ "$1" == "ipc" ]]; then
|
||||
POSITION_MODE="ipc"
|
||||
else
|
||||
POSITION_MODE="fixed"
|
||||
fi
|
||||
[[ "$1" == "-d" ]] && POSITION_MODE=pointer
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
icons=0
|
||||
iconmargin=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()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdesktops=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
109
usr/bin/mb-webbrowser
Executable file
109
usr/bin/mb-webbrowser
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
# mb-webbrowser
|
||||
. ~/.config/mabox/mabox.conf
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
LABEL="Przeglądarka WWW"
|
||||
SETPREF="Ustaw domyślną..."
|
||||
INST="Instaluj"
|
||||
;;
|
||||
es*)
|
||||
LABEL="Web Browser"
|
||||
SETPREF="Set preferred..."
|
||||
INST="Install"
|
||||
;;
|
||||
*)
|
||||
LABEL="Web Browser"
|
||||
SETPREF="Set preferred..."
|
||||
INST="Install"
|
||||
;;
|
||||
esac
|
||||
|
||||
out+=("^sep($LABEL)")
|
||||
|
||||
if hash firefox &>/dev/null; then
|
||||
out+=("Firefox,firefox,firefox")
|
||||
else
|
||||
out2+=("$INST Firefox,pamac-installer firefox,package-manager-icon")
|
||||
fi
|
||||
|
||||
if hash chromium &>/dev/null; then
|
||||
out+=("Chromium,chromium,chromium")
|
||||
else out2+=("$INST Chromium,pamac-installer chromium,package-manager-icon")
|
||||
fi
|
||||
|
||||
if hash vivaldi &>/dev/null; then
|
||||
out+=("Vivaldi,vivaldi,vivaldi")
|
||||
else out2+=("$INST Vivaldi,pamac-installer vivaldi,package-manager-icon")
|
||||
fi
|
||||
|
||||
if hash palemoon &>/dev/null; then
|
||||
out+=("Palemoon,palemoon,palemoon")
|
||||
else out2+=("$INST Palemoon,pamac-installer palemoon,package-manager-icon")
|
||||
fi
|
||||
if hash brave &>/dev/null; then
|
||||
out+=("Brave,Brave,brave")
|
||||
else
|
||||
out2+=("$INST Brave,pamac-installer brave,package-manager-icon")
|
||||
fi
|
||||
if hash qutebrowser &>/dev/null; then
|
||||
out+=("Qutebrowser,qutebrowser,qutebrowser")
|
||||
else out2+=("$INST Qutebrowser,pamac-installer qutebrowser,package-manager-icon")
|
||||
fi
|
||||
|
||||
if (( ${#out[@]} > 2 )); then
|
||||
out+=("^sep()")
|
||||
out+=("$SETPREF,exo-preferred-applications --configure,web-browser")
|
||||
fi
|
||||
|
||||
if (( ${#out2[@]} > 0 )); then
|
||||
out+=("^sep()")
|
||||
out+=("$INST ...,^checkout(inst),package-manager-icon ")
|
||||
out+=("^tag(inst)")
|
||||
fi
|
||||
|
||||
|
||||
### RUN
|
||||
if [[ "$1" == "-s" || "$1" == "ipc" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
if [[ $panels_heightpos == "top" ]]; then
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
elif [[ $panels_heightpos == "bottom" ]]; then
|
||||
MENU_VALIGN="bottom"
|
||||
MENU_MARGIN_Y=${panels_topmargin:-0}
|
||||
else
|
||||
MENU_VALIGN="center"
|
||||
fi
|
||||
|
||||
MENU_PADDING_TOP=${jgtools_padding:-0}
|
||||
MENU_HALIGN="left"
|
||||
|
||||
if [[ "$1" == "ipc" ]]; then
|
||||
POSITION_MODE="ipc"
|
||||
else
|
||||
POSITION_MODE="fixed"
|
||||
fi
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
icons=1
|
||||
iconmargin=4
|
||||
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 # not used
|
||||
printf '%s\n' "^sep()"
|
||||
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jgdesktops=false;mb-jgtools places"
|
||||
fi
|
||||
printf '%s\n' "${out2[@]}"
|
||||
99
usr/bin/mbhelper
Executable file
99
usr/bin/mbhelper
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/bin/bash
|
||||
# mbhelper - command palette like menu, search and run, quick access to
|
||||
# all important config tools, edit config files, show keybord shortcuts
|
||||
# favorites, online resources and more.
|
||||
#
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
LNGDIR="pl"
|
||||
TYPE_TO_SEARCH="pisz aby wyszukać"
|
||||
ME="Paleta komend (to menu)"
|
||||
EDIT="Dostosuj..."
|
||||
RESET="Przywróć domyślne"
|
||||
QUICKCONFIG="Szybki dostęp do plików i katalogów konfiguracyjnych"
|
||||
;;
|
||||
es*)
|
||||
LNGDIR="en"
|
||||
TYPE_TO_SEARCH="type to search"
|
||||
ME="CMD Palette (this menu)"
|
||||
EDIT="Edit..."
|
||||
RESET="Reset to default"
|
||||
;;
|
||||
*)
|
||||
LNGDIR="en"
|
||||
TYPE_TO_SEARCH="type to search"
|
||||
ME="CMD Palette (this menu)"
|
||||
EDIT="Edit..."
|
||||
RESET="Reset to default"
|
||||
QUICKCONFIG="Quick access to config files and directories"
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ -f "$HOME/.config/mabox/mbhelper.csv" ]] && CSVFILE="$HOME/.config/mabox/mbhelper.csv" TODEFAULT="$RESET,mbhelper reset"|| CSVFILE="/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv" TODEFAULT=""
|
||||
|
||||
|
||||
|
||||
run() {
|
||||
### RUN
|
||||
if [[ $1 = "-s" ]]; then
|
||||
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
||||
. $HOME/.config/mabox/mabox.conf
|
||||
MENU_PADDING_TOP=$((jgtools_padding+24))
|
||||
MENU_HALIGN="center"
|
||||
MENU_VALIGN="top"
|
||||
MENU_MARGIN_Y=40
|
||||
jgmenu_icon_size=0
|
||||
JGWIDTH=400
|
||||
MENU_HEIGHT_MAX=600
|
||||
|
||||
|
||||
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
||||
[ -z $jgmenu_use_borders ] && menu_border=0
|
||||
|
||||
mkconfigfile
|
||||
CNFDIRFILE="$HOME/.config/mabox/configdir.csv"
|
||||
|
||||
> $CNFDIRFILE
|
||||
while read i; do
|
||||
echo "~/.config${i#*config},xdg-open ${i}" >> $CNFDIRFILE
|
||||
done < <(tree -aif -I chromium -I "Local Storage" -I IndexedDB -I registry -I icons -I "*cache*" -I "*Cach*" --noreport ~/.config/)
|
||||
|
||||
cat <<EOF > ${MENU_ITEMS}
|
||||
@search,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),292,20,4,left,top,auto,#262626,"""<big></big> <i>$TYPE_TO_SEARCH</i>"""
|
||||
^sep($ME)
|
||||
$EDIT,mbhelper edit
|
||||
${TODEFAULT}
|
||||
. $CSVFILE
|
||||
^sep($QUICKCONFIG)
|
||||
~/.bashrc,xdg-open ~/.bashrc
|
||||
. $CNFDIRFILE
|
||||
|
||||
EOF
|
||||
|
||||
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
edit() {
|
||||
if [[ -f "$HOME/.config/mabox/mbhelper.csv" ]];then
|
||||
xdg-open "$HOME/.config/mabox/mbhelper.csv"
|
||||
else
|
||||
cp "/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv" "$HOME/.config/mabox/mbhelper.csv"
|
||||
xdg-open "$HOME/.config/mabox/mbhelper.csv"
|
||||
fi
|
||||
}
|
||||
|
||||
reset() {
|
||||
rm "$HOME/.config/mabox/mbhelper.csv"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
-e|edit) edit;;
|
||||
-r|reset) reset;;
|
||||
*) run "$1";;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user