From 9f160ca210759a2228dc8b7f35bc09a56fa8fee4 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Tue, 3 Feb 2026 22:33:15 +0100 Subject: [PATCH] upload --- README.md | 5 + usr/bin/jgclock | 156 +++++ usr/bin/jgconky-pipe | 181 ++++++ usr/bin/jgdeskgrid | 166 +++++ usr/bin/jgdeskmngr | 156 +++++ usr/bin/jgdesktops | 399 ++++++++++++ usr/bin/jgespanso-pipe | 91 +++ usr/bin/jghistory-pipe | 57 ++ usr/bin/jgkeys-pipe | 176 ++++++ usr/bin/jglockscreen | 152 +++++ usr/bin/jgmenusettings-pipe | 493 +++++++++++++++ usr/bin/jgpicom-pipe | 178 ++++++ usr/bin/jgsoftware-pipe | 88 +++ usr/bin/jgssh | 111 ++++ usr/bin/jgsysinfo-pipe | 158 +++++ usr/bin/jgtint2-pipe | 705 +++++++++++++++++++++ usr/bin/jgtint2launcher | 90 +++ usr/bin/jgwallpaperchanger | 955 +++++++++++++++++++++++++++++ usr/bin/jgwallpapergenerate | 152 +++++ usr/bin/mabox-compositor | 33 + usr/bin/mabox-conky-pipemenu | 179 ++++++ usr/bin/mabox-include.cfg | 187 ++++++ usr/bin/mabox-kb-pipemenu | 104 ++++ usr/bin/mabox-libreoffice-pipemenu | 41 ++ usr/bin/mabox-places-pipemenu | 178 ++++++ usr/bin/mabox-printing-pipemenu | 33 + usr/bin/mabox-software-pipemenu | 133 ++++ usr/bin/mabox-tint2-pipemenu | 114 ++++ usr/bin/mb-music | 355 +++++++++++ usr/bin/mb-places | 199 ++++++ usr/bin/mb-webbrowser | 109 ++++ usr/bin/mbhelper | 99 +++ 32 files changed, 6233 insertions(+) create mode 100755 usr/bin/jgclock create mode 100755 usr/bin/jgconky-pipe create mode 100755 usr/bin/jgdeskgrid create mode 100755 usr/bin/jgdeskmngr create mode 100755 usr/bin/jgdesktops create mode 100755 usr/bin/jgespanso-pipe create mode 100755 usr/bin/jghistory-pipe create mode 100755 usr/bin/jgkeys-pipe create mode 100755 usr/bin/jglockscreen create mode 100755 usr/bin/jgmenusettings-pipe create mode 100755 usr/bin/jgpicom-pipe create mode 100755 usr/bin/jgsoftware-pipe create mode 100755 usr/bin/jgssh create mode 100755 usr/bin/jgsysinfo-pipe create mode 100755 usr/bin/jgtint2-pipe create mode 100755 usr/bin/jgtint2launcher create mode 100755 usr/bin/jgwallpaperchanger create mode 100755 usr/bin/jgwallpapergenerate create mode 100755 usr/bin/mabox-compositor create mode 100755 usr/bin/mabox-conky-pipemenu create mode 100755 usr/bin/mabox-include.cfg create mode 100755 usr/bin/mabox-kb-pipemenu create mode 100755 usr/bin/mabox-libreoffice-pipemenu create mode 100755 usr/bin/mabox-places-pipemenu create mode 100755 usr/bin/mabox-printing-pipemenu create mode 100755 usr/bin/mabox-software-pipemenu create mode 100755 usr/bin/mabox-tint2-pipemenu create mode 100755 usr/bin/mb-music create mode 100755 usr/bin/mb-places create mode 100755 usr/bin/mb-webbrowser create mode 100755 usr/bin/mbhelper diff --git a/README.md b/README.md index c12b6c2..95da398 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/usr/bin/jgclock b/usr/bin/jgclock new file mode 100755 index 0000000..3e6c67c --- /dev/null +++ b/usr/bin/jgclock @@ -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+=("[ $(date "+${TF1}") ] $FORMAT $LINE1,^checkout(cl1)") +[[ "$TF2" == "" ]] && out+=("[ $NONE ] $FORMAT $LINE2,^checkout(cl2)")|| out+=("[ $(date "+${TF2}") ] $FORMAT $LINE2,^checkout(cl2)") +out+=("^sep()") +out+=("$FONT $LINE1: [ $L1_FONT $L1_SIZE ],^checkout(fl1)") +[[ "$TF2" != "" ]] && out+=("$FONT $LINE2: [ $L2_FONT $L2_SIZE ],^checkout(fl2)") +out+=("^sep()") +out+=(" $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+=("$i ,t2ctl clockcolor '${i}' ${TINT};me") +done +out2+=("^tag(cl1)") +out2+=("^sep($LINE1)") +out2+=("$(date +"%H:%M") (%H:%M),t2ctl clockline1 '%H:%M' ${TINT};$me") +out2+=("$(date +"%H:%M:%S") (%H:%M:%S),t2ctl clockline1 '%H:%M:%S' ${TINT};$me") +out2+=("$(date +"%I:%M %p") (%I:%M %p),t2ctl clockline1 '%I:%M %p' ${TINT};$me") +out2+=("$(date +"%-I:%M %p") (%I-:%M %p),t2ctl clockline1 '%-I:%M %p' ${TINT};$me") +out2+=("$(date +"%H:%M (%a)") (%H:%M (%a)),t2ctl clockline1 '%H:%M (%a)' ${TINT};$me") + +out2+=("^tag(cl2)") +out2+=("^sep($LINE2)") +out2+=("$NONE,t2ctl clockline2 none ${TINT};$me") +out2+=("^sep()") +out2+=("$(date +"%A %d %B") (%A %d %B),t2ctl clockline2 '%A %d %B' ${TINT};$me") +out2+=("$(date +"%a %d %b") (%a %d %b),t2ctl clockline2 '%a %d %b' ${TINT};$me") +out2+=("$(date +"%x") (%x),t2ctl clockline2 '%x' ${TINT};$me") +out2+=("$(date +"%m-%d-%Y") (%m-%d-%Y),t2ctl clockline2 '%m-%d-%Y' ${TINT};$me") +out2+=("$(date +"%F") (%F),t2ctl clockline2 '%F' ${TINT};$me") +out2+=("$(date +"%e.%m.%y") (%e.%m.%y),t2ctl clockline2 '%e.%m.%y' ${TINT};$me") +out2+=("^tag(fl1)") +out2+=("^sep($L1_FONT $L1_SIZE)") +out2+=("󰧴 $INCREASE ( $((L1_SIZE+1)) ),t2ctl clock1_fontsize $((L1_SIZE+1)) ${TINT};$me") +out2+=("󰧳 $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+=("$i px,t2ctl clock1_fontsize $i ${TINT};$me") || out2+=("$i px,t2ctl clock1_fontsize $i ${TINT};$me") +done + +out2+=("^sep()") +out2+=("󰛖 $SETFONT,mb-setfont t2_time1_font ${TINT}") +out2+=("^tag(fl2)") +out2+=("^sep($L2_FONT $L2_SIZE)") +out2+=("󰧴 $INCREASE ( $((L2_SIZE+1)) ),t2ctl clock2_fontsize $((L2_SIZE+1)) ${TINT};$me") +out2+=("󰧳 $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+=("$i px,t2ctl clock2_fontsize $i ${TINT};$me") || out2+=("$i px,t2ctl clock2_fontsize $i ${TINT};$me") +done +out2+=("^sep()") +out2+=("󰛖 $SETFONT,mb-setfont t2_time2_font ${TINT}") +fi +out+=("^sep()") +out+=("󰅐 $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 < ${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[@]}" diff --git a/usr/bin/jgconky-pipe b/usr/bin/jgconky-pipe new file mode 100755 index 0000000..debfdad --- /dev/null +++ b/usr/bin/jgconky-pipe @@ -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 < ${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' "$REMOVE,mb-setvar places_conkypipe=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" diff --git a/usr/bin/jgdeskgrid b/usr/bin/jgdeskgrid new file mode 100755 index 0000000..fd1e254 --- /dev/null +++ b/usr/bin/jgdeskgrid @@ -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='\nSuper + LewyKlikMyszy w odpowiednim miejscu okna - aby przemieścić je w wybranym kierunku.\n\nDziała też z klawiatury...\nUżyj Super + Keypad_Keys 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\nSuper + LeftMouseClick on appropriate area of the window to snap it in a given direction.\n\nWorks also with keyboard...\nUse Super + Keypad_Keys 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\nSuper + LeftMouseClick on appropriate area of the window to snap it in a given direction.\n\nWorks also with keyboard...\nUse Super + Keypad_Keys 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 < ${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+=("󰋁 $QUICK_TILE,superclick trainer") +out+=(" +  $KEYBOARD_DEMO,viewnior /usr/share/mabox/img/superclick-keyboard.gif") +out+=("󱇙 $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+=("󰕰 $SHOW_IMGHELPER,drawgrid") +out+=("^sep($CONFIGURATION)") + +out+=("$LGAP [ $GAP ],^checkout(gap)") +[[ "$show_outer_gap" == "true" ]] && out+=(" $OUTER_GAP,mb-setvar show_outer_gap=false $CONFIG_FILE;$me") || out+=(" $OUTER_GAP,mb-setvar show_outer_gap=true $CONFIG_FILE;$me") +#[[ "$notifications" == "true" ]] && out+=(" $NOTIFY,mb-setvar notifications=false $CONFIG_FILE;$me") || out+=(" $NOTIFY,mb-setvar notifications=true $CONFIG_FILE;$me") + +out+=("^sep()") +out+=(" $EDITCONF,xdg-open $CONFIG_FILE") + +out2+=("^tag(gap)") +for i in 0 4 8 10 16 20 24 32 40; do out2+=("$(printf "%3s,%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 < ${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, + +@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},SuperClick +$(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' "$REMOVE,mb-setvar places_jgdeskgrid=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" diff --git a/usr/bin/jgdeskmngr b/usr/bin/jgdeskmngr new file mode 100755 index 0000000..5467b2e --- /dev/null +++ b/usr/bin/jgdeskmngr @@ -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 < ${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="Nadpisz sesję:" + EDIT="Edytuj sesję:" + DELETE="Usuń sesję:" + OPEN_CNFDIR="Otwórz katalog z sesjami" + ADD="Dodaj nową..." + NEW="Nowa 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="Overwrite session:" + EDIT="Edit session:" + DELETE="Delete session:" + OPEN_CNFDIR="Open config directory" + ADD="Add new..." + NEW="New 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="Overwrite session:" + EDIT="Edit session:" + DELETE="Delete session:" + OPEN_CNFDIR="Open config directory" + ADD="Add new..." + NEW="New 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+=(" $ABOUT,notify-send.sh -u critical -i mbcc '$title' '$help';$me") + + +out+=("^sep($SAVED_SESS)") +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 ${name//_/ },deskmngr save $name") +out2+=("^sep()" "  $EDIT ${name//_/ },xdg-open $SESSIONDIR$name.desk") +out2+=("^sep()" "  $DELETE ${name//_/ },rm -f $SESSIONDIR$name.desk;$me") +((i=i+1)) +done < <(deskmngr -l) + +out+=("^sep()" " $OPEN_CNFDIR,pcmanfm ~/.config/deskmngr/") +out+=("^sep($ADD)") +out+=("  $NEW,deskmngr -s") +out+=("^sep($SETTINGS)") +out+=("$INTERVAL: [ $waittime ] ,^checkout(time)") +out2+=("^tag(time)") +out2+=("^sep($INTERVAL)") +for i in 1 2 3 4 5; do out2+=("$(printf "%3s,%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' "$REMOVE,mb-setvar places_jgdeskmngr=false;mb-jgtools places" +fi + +printf '%s\n' "${out2[@]}" diff --git a/usr/bin/jgdesktops b/usr/bin/jgdesktops new file mode 100755 index 0000000..636559f --- /dev/null +++ b/usr/bin/jgdesktops @@ -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 zamknij wszystkie okna na..." + CLOSEALL="Zamknij wszystkie okna na..." + DESKTOP="Pulpicie" + ALL_DESK="Wszystkich pulpitach" + MANAGE="Pulpity" + ADD="Dodaj nowy" + REMOVE_LAST="Usuń ostatni" + CONKY_TOGGLE="Włącz/Wyłącz Conky" + PICOM_TOGGLE="Włącz/Wyłącz Picom" + DESKMNGR="Menadżer sesji pulpitowych" + WALLCHANGER="Tapetu oraz stylizacja pulpitu" + DESKGRID="Desktop Grid" + SCREEN_RES="Ustawienia ekranu" + ENABLE="Włącz" + DISABLE="Wyłącz" + DESK_SERVICES="Usługi pulpitu" + TINT2="Tint2 panel" + CONKY="Sesja Conky" + PICOM="Picom - kompozytor" + CORTILE="Cortile - tiling manager" + MCORNERS="Krawędzie ekranu" + RUNNING="(uruchomiona)" + STOPPED="(zatrzymana)" + MONITORBLANK="Wygaszanie 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 areaclick.conf" + 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 close all windows on..." + CLOSEALL="Close all windows on..." + DESKTOP="Desktop" + ALL_DESK="All Desktops" + MANAGE="Manage Desktops" + ADD="Add new desktop" + REMOVE_LAST="Remove last desktop" + CONKY_TOGGLE="Conky Toggle" + PICOM_TOGGLE="Picom Toggle" + DESKMNGR="Desktop session Manager" + WALLCHANGER="Wallpaper & Desktop styling" + DESKGRID="Desktop Grid" + SCREEN_RES="Screen Settings" + ENABLE="Enable" + DISABLE="Disable" + DESK_SERVICES="Desktop services" + TINT2="Tint2 panel session" + CONKY="Conky session" + PICOM="Picom - compositor" + CORTILE="Cortile - tiling manager" + MCORNERS="Screen Edges - hot corners" + RUNNING="(running)" + STOPPED="(stopped)" + MONITORBLANK="Monitor blanking" + 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 areaclick.conf" + 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 close all windows on..." + CLOSEALL="Close all windows on..." + DESKTOP="Desktop" + ALL_DESK="All Desktops" + MANAGE="Manage Desktops" + ADD="Add new desktop" + REMOVE_LAST="Remove last desktop" + DESKMNGR="Desktop session Manager" + CONKY_TOGGLE="Conky Toggle" + PICOM_TOGGLE="Picom Toggle" + WALLCHANGER="Wallpaper & Desktop styling" + DESKGRID="Desktop Grid" + SCREEN_RES="Screen settings" + ENABLE="Enable" + DISABLE="Disable" + DESK_SERVICES="Desktop services" + TINT2="Tint2 panel session" + CONKY="Conky session" + PICOM="Picom - compositor" + CORTILE="Cortile - tiling manager" + MCORNERS="Screen Edges - hot corners" + RUNNING="(running)" + STOPPED="(stopped)" + MONITORBLANK="Monitor blanking" + 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 areaclick.conf" + 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 < ${CSVFILE} +#^sep($TOOLS) +#󰸉 $WALLCHANGER,^pipe(jgwallpaperchanger) +#󱇙 $DESKGRID,^pipe(jgdeskgrid) +# $DESKMNGR,^pipe(jgdeskmngr) +#󰹑 $SCREEN_RES - ARandR,arandr +#󰹑 $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(${dname/&/&} ($ACTIVE))") + +else +out+=("^sep(${dname/&/&})" " $GOTO,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+=("󰚌 $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+=("󰄲 $TINT2 $RUNNING,killall tint2;$me") +: +else +out+=("󰄱 $TINT2 $STOPPED,mb-tint2-session &>/dev/null;$me") +fi +if pidof conky &>/dev/null; then +out+=("󰄲 $CONKY $RUNNING,conky_toggle;$me") +else +out+=("󰄱 $CONKY $STOPPED,conky_toggle;$me") +fi +if pidof picom &>/dev/null; then +out+=("󰄲 $PICOM $RUNNING,compton_toggle;$me") +else +out+=("󰄱 $PICOM $STOPPED,compton_toggle;$me") +fi +if command -v mcorners &> /dev/null;then + if [[ -f /tmp/mcorners.lck ]]; then + out+=("󰄲 $MCORNERS $RUNNING,mcorners --stop;$me") + else + out+=("󰄱 $MCORNERS $STOPPED,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+=("󰄲 $CORTILE $RUNNING,cortilectl stop") + else + out+=("󰄱 $CORTILE $STOPPED,cortilectl start") + fi +fi +out+=("^sep()") + + + + +if (xset q|grep --quiet "DPMS is Enabled");then +out+=("󰷛 $MONITORBLANK $ON,noblank;$me") +else +out+=("󰍹 $MONITORBLANK $OFF,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+=("󰄱 $SHOW_DESK,obxml show_desk on") || out+=("󰄲 $SHOW_DESK,obxml show_desk off") + fi +else + if source ~/.config/areaclick.conf ;then + [[ "${cmd_center}" == "show_desktop" ]] && out+=("󰄲 $SHOW_DESK,mb-setvar cmd_center=none $AREA_CFG") || out+=("󰄱 $SHOW_DESK,mb-setvar cmd_center=show_desktop $AREA_CFG") + fi +fi + +if [[ ! -z "$mousewheel" ]];then +[[ "$mousewheel" = "none" ]] && out+=("󰄱 $SWITCH_DESK,obxml switch_desk on") || out+=("󰄲 $SWITCH_DESK,obxml switch_desk off") +fi +[[ "$focus" = "no" ]] && out+=("󰄱 $FOCUS,obxml focus_follow_mouse on") || out+=("󰄲 $FOCUS,obxml focus_follow_mouse off") + +# AREACLICK +if [[ "${areaclick}" == "areaclick" ]]; then +if source ~/.config/areaclick.conf ;then + if [[ "${sidearea}" -gt "0" ]];then + out+=("󰄲 $AREACLICK ($AREA_WIDTH: ${sidearea}px),^checkout(area)") + else + out+=("󰄱 $AREACLICK $STOPPED,^checkout(area)") + fi + out2+=("^tag(area)") + out2+=("^sep(AreaClick)") + #out2+=("$ABOUT_AREACLICK,mb-docs areaclick") + out2+=("^sep($AREA_WIDTH (px))") + [[ "${sidearea}" == "0" ]] && out2+=(" 0 (disabled),areaclick area 0") || out2+=(" 0 (disable),areaclick area 0") + [[ "${sidearea}" == "2" ]] && out2+=(" 2px,areaclick area 2") || out2+=(" 2px,areaclick area 2") + [[ "${sidearea}" == "10" ]] && out2+=(" 10px,areaclick area 10") || out2+=(" 10px,areaclick area 10") + [[ "${sidearea}" == "60" ]] && out2+=(" 60px,areaclick area 60") || out2+=(" 60px,areaclick area 60") + [[ "${sidearea}" == "100" ]] && out2+=(" 100px,areaclick area 80") || out2+=(" 100px,areaclick area 100") + [[ "${sidearea}" == "200" ]] && out2+=(" 200px (disable),areaclick area 200") || out2+=(" 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( $m_left $m_top $m_bottom $m_right ") + #out2+=("$OBCONF_MARG,obconf") + out2+=("^sep($SET_ALL_MARG)") + 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+=("󰸉 $WALLCHANGER,jgwallpaperchanger -s") +out+=("󱇙 SuperClick,jgdeskgrid -s") +out+=(" $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 < ${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' "$REMOVE,mb-setvar places_jgdesktops=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" +printf '%s\n' "${out3[@]}" diff --git a/usr/bin/jgespanso-pipe b/usr/bin/jgespanso-pipe new file mode 100755 index 0000000..45d808c --- /dev/null +++ b/usr/bin/jgespanso-pipe @@ -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 Espanso (online)" + LIST="Lista wyzwalaczy:" + ;; + es*) + TYPE_TO_SEARCH="Buscar" + CONFIGURE="Configurar Espanso" + EDITCONF="Editar archivo x defecto" + OPENCONFDIR="Abrir el directorio" + DOCU="Leer Documentacion 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 Espanso 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,\"\"\" $TYPE_TO_SEARCH\"\"\"" >/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 "\"\"\"%-12s %s\"\"\",xdotool type %s\n" $id "${string//> $MENU_ITEMS + string="${string//%-12s %s\"\"\",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 "$REMOVE,mb-setvar places_softwarepipe=false" >> /tmp/espanso_list.csv +fi +cat "${MENU_ITEMS}" diff --git a/usr/bin/jghistory-pipe b/usr/bin/jghistory-pipe new file mode 100755 index 0000000..3e6ec6f --- /dev/null +++ b/usr/bin/jghistory-pipe @@ -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,\"\"\" $TYPE_TO_SEARCH\"\"\"" >/tmp/history_list.csv + +echo "^sep($HISTHELPER)" >>/tmp/history_list.csv +while read -r line ; do + printf "\"\"\"%s\"\"\",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} + + diff --git a/usr/bin/jgkeys-pipe b/usr/bin/jgkeys-pipe new file mode 100755 index 0000000..a68585e --- /dev/null +++ b/usr/bin/jgkeys-pipe @@ -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 "%11s %s,%s" "W-f" "$FILEMNGR" "exo-open --launch FileManager")") +out+=("$(printf "%11s %s,%s" "W-w" "$BROWSER" "exo-open --launch WebBrowser")") +out+=("$(printf "%11s %s,%s" "W-t" "$TERMINAL" "exo-open --launch TerminalEmulator")") +out+=("$(printf "%11s %s,%s" "W-grave" "Quake-like $TERMINAL" "mabox-terminal")") +out+=("$(printf "%11s %s,%s" "W-e" "$EDITOR" geany)") +out+=("$(printf "%11s %s,%s" "W-g" "Galculator" galculator)") +out+=("$(printf "%11s %s,%s" "W-h" "$RESMON" "^term(bpytop)")") +out+=("$(printf "%11s %s,%s" "W-/" "$FSEARCH" fsearch)") +out+=("$(printf "%11s %s,%s" "W-r" "$PYRADIO" "sakura -e 'pyradio'")") +out+=("$(printf "%11s %s,%s" "W-v" "$VOLUME" pavucontrol)") +out+=("$(printf "%11s %s,%s" "W-c" "$COMPOSITOR" compton_toggle)") +out+=("$(printf "%11s %s,%s" "W-l" "$LOCK" "betterlockscreen -l")") +out+=("$(printf "%11s %s,%s" "W-x" "$EXIT" "mb-jgtools mblogout")") + +out+=("^sep($PANELS)") + +out+=("$(printf "%11s %s,%s" "W" "$M_MAIN" "mb-jgtools main")") +out+=("$(printf "%11s %s,%s" "W-s" "$M_SETTINGS" "mb-jgtools settings")") +out+=("$(printf "%11s %s,%s" "W-A-k" "$M_HELP" "jgkeys-pipe -s")") +out+=("$(printf "%11s %s,%s" "C-W-Left" "$PLACES" "mb-jgtools places")") +out+=("$(printf "%11s %s,%s" "C-W-Right" "$RIGHT" "mb-jgtools right")") + +out+=("^sep($WINDOWS)") +out+=("$(printf "%11s %s,%s" "W-d" "$SHOW_DESKTOP" show_desktop)") +out+=("$(printf "%11s %s,%s" "W-$ARROWS" "$HALF")") +out+=("$(printf "%11s %s,%s" "F11/W-Enter" "$FULL")") + +out+=("^sep($HELPERS)") + +out+=("$(printf "%11s %s,%s" "W-A-t" "$JGTILE" "jgtile")") +out+=("$(printf "%11s %s,%s" "W-A-h" "$HISTORY" "jghistory-pipe -s")") +out+=("$(printf "%11s %s,%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 < ${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' "$REMOVE,mb-setvar places_keyspipe=false;mb-jgtools places" +fi + diff --git a/usr/bin/jglockscreen b/usr/bin/jglockscreen new file mode 100755 index 0000000..6a2ca71 --- /dev/null +++ b/usr/bin/jglockscreen @@ -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 < ${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 (super+l)" + 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 (super+l)" + 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 idea.\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($TYPETO") +#out+=("^sep(Betterlockscreen)") +out+=("$LOCK,mbscreenlocker") +out+=("^sep($GENIMGS)") +out+=("$SELECT_IMG,mbscreenlocker -s") +out+=("$CACHE,mbscreenlocker -c") +out+=("^sep($EFFECT)") +if [ $effect == "dim" -a $screenlocker != "i3lock" ];then +out+=("[ $DIM ],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+=("[ $BLUR ],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+=("[ $DIMBLUR ],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+=("[ $PIXEL ],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+=("[ $DESK ],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 " %4s,%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 < ${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' "$REMOVE,mb-setvar places_jglockscreen=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" +echo $effect +echo $screenlocker diff --git a/usr/bin/jgmenusettings-pipe b/usr/bin/jgmenusettings-pipe new file mode 100755 index 0000000..9894eb6 --- /dev/null +++ b/usr/bin/jgmenusettings-pipe @@ -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 (pipe) 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+=("$SHOW_HIDDEN,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+=("󰄱 $SEARCH_FIELD,mb-setvar search_field=true;mb-jgtools main ipc") +else +out2+=("󰄲 $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+=("$QUICK_NAV,mb-setvar places_quicknav=true;$L") || out2+=("$QUICK_NAV,mb-setvar places_quicknav=false;$L") +[[ $places_bookmarks == false ]] && out2+=("$BOOKMARKS,mb-setvar places_bookmarks=true;$L") || out2+=("$BOOKMARKS,mb-setvar places_bookmarks=false;$L") +if [[ -x "$(command -v VBoxManage)" ]]; then +[[ $places_vboxes == false ]] && out2+=("$VBOXES,mb-setvar places_vboxes=true;$L") || out2+=("$VBOXES,mb-setvar places_vboxes=false;$L") +fi + +out2+=("^sep($PIPEMENUS)") +[[ $places_menusettingspipe = false ]] && out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=true;$L") || out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=false;$L") +[[ $places_jgwallpaperchanger = false ]] && out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=true;$L") || out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=false;$L") +[[ $places_jglockscreen = false ]] && out2+=("$LOCKSCREEN,mb-setvar places_jglockscreen=true;$L") || out2+=("$LOCKSCREEN,mb-setvar places_jglockscreen=false;$L") +[[ $places_jgdesktops = false ]] && out2+=("$DESKTOPS,mb-setvar places_jgdesktops=true;$L") || out2+=("$DESKTOPS,mb-setvar places_jgdesktops=false;$L") +[[ $places_jgdeskmngr = false ]] && out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=true;$L") || out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=false;$L") +[[ $places_jgdeskgrid = false ]] && out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=true;$L") || out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=false;$L") +[[ $places_sysinfopipe = false ]] && out2+=("$SYSINFO,mb-setvar places_sysinfopipe=true;$L") || out2+=("$SYSINFO,mb-setvar places_sysinfopipe=false;$L") +#[[ $places_keyspipe = false ]] && out2+=("$SHORTCUTS,mb-setvar places_keyspipe=true;$L") || out2+=("$SHORTCUTS,mb-setvar places_keyspipe=false;$L") +[[ $places_sshpipe = false ]] && out2+=("$SSH_CONN,mb-setvar places_sshpipe=true;$L") || out2+=("$SSH_CONN,mb-setvar places_sshpipe=false;$L") +[[ $places_softwarepipe = false ]] && out2+=("$POPINSTALL,mb-setvar places_softwarepipe=true;$L") || out2+=("$POPINSTALL,mb-setvar places_softwarepipe=false;$L") + +[[ $places_tint2pipe = false ]] && out2+=("$TINT2,mb-setvar places_tint2pipe=true;$L") || out2+=("$TINT2,mb-setvar places_tint2pipe=false;$L") +[[ $places_conkypipe = false ]] && out2+=("$CONKY,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 [ ${panels_heightpos:-center} ],^checkout(sidepanelpos)") + + + +out2+=("^tag(topmargin)") +for i in 0 20 30 40 50 60 80 100 120 160 200; do out2+=("$(printf "%4s,%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 [ ${panels_topmargin:-0} ],^checkout(topmargin)") + + +# FONTS +out+=("^sep($SIZE)") +out+=("󰛖 $ITEM_FONT [ $menu_font_family $menu_font_size ],^checkout(itemfont)") +out+=("󰛖 $TITLE_FONT [ $menu_sep_font_family $menu_sep_font_size ],^checkout(titlefont)") +#out+=("$FONT_FAMILY [ ${menu_font_family:-0} ],^checkout(fonty)") +#out+=("$FONT_SIZE [ ${menu_font_size:-0} ],^checkout(fontsize)") +out+=("$LINEHEIGHT [ $item_height_factor% ],^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+=("󰛖 $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+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_font_family='${fon}'\";$me") + done + fi + out2+=("^sep()") + out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") + out2+=("^sep($FONT_SIZE)") + out2+=("󰧴 $INCREASE $((menu_font_size+1)) px,mb-setvar menu_font_size=$((menu_font_size+1));$me") + out2+=("󰧳 $DECREASE $((menu_font_size-1)) px,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+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_font_size=$i;$me") + done + + +out2+=("^tag(titlefont)") +out2+=("^sep($TITLE_FONT)") +out2+=("󰛖 $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+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_sep_font_family='${fon}'\";$me") + done + fi + out2+=("^sep()") + out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") + out2+=("^sep($FONT_SIZE)") + out2+=("󰧴 $INCREASE $((menu_sep_font_size+1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size+1));$me") + out2+=("󰧳 $DECREASE $((menu_sep_font_size-1)) px,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+=(" $i px,$me") || out2+=(" $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 "%4s%%,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done + +########## THEMES +out+=("^sep($COLOR_SCHEME)") + +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($ICONS)") +if [ $jgmenu_use_icons == true ]; then + out+=("$HIDE_ICONS [ ${jgmenu_icon_theme} ],mb-setvar jgmenu_use_icons=false;$me") +else + out+=("$SHOW_ICONS [ ${jgmenu_icon_theme} ],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 < ${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' "$REMOVE,mb-setvar places_menusettingspipe=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" +printf '%s\n' "${out3[@]}" diff --git a/usr/bin/jgpicom-pipe b/usr/bin/jgpicom-pipe new file mode 100755 index 0000000..29e2045 --- /dev/null +++ b/usr/bin/jgpicom-pipe @@ -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 + + + +. "$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 (brak)" + EDIT_TITLE="Edytuj ustawienia Picom" + EDIT="Edytuj plik ustawień Kompozytora" + OPENDIR="Otwórz katalog ~/.config/picom/configs" + RENDERER="Rendering Backend" + GLX="glx (zalecany)" + XRENDER="xrender (dla starszego sprzętu)" + _COLORIZER_ROOT="Colorizer - 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 ~/.config/picom/configs" + RENDERER="Rendering Backend" + GLX="glx (recommended)" + XRENDER="xrender (for older hardware)" + _COLORIZER_ROOT="Colorizer rootmenu" + _LEFTSIDEPANEL="Left Sidepanel" + ;; + *) + ENABLE="Start Compositor" + RESTART="Restart Compositor" + DISABLE="Stop Compositor" + CHOOSE="Choose config file" + DEVNULL="/dev/null (none)" + EDIT_TITLE="Edit Compositor settings" + EDIT="Edit Compositor settings file" + OPENDIR="Open ~/.config/picom/configs dir" + RENDERER="Rendering Backend" + GLX="glx (recommended)" + XRENDER="xrender (for older hardware)" + _COLORIZER_ROOT="Colorizer 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+=(" $GLX" " $XRENDER,mb-setvar picom_renderer=xrender;mabox-compositor --restart;${me}") || out+=(" $GLX,mb-setvar picom_renderer=glx;mabox-compositor --restart;${me}" " $XRENDER") + +out+=("^sep($CHOOSE)") + +if [ "$(readlink $CONFFILE)" -ef "/dev/null" ];then + out+=(" $DEVNULL") +else + out+=(" $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+=(" ${item##*/}") +else + out+=(" ${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 < ${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}, +@text,,$((jgtools_padding + 88)),$((jgtools_padding + 116)),180,28,0,left,top,#FFFFFF ,${WINCLR},Mabox Compositor settings + + +$(printf '%s\n' "${out[@]}") + +EOF + + jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null + exit 0 +fi + + + +printf '%s\n' "${out[@]}" + diff --git a/usr/bin/jgsoftware-pipe b/usr/bin/jgsoftware-pipe new file mode 100755 index 0000000..ad3116f --- /dev/null +++ b/usr/bin/jgsoftware-pipe @@ -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' "$REMOVE,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" + diff --git a/usr/bin/jgssh b/usr/bin/jgssh new file mode 100755 index 0000000..ea5cf16 --- /dev/null +++ b/usr/bin/jgssh @@ -0,0 +1,111 @@ +#!/bin/bash +# Daniel Napora 2021 +#: 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+=(" $TERM,^term(ssh $host)") +out2+=(" $FM,pcmanfm $HOME sftp://$host/") +done +out+=("^sep()") +out+=("$EDIT ~/.ssh/config, xdg-open $HOME/.ssh/config") +} + +__removable() { + __mklist + out+=("^sep()") + out+=("$REMOVE,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 < ${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 diff --git a/usr/bin/jgsysinfo-pipe b/usr/bin/jgsysinfo-pipe new file mode 100755 index 0000000..044c771 --- /dev/null +++ b/usr/bin/jgsysinfo-pipe @@ -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 $Lsb_code") + +out+=("$(printf "%+30s %s,%s" "$KERNEL" "$Release" "manjaro-settings-manager -m msm_kernel")") +out+=("$(printf "%+29s %s,%s" "$PKGS" "$(pacman -Q|wc -l)" "pamac-manager")") +out+=("$(printf "%+31s %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 "%s %s %s %s %s %s %s" "$line")") +#done + +##out+=("$SizeMountPoint1") +#out+=("$SizeMountPoint2") +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 "%+29s %s" $DATE "$(date '+%Y.%m.%d (%a)')")") +out2+=("$(printf "%+30s %s" $WEEK "$(date '+%W')")") +out2+=("$(printf "%+30s %s" $DAY "$(date '+%j')")") +out2+=("$(printf "%+29s %s" $TIME "$(date '+%H:%M [%Z]')")") +out2+=("^sep()") +out2+=("$(printf "%+29s %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 < ${MENU_ITEMS} +$(printf '%s\n' "${out[@]}") +$(df -HlT | grep -E '^/'|awk '{print "\"\"\""$0"\"\"\",^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 "\"\"\""$0"\"\"\",^pipe(jgbrowser "$7")"}' +printf '%s\n' "${out2[@]}" +if [ $1 == "-r" ]; then +printf '%s\n' "^sep()" +printf '%s\n' "$REMOVE,mb-setvar places_sysinfopipe=false;mb-jgtools places" +fi diff --git a/usr/bin/jgtint2-pipe b/usr/bin/jgtint2-pipe new file mode 100755 index 0000000..f29bc2a --- /dev/null +++ b/usr/bin/jgtint2-pipe @@ -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="Pulpity (obszary robocze)" + _ADD_DESKTOP="Dodaj pulpit" + _REMOVE_LAST="Usuń ostatni 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="Desktops (workspaces)" + _ADD_DESKTOP="Add new desktop" + _REMOVE_LAST="Remove last 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="Desktops (workspaces)" + _ADD_DESKTOP="Add new desktop" + _REMOVE_LAST="Remove last 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+=(" $_FLOATING_PANEL,t2ctl postype edge ${TINT};$me") || out+=(" $_FLOATING_PANEL,t2ctl postype float ${TINT};$me") + #out+=("$(printf "%-20s %20s" "$POSITION" "[ $VE $HO ]"),^checkout(ppos$i)") + #out+=("$(printf "%-20s %20s" "$SIZE" "[ $W ]"),^checkout(pwidth$i)") + #out+=("$(printf "%-20s %20s" "$WIDTH" "[ $H ]"),^checkout(pheight$i)") + #out+=("$(printf "%-20s %20s" "$MARGIN" "[ $HOR $VERT ]"),^checkout(pmargin$i)") + #out+=("$(printf "%-20s %20s" "$PADDING" "[ $PHOR $PVERT $SPACE ]"),^checkout(ppadding$i)") + #[[ "$HIDE" == 0 ]] && out+=(" $(printf "%-20s %20s" "$AUTOHIDE" ""),^checkout(phide$i)") || out+=(" $(printf "%-20s %20s" "$AUTOHIDE" ""),^checkout(phide$i)") + #out+=("^sep()") + out+=("$POSITION [ $VE $HO ],^checkout(ppos$i)") + out+=("$SIZE [ $W ],^checkout(pwidth$i)") + out+=("$WIDTH [ $H ],^checkout(pheight$i)") + out+=("$MARGIN [ $HOR $VERT ],^checkout(pmargin$i)") + out+=("$PADDING [ $PHOR $PVERT $SPACE ],^checkout(ppadding$i)") + [[ "$HIDE" == 0 ]] && out+=(" $AUTOHIDE,^checkout(phide$i)") || out+=(" $AUTOHIDE,^checkout(phide$i)") + out+=("^sep()") + + out+=("$ICONS [ $ICONTHEME ],^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 [ $(date "+${TF1}") ],^checkout(cl1$i)") + #out+=("$CLOCK_LINE2 [ $(date "+${TF2}") ],^checkout(cl2$i)") + #out2+=("^tag(cl1$i)") + #out2+=("^sep($CLOCK_LINE1)") + #out2+=("$(date +"%H:%M") (%H:%M),t2ctl clockline1 '%H:%M' ${TINT};$me") + #out2+=("$(date +"%I:%M %p") (%I:%M %p),t2ctl clockline1 '%I:%M %p' ${TINT};$me") + #out2+=("$(date +"%-I:%M %p") (%I-:%M %p),t2ctl clockline1 '%-I:%M %p' ${TINT};$me") + #out2+=("$(date +"%H:%M:%S") (%H:%M:%S),t2ctl clockline1 '%H:%M:%S' ${TINT};$me") + #out2+=("$(date +"%H:%M (%a)") (%H:%M (%a)),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+=("$(date +"%A %d %B") (%A %d %B),t2ctl clockline2 '%A %d %B' ${TINT};$me") + #out2+=("$(date +"%a %d %b") (%a %d %b),t2ctl clockline2 '%a %d %b' ${TINT};$me") + #out2+=("$(date +"%x") (%x),t2ctl clockline2 '%x' ${TINT};$me") + #out2+=("$(date +"%m-%d-%Y") (%m-%d-%Y),t2ctl clockline2 '%m-%d-%Y' ${TINT};$me") + #out2+=("$(date +"%F") (%F),t2ctl clockline2 '%F' ${TINT};$me") + #out2+=("$(date +"%e.%m.%y") (%e.%m.%y),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 [ $TASK_ALIGN ],^checkout(talign)") + out2+=("^tag(talign)") + out2+=("^sep($_TASKS_ALIGNMENT)") + for al in left center right;do + [[ "$TASK_ALIGN" == "$al" ]] && out2+=(" $al,$me") || out2+=(" $al,t2ctl tasks_align $al ${TINT};$me") + done + [[ "$TASKBAR_NAME" == 1 ]] && out+=(" $_TASKBAR_NAME,t2ctl taskbar_name 0 ${TINT};$me") || out+=(" $_TASKBAR_NAME,t2ctl taskbar_name 1 ${TINT};$me") + [[ "$DISTR_SIZE" == 1 ]] && out+=(" $_DISTR_SIZE,t2ctl taskbar_distribute_size 0 ${TINT};$me") || out+=(" $_DISTR_SIZE,t2ctl taskbar_distribute_size 1 ${TINT};$me") + + ### FONTS + [[ "$TEXT" == 1 ]] && out+=(" $_TASK_FONT: [ ${TASK_FFAMILY} ${TASK_FSIZE} ],^checkout(taskfont$i)") + [[ "$TASKBAR_NAME" == 1 ]] && out+=(" $_TASKBARNAME_FONT: [ ${TNAME_FFAMILY} ${TNAME_FSIZE} ],^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+=(" $n px,$me") || out2+=(" $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+=(" ${fon},$me") || out2+=(" ${fon},t2ctl task_fontfamily \"${fon}\" ${TINT};$me") + done + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS ,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+=(" $n px,$me") || out2+=(" $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+=(" ${fon},$me") || out2+=(" ${fon},t2ctl taskbar_name_fontfamily \"${fon}\" ${TINT};$me") + done + out2+=("^sep()") + out2+=(" $_EDIT_FAVFONTS ,geany ~/.config/mabox/fonts.list") + fi + ### END FONTS + + out+=(" $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+=("$(printf "%-16s %1s" "$MOUSE_LEFT" "[ $MLEFT ]"),^checkout(mleft$i)") + out2+=("$(printf "%-16s %1s" "$MOUSE_RIGHT" "[ $MRIGHT ]"),^checkout(mright$i)") + out2+=("$(printf "%-16s %1s" "$MOUSE_MIDDLE" "[ $MMIDDLE ]"),^checkout(mmiddle$i)") + out2+=("$(printf "%-16s %1s" "$MOUSE_UP" "[ $MUP ]"),^checkout(mup$i)") + out2+=("$(printf "%-16s %1s" "$MOUSE_DOWN" "[ $MDOWN ]"),^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+=(" $SHOW_BOTH,$me")||out2+=(" $SHOW_BOTH,t2ctl tb_both 1 ${TINT};$me") + [[ "$TEXT" = 1 && "$ICON" = 0 ]] && out2+=(" $SHOW_TEXT,$me")||out2+=(" $SHOW_TEXT,t2ctl tb_text 1 ${TINT};$me") + [[ "$ICON" = 1 && "$TEXT" = 0 ]] && out2+=(" $SHOW_ICON,$me")||out2+=(" $SHOW_ICON,t2ctl tb_icon 1 ${TINT};$me") + out2+=("^sep()") + [[ "$CENTERED" = 1 ]] && out2+=(" $CENTER_TEXT,t2ctl tb_centered 0 ${TINT};$me")||out2+=(" $CENTER_TEXT,t2ctl tb_centered 1 ${TINT};$me") + #out2+=("^sep()") + #out2+=("$BUTTON_WIDTH [ $TB_WIDTH ],^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+=(" $ts px") || out2+=(" $ts px,t2ctl tb_width $ts ${TINT};$me") + done + out2+=("^sep()") + [[ "$TB_WIDTH" == "0" ]] && out2+=(" $FILL,t2ctl tb_width 0 ${TINT};$me") || out2+=(" $FILL,t2ctl tb_width 0 ${TINT};$me") + + out2+=("^sep($TOOLTIPS)") + [[ "$TOOLTIP" = 0 && "$THUMBNAIL" = 0 ]] && out2+=(" $TOOLTIPS_NONE,t2ctl tb_tooltip_none 0 ${TINT};$me")||out2+=(" $TOOLTIPS_NONE,t2ctl tb_tooltip_none 1 ${TINT};$me") + [[ "$TOOLTIP" = 1 && "$THUMBNAIL" = 0 ]] && out2+=(" $SHOW_TOOLTIPS,t2ctl tb_tooltip 0 ${TINT};$me")||out2+=(" $SHOW_TOOLTIPS,t2ctl tb_tooltip 1 ${TINT};$me") + [[ "$TOOLTIP" = 1 && "$THUMBNAIL" = 1 ]] && out2+=(" $THUMBNAILS,t2ctl tb_thumbnail 0 ${TINT};$me")||out2+=(" $THUMBNAILS,t2ctl tb_thumbnail 1 ${TINT};$me") + out2+=("") + + desktops=$(wmctrl -d |wc -l) + out+=("$_DESKTOPS [ $desktops ],^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+=(" ${si},$me") || out2+=(" ${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+=(" $COMPACT,t2ctl shrink 1 ${TINT};$me ") || out2+=(" $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+=(" $hi px,t2ctl height $hi ${TINT};$me") || out2+=(" $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+=(" $hor px,t2ctl marginh $hor ${TINT};$me") || out2+=(" $hor px,t2ctl marginh $hor ${TINT};$me") + done + out2+=("^sep($VERTICAL)") + for vert in "${margins[@]}" + do + [[ "$VERT" == "$vert" ]] && out2+=(" $vert px,t2ctl marginv $vert ${TINT};$me") || out2+=(" $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+=(" $phor px,t2ctl paddingh $phor ${TINT};$me") || out2+=(" $phor px,t2ctl paddingh $phor ${TINT};$me") + done + out2+=("") + out2+=("^sep($VERTICAL)") + for pvert in "${margins[@]}" + do + [[ "$PVERT" == "$pvert" ]] && out2+=(" $pvert px,t2ctl paddingv $pvert ${TINT};$me") || out2+=(" $pvert px,t2ctl paddingv $pvert ${TINT};$me") + done + + out2+=("^sep($SPACING)") + for space in "${margins[@]}" + do + [[ "$SPACE" == "$space" ]] && out2+=(" $space px,t2ctl spacing $space ${TINT};$me") || out2+=(" $space px,t2ctl spacing $space ${TINT};$me") + done + + out2+=("^tag(phide$i)") + out2+=("^sep($AUTOHIDE)") + [[ "$HIDE" == 0 ]] && out2+=(" $NO,t2ctl autohide 0 ${TINT}") || out2+=(" $NO,t2ctl autohide 0 ${TINT}") + [[ "$HIDE" == 0 ]] && out2+=(" $YES,t2ctl autohide 1 ${TINT}") || out2+=(" $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(............$TITLE............)") +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: $TINT2)") + ((i=i+1)) + getvalues + qactions + out+=("^sep($ADVANCED)") + out+=(" $EDIT_TINT2 $TINT2,geany $TINT") + out+=(" $CONFIGURE $TINT2,tint2conf $TINT") + if [ -f "/usr/share/mabox/lang/${LNG}/.config/tint2/${TINT2}" ];then + out+=("^sep()") + out+=("$RESET $TINT2,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+=(" CPU,mb-setvar phwmon_cpu=true;$PHWRUN;$me") || out+=(" CPU,mb-setvar phwmon_cpu=false;$PHWRUN;$me") +[[ $phwmon_mem = false ]] && out+=(" $MEM,mb-setvar phwmon_mem=true;$PHWRUN;$me") || out+=(" $MEM,mb-setvar phwmon_mem=false;$PHWRUN;$me") +SW=$(swapon -s|wc -l) +if [[ "$SW" > 0 ]];then +[[ $phwmon_swap = false ]] && out+=(" Swap,mb-setvar phwmon_swap=true;$PHWRUN;$me") || out+=(" Swap,mb-setvar phwmon_swap=false;$PHWRUN;$me") +fi +[[ $phwmon_net = false ]] && out+=(" $NET,mb-setvar phwmon_net=true;$PHWRUN;$me") || out+=(" $NET,mb-setvar phwmon_net=false;$PHWRUN;$me") +[[ $phwmon_io = false ]] && out+=(" $DISC_IO,mb-setvar phwmon_io=true;$PHWRUN;$me") || out+=(" $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+=(" $_OPEN_CFG_DIR,exo-open ~/.config/tint2/") +out+=("^sep()") +#out+=("$CHOOSE_TINT2,$TZEN") +out+=(" $RESTART_TINT2,mb-tint2restart") +out+=(" $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 < ${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' "$REMOVE,mb-setvar places_tint2pipe=false;mb-jgtools places" +fi diff --git a/usr/bin/jgtint2launcher b/usr/bin/jgtint2launcher new file mode 100755 index 0000000..386e807 --- /dev/null +++ b/usr/bin/jgtint2launcher @@ -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,$TITLE") +out+=("@search,,34,29,292,20,4,left,top,auto,#262626,\"\"\" $TYPE_TO_SEARCH\"\"\"") +out+=("^sep($CURRENT)") +out+=(" $OPENDIR (~/.config/tint2/launcherapps),${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 ${filename%.*},rm $item;killall -SIGUSR1 tint2;jgtint2launcher") +fi +done +if [[ $a -gt 1 ]]; then +out+=("^sep()") +out+=("$DEL $ALL: ($a),rm -f $LAUNCHERDIR/*.desktop;killall -SIGUSR1 tint2;jgtint2launcher") +fi + +out+=("^sep($ADD...)") +out+=(" $OPENDIR (/usr/share/applications),${JGMENU_RESOURCE_OPENER} $APPSDIR") +out+=("^sep()") +for item in "$APPSDIR"/*.desktop; do +filename=${item##*/} +filename=${filename^} +out+=("$ADD ${filename%.*},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 < ${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 + + diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger new file mode 100755 index 0000000..0fe6edf --- /dev/null +++ b/usr/bin/jgwallpaperchanger @@ -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 < ${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 < ${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 stylizacja pulpitu" + _WALLPAPERS="Tapety" + _RANDWALL="Losowa tapeta" + _FAVORITES="Ulubione..." + _FAVORITES_WP="Ulubione tapety" + _RAND_FAV="Losowa z Ulubionych" + _ADD_FAV="Dodaj bieżącą 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óć domyślną" + _EDIT_WPDIRS="Edytuj katalogi z tapetami" + _GENERATOR="Generuj (ImageMagick)..." + _CHOOSE_WP="Wybierz tapetę..." + _OPEN_DIR="Otwórz katalog i..." + _USE_CONTEXTMENU="użyj menu kontekstowego" + _SLIDESHOW_DESC="Pokaz slajdów" + _SLIDESHOW="pokaz slajdów" + _ABOUT_SLIDESHOW="O pokazie slajdów" + _STARTS="Uruchom Pokaz slajdów (zatrzymany)" + _STOPS="Zatrzymaj Pokaz slajdów (działający - interwał: $interval sek.)" + _INTERVAL="Interwał slajdów" + _INTERVAL_DESC="Interwał Pokazu Slajdów" + _SEC="sekund" + _WPDIR="Kolekcje tapet" + _WPDIRS="Katalogi z tapetami" + _WPDIRS_DESC="dla losowa/podgląd/pokaz slajdów" + _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="Colorizer menu główne" + _COLORIZER_FONTS="Konfiguruj Czcionki" + _COLORIZER_PICOM="Kompozytor Picom" + _COLORIZER_OB="Moduł Openbox" + _COLORIZER_MENU="Moduł Menu" + _COLORIZER_CONKY="Menadżer Widżetów Conky" + _COLORIZER_PYRADIO="Moduł PyRadio" + _COLORIZER_CAVA="Moduł Cava" + _PANEL_ICON_ACTIONS="Ikona na panelu i akcje" + _WIDE_ICON="Szeroka ikona" + + _B_LC_ACTION="lewy klik" + _B_LC_ACTION="lewy-klik" + _P_B_LC_ACTION="Po lewym kliku w przycisk na panelu" + _B_WU_ACTION="kółko-w-górę" + _P_B_WU_ACTION="Akcja dla kółko-w-górę" + _B_WD_ACTION="kółko-w-dół" + _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 losową tapetę" + _RANDOMFAV_DESC="Ustaw losową z ulubionych" + _CHOOSE_DESC="Wybierz tapetę (z menu kontekstowego)" + _PREVIEW_DESC="Podgląd użyj 󱦱 󱦰 Enter Esc " + _COL_WINDOW_DESC="Colorizer - okno" + _COL_MENU_DESC="Colorizer - dynamiczne menu" + _SHOW_DESK_DESC="Pokaż pulpit" + _WIN_SWITCH_DESC="Wybierz Okno (skippy-xd)" + _DESK_SWITCH_DESC="Wybierz Pulpit (skippy-xd)" + _GOBACK="powrót" + + _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="Wszystko" + _APPLY_REVERSE="Wszystko odwrotnie (jasny 易 ciemny)" + _APPLY_ONLY_TO="Zastosuj tylko do..." + _RESET_WP_THEMES="Reset tapety i motywów" + _ENABLED="włączony" + _DISABLED="wyłączony" + _LIGHTBG="jasny wariant" + _DARKBG="ciemny wariant" + _NONE="none wyłączone" + + _DESKTOP_STYLING="Stylizacja Pulpitu" + _OB_WD="OpenBox Dekoracje Okien" + _MABOX_MENUS=" Menu 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 styling" + _WALLPAPERS="Wallpapers" + _RANDWALL="Random Wallpaper" + _FAVORITES="Favorite..." + _FAVORITES_WP="Favorite Wallpapers" + _RAND_FAV="Random from Favorites" + _ADD_FAV="Add current 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 default" + _EDIT_WPDIRS="Edit Wallpaper dirs" + _GENERATOR="Generate (ImageMagick)..." + _CHOOSE_WP="Choose Wallpaper" + _OPEN_DIR="Open directory and..." + _USE_CONTEXTMENU="use context menu" + _SLIDESHOW_DESC="Wallpaper Slideshow" + _SLIDESHOW="slideshow" + _ABOUT_SLIDESHOW="About Slideshow" + _STARTS="Start Slideshow (stopped)" + _STOPS="Stop Slideshow (running - interval: $interval sec.)" + _INTERVAL="Interval" + _INTERVAL_DESC="Slideshow Interval" + _SEC="seconds" + _WPDIR="Wallpaper Collections" + _WPDIRS="Directories with Wallpapers" + _WPDIRS_DESC="for random/preview/slideshow utils" + _TOTAL="Total" + _WPS="wallpapers in" + _DIRS="dirs" + _LEFTPANEL="Left panel" + _OBTHEME="Openbox Theme" + _MENUPANELS="Menus/Panels" + _COLORIZER_CONKY="Conky Widget Manager" + _COLORIZER_HELP="Main Window and Help" + _COLORIZER_ROOT="Colorizer rootmenu" + _COLORIZER_FONTS="Configure Fonts" + _COLORIZER_PICOM="Compositor settings (Picom)" + _PANEL_ICON_ACTIONS="Panel icon and actions" + _WIDE_ICON="Wide icon" + _B_LC_ACTION="left-click" + _P_B_LC_ACTION="Panel icon left-click action" + _B_WU_ACTION="wheel-up" + _P_B_WU_ACTION="Panel icon wheel-up action" + _B_WD_ACTION="wheel-down" + _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 random wallpaper" + _RANDOMFAV_DESC="Set random from favorites" + _CHOOSE_DESC="Choose wallpaper (from context menu)" + _PREVIEW_DESC="Preview & set use 󱦱 󱦰 Enter Esc " + _COL_WINDOW_DESC="Colorizer - window" + _COL_MENU_DESC="Colorizer - dynamic menu" + _SHOW_DESK_DESC="Toggle ShowDesktop" + _WIN_SWITCH_DESC="Windows Switcher (skippy-xd)" + _DESK_SWITCH_DESC="Desktop Switcher (skippy-xd)" + _GOBACK="go back" + + _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="All elements" + _APPLY_REVERSE="All elements inversely (dark 易 light)" + _APPLY_ONLY_TO="Apply only to..." + _RESET_WP_THEMES="Reset (wallpaper and themes)" + _ENABLED="enabled" + _DISABLED="disabled" + _LIGHTBG="light variant" + _DARKBG="dark variant" + _NONE="none (disabled)" + + _DESKTOP_STYLING="Desktop styling" + _OB_WD="OpenBox Window Decorations" + _MABOX_MENUS="Mabox Menus" + _CHANGE_THEME="Change theme" + _CLICK_TO_APPLY="click to apply" + SYSTEM_THEMES="System themes..." + YOUR_THEMES="Your themes..." + THEME="Theme" + _GENERATE="Generate..." + MONOCHROMATIC="Monochromatic (pick color)" + CHOOSE_AND_PICK="Choose variant and pick color..." + GENERATEFROMWP="...from wallpaper colors..." + EXACT="exact" + LIGHTBG="light variant" + DARKBG="dark variant" + RANDOMIZE="Random" + _MORE_OPTIONS="need more options?" + _COLOR_TUNING="color tuning?" + _SAVE_OWN="save/delete own themes?" + _USE="use..." + ;; +esac + +. $HOME/.config/mabox/mabox.conf +help="\nBased on idea 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 < ${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+=("\"\"\" ${label}\"\"\",^checkout(delfav)") + out3+=("^tag(delfav)") + out3+=("^sep($_REMOVE_FROM_FAV)") + out3+=("^sep($_AND_SET_RANDOM ?)") + out3+=("\"\"\"$_YES_REMOVE ${label}\"\"\",jgwallpaperchanger remfav ${wpfile:1};$me") + isfav=1 + else + favs+=("\"\"\" ${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+=(" $_RANDWALL,mbwallpaper -o;$me") + out+=(" $_FAVORITES [ $fav ],^checkout(favwp)") + out2+=("^tag(favwp)") + out2+=("^sep($_FAVORITES_WP)") + if [[ "$wallpap" != "/usr/share/backgrounds/marek-piwnicki-FgagFhxW4Sc-unsplash.jpg" ]]; then + out2+=("󰦛 $_DEFAULT_WP,nitrogen --set-scaled --save /usr/share/backgrounds/marek-piwnicki-FgagFhxW4Sc-unsplash.jpg;$me") + out2+=("^sep()") + + else + isfav=1 + fi + out2+=(" $_RAND_FAV,jgwallpaperchanger randomfav;$me") + out2+=("^sep()") + + if [[ "${isfav}" != "1" ]];then + out2+=("󱐮 $_ADD_FAV,jgwallpaperchanger addfav ${wallpap};$me") + out2+=("^sep()") + fi + out2+=("${favs[@]}") + out2+=("^sep()") + out2+=(" $_EDIT_FAV,xdg-open $FAVWP") + + + + #out+=("󰉔 $_CHOOSE_WP,pcmanwp") + out+=(" $_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+=("(${wallp}) ${dir},pcmanfm ${dir}") + wpimgs=$((wpimgs+wallp)) + done + + out+=("^sep()") + out+=(" $_PREVIEW_DESC,mbwallpaper -c") + out+=("󰧸 $_SLIDESHOW_DESC,^checkout(sshow)") + out+=("󱡄 $_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+=(" (${wallp}) ${dir}") || out2+=(" (${wallp}) ${dir},mbwallpaper changedir ${dir};$me") + wpimgs=$((wpimgs+wallp)) + done + out2+=("^sep($_TOTAL: $wpimgs $_WPS ${#wpdirs[@]} $_DIRS)") + out2+=(" $_EDIT_WPDIRS,xdg-open $CNF_FILE") + out+=("󰉔 $_WPDIR [ ${#wpdirs[@]} ],^checkout(wpdirs)") + + else + out+=(" $_STOPS,killall mbwallpaper;pkill -f 'yad --not';$me") +fi + + +out1+=("^tag(sshow)") +out1+=("^sep($_SLIDESHOW_DESC)") +out1+=(" $_STARTS,run_wallpaperslideshow") +out1+=("^sep($_INTERVAL_DESC)") +[[ "${interval}" == "10" ]] && out1+=(" 10s,mb-setvar interval=10 $CONF_FILE;$me") || out1+=(" 10s,mb-setvar interval=10 $CONF_FILE;$me") +[[ "${interval}" == "30" ]] && out1+=(" 30s,mb-setvar interval=30 $CONF_FILE;$me") || out1+=(" 30s,mb-setvar interval=30 $CONF_FILE;$me") +[[ "${interval}" == "60" ]] && out1+=(" 1m ,mb-setvar interval=60 $CONF_FILE;$me") || out1+=(" 1m,mb-setvar interval=60 $CONF_FILE;$me") +[[ "${interval}" == "120" ]] && out1+=(" 2m ,mb-setvar interval=120 $CONF_FILE;$me") || out1+=(" 2m,mb-setvar interval=120 $CONF_FILE;$me") +[[ "${interval}" == "300" ]] && out1+=(" 5m ,mb-setvar interval=300 $CONF_FILE;$me") || out1+=(" 5m,mb-setvar interval=300 $CONF_FILE;$me") +[[ "${interval}" == "600" ]] && out1+=(" 10m ,mb-setvar interval=600 $CONF_FILE;$me") || out1+=(" 10m,mb-setvar interval=600 $CONF_FILE;$me") +[[ "${interval}" == "900" ]] && out1+=(" 15m ,mb-setvar interval=900 $CONF_FILE;$me") || out1+=(" 15m,mb-setvar interval=900 $CONF_FILE;$me") +[[ "${interval}" == "1800" ]] && out1+=(" 30m ,mb-setvar interval=1800 $CONF_FILE;$me") || out1+=(" 30m,mb-setvar interval=1800 $CONF_FILE;$me") +[[ "${interval}" == "3600" ]] && out1+=(" 1h ,mb-setvar interval=3600 $CONF_FILE;$me") || out1+=(" 1h,mb-setvar interval=3600 $CONF_FILE;$me") +#out1+=(" $EDITCONF ,xdg-open $CONF_FILE") +#out1+=(" $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($_ON_WP_CHANGE)") + +out+=(" $_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+=(" $_APPLY_TO_ALL,w2theme colorize;$me applyto") +out2+=(" $_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+=(" $_AUTOTH_SETTINGS,^checkout(autotheming)") || out+=(" $_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+=(" $_ENABLED") || out2+=(" $_ENABLED,mb-setvar wall2themes=yes $COLORIZER_CONF;$me") +[[ "$wall2themes" != "yes" ]] && out2+=(" $_DISABLED") || out2+=(" $_DISABLED,mb-setvar wall2themes=no $COLORIZER_CONF;$me") + +out2+=("^sep(OpenBox)") +[[ "$wall2themes_ob" == "light" ]] && out2+=(" $_LIGHTBG") || out2+=(" $_LIGHTBG,mb-setvar wall2themes_ob=light $COLORIZER_CONF;$me autoth") +[[ "$wall2themes_ob" == "dark" ]] && out2+=(" $_DARKBG") || out2+=(" $_DARKBG,mb-setvar wall2themes_ob=dark $COLORIZER_CONF;$me autoth") +out2+=("^sep()") +[[ "$wall2themes_ob" == "none" ]] && out2+=(" $_NONE") || out2+=(" $_NONE,mb-setvar wall2themes_ob=none $COLORIZER_CONF;$me autoth") +out2+=("^sep(Menu)") +[[ "$wall2themes_menu" == "light" ]] && out2+=(" $_LIGHTBG") || out2+=(" $_LIGHTBG,mb-setvar wall2themes_menu=light $COLORIZER_CONF;$me autoth") +[[ "$wall2themes_menu" == "dark" ]] && out2+=(" $_DARKBG") || out2+=(" $_DARKBG,mb-setvar wall2themes_menu=dark $COLORIZER_CONF;$me autoth") +out2+=("^sep()") +[[ "$wall2themes_menu" == "none" ]] && out2+=(" $_NONE") || out2+=(" $_NONE,mb-setvar wall2themes_menu=none $COLORIZER_CONF;$me autoth") +out2+=("^sep(Conky)") +[[ "$wall2themes_conky" == "light" ]] && out2+=(" $_LIGHTBG") || out2+=(" $_LIGHTBG,mb-setvar wall2themes_conky=light $COLORIZER_CONF;$me autoth") +[[ "$wall2themes_conky" == "dark" ]] && out2+=(" $_DARKBG") || out2+=(" $_DARKBG,mb-setvar wall2themes_conky=dark $COLORIZER_CONF;$me autoth") +out2+=("^sep()") +[[ "$wall2themes_conky" == "none" ]] && out2+=(" $_NONE") || out2+=(" $_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+=(" $_LIGHTBG") || out3+=(" $_LIGHTBG,mb-setvar wall2themes_pyradio=light $COLORIZER_CONF;$me autoth") +[[ "$wall2themes_pyradio" == "dark" ]] && out3+=(" $_DARKBG") || out3+=(" $_DARKBG,mb-setvar wall2themes_pyradio=dark $COLORIZER_CONF;$me autoth") +out3+=("^sep()") +[[ "$wall2themes_pyradio" == "none" ]] && out3+=(" $_NONE") || out3+=(" $_NONE,mb-setvar wall2themes_pyradio=none $COLORIZER_CONF;$me autoth") +out3+=("^sep(Cava)") +out3+=("^sep(not implemented yet)") +out3+=("Use Colorizer Cava,colorizer-cava -s") + + +palettes=$(shopt -s nullglob ; set -- $WALLPALDIR/*.clr ; echo $#) +if [[ "$palettes" -gt "1" ]];then +out2+=("^sep()") +out2+=(" Remove cached palletes ($palettes),rm $WALLPALDIR/*.clr;$me") +fi + +[[ "${2}" == "autoth" ]] && out2+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + + + + + +out+=("^sep()") +out+=("󰅙 $_RESET_WP_THEMES,w2theme resetall;$me") + + +### STYLES +out+=("^sep($_DESKTOP_STYLING)") +out+=(" $_OB_WD,^checkout(obox)") +out+=(" $_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+=(" $(printf '%-20s' "${scheme_name}") in ,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+=(" $(printf '%-20s' "${scheme_name}") in ,obtctl applytheme usr ${n};$me obox" "^sep()") +done < <(tail -n +2 "$OB_USERTHEMES") +fi + +out1+=("^sep($_GENERATE)") +out1+=(" $RANDOMIZE,obtctl randomizer;$me obox") +out1+=(" $MONOCHROMATIC,^checkout(monoch)") +out2+=("^tag(monoch)") +out2+=("^sep($CHOOSE_AND_PICK)") +out2+=(" $LIGHTBG...,obtctl mono pick light stylemenu") +out2+=(" $DARKBG...,obtctl mono pick dark stylemenu") +out1+=("^sep($GENERATEFROMWP)" "^sep()") +out1+=(" $LIGHTBG ,w2theme ob light;$me obox" "^sep()") +out1+=(" $DARKBG ,w2theme ob dark;$me obox") +out1+=("^sep()") + +out1+=("^sep($_MORE_OPTIONS)") +out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)") +out1+=("$_USE Colorizer OpenBox,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+=(" $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+=(" $(printf '%-18s' "${scheme_name}") title [ sel ] ${icon} ,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+=(" $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+=(" $(printf '%-18s' "${scheme_name}") title [ sel ] ${icon} ,jgctl applyscheme usr ${n};$me jgmenus" "^sep()") + done < <(tail -n +2 "$MENU_USERSCHEMES") +fi + + out1+=("^sep($_GENERATE)") + out1+=(" $RANDOMIZE,jgctl randomscheme;$me jgmenus") + out1+=(" $MONOCHROMATIC,^checkout(monoch_menu)") + out2+=("^tag(monoch_menu)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $EXACT...,jgctl mono pick exact stylemenu") + out2+=("^sep()") + out2+=(" $LIGHTBG...,jgctl mono pick light stylemenu") + out2+=(" $DARKBG...,jgctl mono pick dark stylemenu") + out1+=("^sep($GENERATEFROMWP)") + out1+=(" $LIGHTBG,w2theme menu light;$me jgmenus") + out1+=(" $DARKBG,w2theme menu dark;$me jgmenus") + +out1+=("^sep($_MORE_OPTIONS)") +out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)") +out1+=("$_USE Colorizer Menu module,colorizer-menus -s") + +[[ "${2}" == "jgmenus" ]] && out1+=("^sep()" "${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + + +## CONKIES +out+=("^sep()") +out+=(" $_COLORIZER_CONKY,colorizer-conky -s") + + + + +#out+=("^sep()") +#out+=(" $_COLORIZER_FONTS,colorizer-fonts -s") +#out+=("^sep()") +#out+=(" $_COLORIZER_PICOM,jgpicom-pipe -s") +out+=("^sep()") +#out+=("$_COLORIZER_HELP,ycolorizer") +out+=(" $_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+=(" $_WIDE_ICON,mb-setvar wp_icon=square $CONF_FILE;tint2-send refresh-execp mb-t2wall;${me}") || out+=("󰄱 $_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 [ $_RAND ],^checkout(laction)");; + randfav) out+=("󰳽 $_B_LC_ACTION [ randfav ],^checkout(laction)");; + choose) out+=("󰳽 $_B_LC_ACTION [ $_CHOOSE ],^checkout(laction)");; + preview) out+=("󰳽 $_B_LC_ACTION [ $_PREVIEW ],^checkout(laction)");; + menu) out+=("󰳽 $_B_LC_ACTION [ $_WALL_MENU ],^checkout(laction)");; + slideshow) out+=("󰳽 $_B_LC_ACTION [ $_SLIDESHOW ],^checkout(laction)");; + window) out+=("󰳽 $_B_LC_ACTION [ $_COL_WINDOW ],^checkout(laction)");; + colmenu) out+=("󰳽 $_B_LC_ACTION [ $_COL_MENU ],^checkout(laction)");; + *) out+=("󰳽 $_B_LC_ACTION [ $_CHOOSE ],^checkout(laction)");; + esac + + out2+=("^tag(laction)") + out2+=("^sep($_P_B_LC_ACTION)") + [[ "$t2_button_lclick_action" == "random" ]] && out2+=(" $_RANDOM_DESC") || out2+=(" $_RANDOM_DESC,mb-setvar t2_button_lclick_action=random $CONF_FILE") + [[ "$t2_button_lclick_action" == "randfav" ]] && out2+=(" $_RANDOMFAV_DESC") || out2+=(" $_RANDOMFAV_DESC,mb-setvar t2_button_lclick_action=randfav $CONF_FILE") + [[ "$t2_button_lclick_action" == "choose" ]] && out2+=(" $_CHOOSE_DESC") || out2+=(" $_CHOOSE_DESC,mb-setvar t2_button_lclick_action=choose $CONF_FILE") + [[ "$t2_button_lclick_action" == "preview" ]] && out2+=(" $_PREVIEW_DESC") || out2+=(" $_PREVIEW_DESC,mb-setvar t2_button_lclick_action=preview $CONF_FILE") + [[ "$t2_button_lclick_action" == "menu" ]] && out2+=(" $_WALL_MENU_DESC") || out2+=(" $_WALL_MENU_DESC,mb-setvar t2_button_lclick_action=menu $CONF_FILE") + [[ "$t2_button_lclick_action" == "slideshow" ]] && out2+=(" $_SLIDESHOW_DESC") || out2+=(" $_SLIDESHOW_DESC,mb-setvar t2_button_lclick_action=slideshow $CONF_FILE") + out2+=("^sep()") + [[ "$t2_button_lclick_action" == "window" ]] && out2+=(" $_COL_WINDOW_DESC") || out2+=(" $_COL_WINDOW_DESC,mb-setvar t2_button_lclick_action=window $CONF_FILE") + [[ "$t2_button_lclick_action" == "colmenu" ]] && out2+=(" $_COL_MENU_DESC") || out2+=(" $_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 [ $_SHOW_DESK ],^checkout(wuaction)");; + win-switch) out+=("󱕑 $_B_WU_ACTION [ $_WIN_SWITCH ],^checkout(wuaction)");; + desk-switch) out+=("󱕑 $_B_WU_ACTION [ $_DESK_SWITCH ],^checkout(wuaction)");; + win-next) out+=("󱕑 $_B_WU_ACTION [ $_WIN_NEXT ],^checkout(wuaction)");; + win-prev) out+=("󱕑 $_B_WU_ACTION [ $_WIN_PREV ],^checkout(wuaction)");; + random) out+=("󱕑 $_B_WU_ACTION [ $_RAND ],^checkout(wuaction)");; + esac + out2+=("^tag(wuaction)") + out2+=("^sep($_P_B_WU_ACTION)") + [[ "$t2_button_wheelup_action" == "show-desk" ]] && out2+=(" $_SHOW_DESK_DESC") || out2+=(" $_SHOW_DESK_DESC,mb-setvar t2_button_wheelup_action=show-desk $CONF_FILE") + [[ "$t2_button_wheelup_action" == "random" ]] && out2+=(" $_RANDOM_DESC") || out2+=(" $_RANDOM_DESC,mb-setvar t2_button_wheelup_action=random $CONF_FILE") + [[ "$t2_button_wheelup_action" == "win-switch" ]] && out2+=(" $_WIN_SWITCH_DESC") || out2+=(" $_WIN_SWITCH_DESC,mb-setvar t2_button_wheelup_action=win-switch $CONF_FILE") + [[ "$t2_button_wheelup_action" == "desk-switch" ]] && out2+=(" $_DESK_SWITCH_DESC") || out2+=(" $_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+=(" $_WIN_NEXT_DESC") || out2+=(" $_WIN_NEXT_DESC,mb-setvar t2_button_wheelup_action=win-next $CONF_FILE") + #[[ "$t2_button_wheelup_action" == "win-prev" ]] && out2+=(" $_WIN_PREV_DESC") || out2+=(" $_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 [ $_SHOW_DESK ],^checkout(wdaction)");; + win-switch) out+=("󱕐 $_B_WD_ACTION [ $_WIN_SWITCH ],^checkout(wdaction)");; + desk-switch) out+=("󱕐 $_B_WD_ACTION [ $_DESK_SWITCH ],^checkout(wdaction)");; + win-next) out+=("󱕑 $_B_WD_ACTION [ $_WIN_NEXT ],^checkout(wdaction)");; + win-prev) out+=("󱕑 $_B_WD_ACTION [ $_WIN_PREV ],^checkout(wdaction)");; + random) out+=("󱕐 $_B_WD_ACTION [ $_RAND ],^checkout(wdaction)");; + esac + out2+=("^tag(wdaction)") + out2+=("^sep($_P_B_WD_ACTION)") + [[ "$t2_button_wheeldown_action" == "show-desk" ]] && out2+=(" $_SHOW_DESK_DESC") || out2+=(" $_SHOW_DESK_DESC,mb-setvar t2_button_wheeldown_action=show-desk $CONF_FILE") + [[ "$t2_button_wheeldown_action" == "random" ]] && out2+=(" $_RANDOM_DESC") || out2+=(" $_RANDOM_DESC,mb-setvar t2_button_wheeldown_action=random $CONF_FILE") + [[ "$t2_button_wheeldown_action" == "win-switch" ]] && out2+=(" $_WIN_SWITCH_DESC") || out2+=(" $_WIN_SWITCH_DESC,mb-setvar t2_button_wheeldown_action=win-switch $CONF_FILE") + [[ "$t2_button_wheeldown_action" == "desk-switch" ]] && out2+=(" $_DESK_SWITCH_DESC") || out2+=(" $_DESK_SWITCH_DESC,mb-setvar t2_button_wheeldown_action=desk-switch $CONF_FILE") + #[[ "$t2_button_wheeldown_action" == "win-next" ]] && out2+=(" $_WIN_NEXT_DESC") || out2+=(" $_WIN_NEXT_DESC,mb-setvar t2_button_wheeldown_action=win-next $CONF_FILE") + #[[ "$t2_button_wheeldown_action" == "win-prev" ]] && out2+=(" $_WIN_PREV_DESC") || out2+=(" $_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, Auto theming $_ENABLED ! +" +fi + +cat < ${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}, +#@text,,$((jgtools_padding + 194)),$((jgtools_padding + 20)),100,28,0,left,top,#FFFFFF 45,${WINCLR}, +@text,,$((jgtools_padding + 14)),$((jgtools_padding + 94)),180,28,0,left,top,#FFFFFF ,${WINCLR},$_TITLE +$(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' "$_REMOVE,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 diff --git a/usr/bin/jgwallpapergenerate b/usr/bin/jgwallpapergenerate new file mode 100755 index 0000000..1268df4 --- /dev/null +++ b/usr/bin/jgwallpapergenerate @@ -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 < ${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="Generator tapet (ImageMagick)" + _RANDCOLORS="Losowe kolory" + _PICKCOLORS="Wybór kolorów..." + _WALLPAPERMENU="Menu Tapety" + _RANDOMEFFECT="Losowy efekt" + _SOLID="Jednolity kolor" + _BLURRED="Rozmycie" + _LINEAR="Gradient liniowy" + _RADIAL="Gradient promieniowy" + _TWISTED="Skręcony gradient " + _BILINEAR="Gradient dwuliniowy" + _PLASMA="Plazma" + _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="format obrazków" + _RECOMMENDED="(małe pliki - zalecany)" + ;; + *) + _TITLE="Wallpaper Generator (ImageMagick)" + _RANDCOLORS="Random colors" + _PICKCOLORS="Pick colors..." + _WALLPAPERMENU="Wallpapers Menu" + _RANDOMEFFECT="Random effect" + _SOLID="Solid color" + _BLURRED="Blurred" + _LINEAR="Linear gradient" + _RADIAL="Radial gradient" + _TWISTED="Twisted gradient" + _BILINEAR="Bilinear gradient" + _PLASMA="Plasma" + _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="image format" + _RECOMMENDED="(small filesize - recommended)" + ;; +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+=(" $_OPENDIR,xdg-open $DIR") +out+=(" $_EMPTYDIR,rm ${DIR}/*.*;$me") +fi +out+=("^sep($_SETTINGS)") +[[ "$show_preview" == "yes" ]] && out+=("󰱒 $_PREVIEW,mb-setvar show_preview=no $CONFIG_FILE;${me}") || out+=("󰄱 $_PREVIEW,mb-setvar show_preview=yes $CONFIG_FILE;${me}") +out+=("^sep($_IMG_FORMAT)") +[[ "$extension" == "avif" ]] && out+=(" avif $_RECOMMENDED,mb-setvar extension=png $CONFIG_FILE;${me}") || out+=(" avif $_RECOMMENDED,mb-setvar extension=avif $CONFIG_FILE;${me}") +[[ "$extension" == "png" ]] && out+=(" png,mb-setvar extension=avif $CONFIG_FILE;${me}") || out+=(" 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 < ${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},󱡄 +@text,,$((jgtools_padding + 4)),$((jgtools_padding + 116)),250,28,0,left,top,#FFFFFF ,${WINCLR},$_TITLE +$(printf '%s\n' "${out[@]}") +EOF + +jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null + +exit 0 + +fi +printf '%s\n' "${out[@]}" + diff --git a/usr/bin/mabox-compositor b/usr/bin/mabox-compositor new file mode 100755 index 0000000..5cc322a --- /dev/null +++ b/usr/bin/mabox-compositor @@ -0,0 +1,33 @@ +#!/bin/bash +# mabox-compositor - script to start|stop|restart picom +# by Daniel Napora + +. "$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 diff --git a/usr/bin/mabox-conky-pipemenu b/usr/bin/mabox-conky-pipemenu new file mode 100755 index 0000000..f368775 --- /dev/null +++ b/usr/bin/mabox-conky-pipemenu @@ -0,0 +1,179 @@ +#!/bin/bash +# mabox-conky-pipemenu - an Openbox pipemenu for manipulating conky +# Copyright (C) 2015 damo +# +# 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 . + +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 diff --git a/usr/bin/mabox-include.cfg b/usr/bin/mabox-include.cfg new file mode 100755 index 0000000..9342748 --- /dev/null +++ b/usr/bin/mabox-include.cfg @@ -0,0 +1,187 @@ +# cbpp-include.cfg - Variables and functions commonly used in custom scripts for +# CrunchBang GNU/Linux . +# Ported to #!++ +# by Ben Young +# Ported to Manjaro +# by Daniel Napora + +# 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 ' ' +} + +# Usage: menuItem label command +menuItem() { + echo " " + echo ' ' + echo ' ' + echo " $2" + echo ' ' + echo ' ' + echo ' ' +} + +# Usage: menuSeparator [label] +menuSeparator() { + if [[ $1 ]]; then + echo " " + else + echo ' ' + fi +} + +# Usage menuSubmenu id label # http://openbox.org/wiki/Help:Menus +menuSubmenu() { + echo " " +} + +menuSubmenuEnd() { + echo ' ' +} + +menuEnd() { + echo ' ' +} + +# 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 +} diff --git a/usr/bin/mabox-kb-pipemenu b/usr/bin/mabox-kb-pipemenu new file mode 100755 index 0000000..60c4c78 --- /dev/null +++ b/usr/bin/mabox-kb-pipemenu @@ -0,0 +1,104 @@ +#!/bin/bash +# mabox-kb-pipemenu - an Openbox pipemenu for displaying keybinds +# Copyright (C) 2015 damo +# +# 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 . + +# 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 diff --git a/usr/bin/mabox-libreoffice-pipemenu b/usr/bin/mabox-libreoffice-pipemenu new file mode 100755 index 0000000..b53641a --- /dev/null +++ b/usr/bin/mabox-libreoffice-pipemenu @@ -0,0 +1,41 @@ +#!/bin/bash +# --------------------------------------------------------------------- +# An Openbox pipemenu for use with LibreOffice and CrunchBang Linux. +# Written for CrunchBang Linux +# by Philip Newborough (aka corenominal) +# Ported to #!++ +# by Ben Young +# Ported to Manjaro +# by Daniel Napora +# --------------------------------------------------------------------- + +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 diff --git a/usr/bin/mabox-places-pipemenu b/usr/bin/mabox-places-pipemenu new file mode 100755 index 0000000..a81183a --- /dev/null +++ b/usr/bin/mabox-places-pipemenu @@ -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 #!++ +# by Ben Young +# Ported to Manjaro +# by Daniel Napora + +# NB The shell, not bash, is invoked in the hope that +# dash will be used, as it is much faster. + +# Usage: add +# +# to your .config/openbox/menu.xml + +# or, if you want the "recent files" menu incorporated at the top, use: +# +# 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=' +' + if [ -x "$recent_script" ] + then + output="$output"' + +' + else + echo "$0 : cannot find executable script $recent_script" >&2 + fi;; +*) + output=' +';; +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;" < + + + + ''"$open_folder_cmd"'' ''"$pathe_apos"'' + + + + +' + +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;" <'; continue; } + files_menu="$files_menu"' + + + + ''"$0"'' --open ''"${pathe_apos}${shortnamee_apos}"'' + + +' +done + +[ -n "$directories_menu" ] && { +# NOTE2 comment out next 2 lines if you don't want "Directories" label +output="${output}"' +' +output="${output}${directories_menu}"' +'; } +[ -n "$files_menu" ] && { +# NOTE3 comment out next 2 lines if you don't want "Files" label +output="${output}"' +' +output="${output}${files_menu}"' +'; } +output="${output}"' +' +printf '%s' "$output" +exit diff --git a/usr/bin/mabox-printing-pipemenu b/usr/bin/mabox-printing-pipemenu new file mode 100755 index 0000000..f5643b5 --- /dev/null +++ b/usr/bin/mabox-printing-pipemenu @@ -0,0 +1,33 @@ +#!/bin/bash +# --------------------------------------------------------------------- +# An Openbox pipemenu for configuring printing under CrunchBang Linux. +# Written for CrunchBang Linux +# by Philip Newborough (aka corenominal) +# Ported to #!++ +# by Ben Young +# Ported to Manjaro +# by Daniel Napora +# --------------------------------------------------------------------- + +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 diff --git a/usr/bin/mabox-software-pipemenu b/usr/bin/mabox-software-pipemenu new file mode 100755 index 0000000..851f878 --- /dev/null +++ b/usr/bin/mabox-software-pipemenu @@ -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 diff --git a/usr/bin/mabox-tint2-pipemenu b/usr/bin/mabox-tint2-pipemenu new file mode 100755 index 0000000..dc1c840 --- /dev/null +++ b/usr/bin/mabox-tint2-pipemenu @@ -0,0 +1,114 @@ +#!/bin/bash + +# mabox-tint2-pipemenu - an Openbox pipemenu for tint2 manipulation +# Copyright (C) 2015-2016 damo +# +# 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 . + +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 diff --git a/usr/bin/mb-music b/usr/bin/mb-music new file mode 100755 index 0000000..abfce2f --- /dev/null +++ b/usr/bin/mb-music @@ -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 < ${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 < ${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="Dźwięk i Muzyka" + _VOL="Sterowanie głośnością" + _RADIO="Radio Internetowe" + _PYRADIO="Uruchom PyRadio" + _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="Music & Sound Menu" + _VOL="Volume Control" + _RADIO="Internet Radio" + _PYRADIO="Launch PyRadio" + _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  + v ,pavucontrol") +out+=("^sep($_RADIO)") +out+=("$_PYRADIO  + r ,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+=(" $STOP $NOW,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+=("󰏤 $_PAUSE,playerctl -p mpv pause;${me}") || out0+=("󰐊 $_PLAY,playerctl -p mpv play;${me}") +out0+=("󰓛 $_STOP,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/󰐊 ${name}\"\"\",mb-music play \"${url}\" \"${name}\"") + else + out2+=("\"\"\"󰐊 ${name}\"\"\",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+=(" $STOP $NOW,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+=("󰏤 $_PAUSE,playerctl -p mpv pause;${me}") || out0+=("󰐊 $_PLAY,playerctl -p mpv play;${me}") +out0+=("󰓛 $_STOP,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($name)") + else + [[ $name != "" ]] && out+=("\"\"\"󰐊 ${name}\"\"\",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($name)") + else + [[ $name != "" ]] && out2+=("\"\"\"󰐊 ${name}\"\"\",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 <${NOW}""" +EOF +else +clr="#666666" +read -r -d '' NOWPLAYLINES <  + m """ +EOF +fi + +cat < ${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 diff --git a/usr/bin/mb-places b/usr/bin/mb-places new file mode 100755 index 0000000..94901d2 --- /dev/null +++ b/usr/bin/mb-places @@ -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 < ${PLACES} +out+=("^sep($LABEL ( + .))") +out+=(" $HOME_DIR (~),^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="󱊟" || ICON="󰋊" +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+=(" PCManFM,pcmanfm,file-manager") +fi +if hash thunar &>/dev/null; then +out+=(" Thunar,thunar,file-manager") +fi +if hash fsearch &>/dev/null; then +out+=("󰥨 FSearch,fsearch,search") +fi + +if hash doublecmd &>/dev/null; then +out+=(" Double Commander,doublecmd,doublecmd") +else +out2+=("$INST Double Commander,pamac-installer doublecmd-gtk2,package-manager-icon") +fi + + +if hash qdirstat &>/dev/null; then +out+=("󰀻 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+=(" $SHOW_HIDDEN,mb-setvar jgbrowser_show_hidden=true;mb-places -s") || out+=(" $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 < ${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' "$REMOVE,mb-setvar places_jgdesktops=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" diff --git a/usr/bin/mb-webbrowser b/usr/bin/mb-webbrowser new file mode 100755 index 0000000..9152025 --- /dev/null +++ b/usr/bin/mb-webbrowser @@ -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 < ${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' "$REMOVE,mb-setvar places_jgdesktops=false;mb-jgtools places" +fi +printf '%s\n' "${out2[@]}" diff --git a/usr/bin/mbhelper b/usr/bin/mbhelper new file mode 100755 index 0000000..29759ab --- /dev/null +++ b/usr/bin/mbhelper @@ -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 < ${MENU_ITEMS} +@search,,$((jgtools_padding + 24)),$((jgtools_padding + 4)),292,20,4,left,top,auto,#262626,""" $TYPE_TO_SEARCH""" +^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 +