From 96ed5973d83b270a11015193c31c5f4afc2b4088 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Mon, 29 May 2023 21:16:10 +0200 Subject: [PATCH] conky menu,pcmanwp --- bin/conkyctl | 113 +++-------------------------- bin/pcmanwp | 21 +++++- share/applications/pcmanwp.desktop | 12 +++ 3 files changed, 41 insertions(+), 105 deletions(-) create mode 100644 share/applications/pcmanwp.desktop diff --git a/bin/conkyctl b/bin/conkyctl index 4543b01..1982dce 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -612,32 +612,7 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out2+=(" $BOTTOMRIGHT,conkyctl pos bottom_right ${1};$me") - #out2+=("$ALIGNMENT [ $POS ],^checkout(posi)") - #out3+=("^tag(posi)") - #out3+=("^sep($POSITION)") - #out3+=(" $TOPLEFT,conkyctl pos top_left ${1};$me") - #out3+=(" $TOP,conkyctl pos top_middle ${1};$me") - #out3+=(" $TOPRIGHT,conkyctl pos top_right ${1};$me") - #out3+=(" $LEFT,conkyctl pos middle_left ${1};$me") - #out3+=("$CENTER,conkyctl pos middle_middle ${1};$me") - #out3+=(" $RIGHT,conkyctl pos middle_right ${1};$me") - #out3+=(" $BOTTOMLEFT,conkyctl pos bottom_left ${1};$me") - #out3+=(" $BOTTOM,conkyctl pos bottom_middle ${1};$me") - #out3+=(" $BOTTOMRIGHT,conkyctl pos bottom_right ${1};$me") - - #out2+=("$HORIZONTAL_GAP [ $GAPX ],^checkout(gapx)") - #out3+=("^tag(gapx)") - #out3+=("^sep($HORIZONTAL_GAP)") - #for i in 0 10 20 30 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360; do - #out3+=("${i},conkyctl gap_x ${i} ${1};$me") - #done - #out2+=("$VERTICAL_GAP [ $GAPY ],^checkout(gapy)") - #out3+=("^tag(gapy)") - #out3+=("^sep($VERTICAL_GAP)") - #for i in 0 10 20 30 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360; do - #out3+=("${i},conkyctl gap_y ${i} ${1};$me") - #done - if [[ "$NOT_SUPPORTED" != "true" ]];then + if [[ "$NOT_SUPPORTED" != "true" ]];then out2+=("^sep()") out2+=(" $MAKEMOVEABLE,conkyctl makemoveableall") fi @@ -698,7 +673,8 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out+=("^sep($COLORS)") - out+=("$TRANSPARENT [ $WINTRANS ],^checkout(transsingle)") + [[ "$WINTRANS" == false ]] && out+=("󰄱 $TRANSPARENT,conkyctl transparent true ${1}") || out+=("󰄲 $TRANSPARENT,conkyctl transparent false ${1}") + if [[ "$WINCLR" != "#" ]];then if [ "$WINTRANS" == false ];then out+=(" AbCd $BACKGROUND,^pipe(mbclr '$WINCLR' conkyctl win_bgcolor '${BACKGROUND}' '$me' ${1})") @@ -718,10 +694,7 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out+=("^sep()") fi - out2+=("^tag(transsingle)") - out2+=("^sep($TRANSPARENT)") - out2+=("$YES,conkyctl transparent true ${1};$me") - out2+=("$NO,conkyctl transparent false ${1};$me") + if [ "$WINTRANS" == false ];then @@ -778,11 +751,11 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out2+=("$DRAW $OLINE,conkyctl shades outline ${1};$me") out+=("^sep()") fi - out+=("$BORDERS [ $BORD $STIP ],^checkout(bordersingle)") + [[ "$BORD" == false ]] && out+=("󰄱 $BORDERS [ $STIP ],^checkout(bordersingle)") || out+=("󰄲 $BORDERS [ $STIP ],^checkout(bordersingle)") out2+=("^tag(bordersingle)") out2+=("^sep($DRAW $BORDERS?)") - out2+=("$YES,conkyctl draw_borders true ${1};$me") - out2+=("$NO,conkyctl draw_borders false ${1};$me") + [[ "$BORD" == false ]] && out2+=(" $YES,conkyctl draw_borders true ${1};$me") || out2+=(" $YES,conkyctl draw_borders false ${1};$me") + [[ "$BORD" == false ]] && out2+=(" $NO,conkyctl draw_borders true ${1};$me") || out2+=(" $NO,conkyctl draw_borders false ${1};$me") out2+=("^sep($STIPPLED_BORDERS ?)") out2+=("0 ($SOLID_LINE),conkyctl stippled_borders 0 ${1};$me") out2+=("^sep()") @@ -863,7 +836,7 @@ contextmenu () { jgtools_padding=4 MENU_PADDING_TOP=${jgtools_padding:-0} - TABS="90" + TABS=140 jgmenu_icon_size=0 @@ -892,38 +865,7 @@ contextmenu () { mkconfigfile - #if [[ "$OLD_SYNTAX" != "true" ]];then - # echo "color_menu_bg_to=${WINCLR} 100" >> ${CONFIG_FILE} - # TXTCOLOR=$(pastel textcolor ${WINCLR}|pastel format hex) - # #notify-send.sh "TXTCOLOR" "${TXTCOLOR} ${menu_gradient_pos}" - # if [ "$TXTCOLOR" == "#ffffff" ];then #bg is dark - # TXTCOLOR_NORM="#cccccc" - # WINCLR=$(pastel lighten 0.03 ${WINCLR}|pastel format hex) - # echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} - # echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} - # echo "color_title_fg=${TXTCOLOR} 60" >> ${CONFIG_FILE} - # SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) - # echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} - # echo "color_title_bg=${SELBG} 30" >> ${CONFIG_FILE} - # echo "color_title_border=${SELBG} 60" >> ${CONFIG_FILE} - # else #bg is light - # TXTCOLOR_NORM="#333333" - # echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} - # echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} - # echo "color_title_fg=${TXTCOLOR} 90" >> ${CONFIG_FILE} - # SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) - # echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} - # echo "color_title_bg=${SELBG} 90" >> ${CONFIG_FILE} - # echo "color_title_border=${SELBG} 90" >> ${CONFIG_FILE} - # fi - # echo "color_menu_bg=${WINCLR} 90" >> ${CONFIG_FILE} - # echo "color_menu_border=${CLR} 60" >> ${CONFIG_FILE} - # echo "menu_border=1" >> ${CONFIG_FILE} - # echo "menu_radius=0" >> ${CONFIG_FILE} - - # echo "color_sep_fg=${CLR} 10" >> ${CONFIG_FILE} - # echo "font=${FONT} 10" >> ${CONFIG_FILE} - #fi + cat < ${MENU_ITEMS} $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out2[@]}") @@ -1006,46 +948,11 @@ cmdmenu () { jgtools_padding=4 MENU_PADDING_TOP=${jgtools_padding:-0} JGWIDTH=270 - TABS="300" + TABS=140 jgmenu_icon_size=0 mkconfigfile - #echo "color_menu_bg_to=${WINCLR} 100" >> ${CONFIG_FILE} - #TXTCOLOR=$(pastel textcolor ${WINCLR}|pastel format hex) - #####notify-send.sh "TXTCOLOR" "${TXTCOLOR} ${menu_gradient_pos}" - #if [ "$TXTCOLOR" == "#ffffff" ];then #bg is dark - #TXTCOLOR_NORM="#cccccc" - #WINCLR=$(pastel lighten 0.03 ${WINCLR}|pastel format hex) - #echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} - #echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} - #echo "color_title_fg=${TXTCOLOR} 60" >> ${CONFIG_FILE} - #SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) - #echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} - #echo "color_title_bg=${SELBG} 30" >> ${CONFIG_FILE} - #echo "color_title_border=${SELBG} 60" >> ${CONFIG_FILE} - #else #bg is light - #TXTCOLOR_NORM="#333333" - #echo "color_norm_fg=${TXTCOLOR_NORM} 100" >> ${CONFIG_FILE} - #echo "color_sel_fg=${TXTCOLOR} 100" >> ${CONFIG_FILE} - #echo "color_title_fg=${TXTCOLOR} 90" >> ${CONFIG_FILE} - #SELBG=$(pastel darken 0.1 ${WINCLR}|pastel format hex) - #echo "color_sel_bg=${SELBG} 80" >> ${CONFIG_FILE} - #echo "color_title_bg=${SELBG} 90" >> ${CONFIG_FILE} - #echo "color_title_border=${SELBG} 90" >> ${CONFIG_FILE} - #fi - #echo "color_menu_bg=${WINCLR} 90" >> ${CONFIG_FILE} - #echo "color_menu_border=${CLR} 60" >> ${CONFIG_FILE} - #echo "menu_border=1" >> ${CONFIG_FILE} - #echo "menu_radius=0" >> ${CONFIG_FILE} - - #echo "color_sep_fg=${CLR} 10" >> ${CONFIG_FILE} - #echo "font=${FONT} 10" >> ${CONFIG_FILE} - #echo "sub_spacing=3" >> ${CONFIG_FILE} - #echo "menu_margin_x=3" >> ${CONFIG_FILE} - #echo "menu_margin_y=3" >> ${CONFIG_FILE} - #notify-send.sh "CFG" "$(cat $CONFIG_FILE)" - echo "tabs = 170" >>${CONFIG_FILE} case "$LANG" in pl*) CUSTOM_COMMANDS_SEP="Własne polecenia" diff --git a/bin/pcmanwp b/bin/pcmanwp index 9315748..37c5b67 100755 --- a/bin/pcmanwp +++ b/bin/pcmanwp @@ -1,6 +1,23 @@ -#/bin/bash +#!/bin/bash # pcmanfm based wallpaper chooser # simple command for now -pcmanfm -n /usr/share/backgrounds ~/wallpapers +CNF_FILE="$HOME/.config/mabox/wallp_dirs.conf" +if [ ! -f $CNF_FILE ]; then +cat < ${CNF_FILE} +# User wallpapers directories - one per line +# Used by "Choose wallpaper" PCmanFM wrapper +# Set wallpapers using context (right click) menu in file manager +~/wallpapers/ +EOF +fi +#System wallpaper dirs +syswpdirs+=("/usr/share/backgrounds") +if [ -d "/usr/share/backgrounds/tiled" ]; then +syswpdirs+=("/usr/share/backgrounds/tiled") +fi + +readarray -t wpdirs < <(grep "^[^#]" "${CNF_FILE}") + +pcmanfm -n $(echo ${syswpdirs[@]} ${wpdirs[@]}) diff --git a/share/applications/pcmanwp.desktop b/share/applications/pcmanwp.desktop new file mode 100644 index 0000000..6071728 --- /dev/null +++ b/share/applications/pcmanwp.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Choose wallpaper +Name[pl]=Wybierz tapetę +Comment= +Keywords= +StartupNotify=false +Icon=preferences-desktop-wallpaper +Exec=pcmanwp +Categories=Settings; +#NoDisplay=true