wallp and scrnlck

master
Daniel Napora 2021-08-31 22:56:45 +02:00
parent 077dfef52a
commit c503cfd6f4
3 changed files with 165 additions and 42 deletions

View File

@ -0,0 +1,152 @@
#!/bin/bash
# jglockscreen - configure betterlockscreen
#
CONFIG_DIR="$HOME/.config/mbscreenlocker/"
SCRNLOCKCFG="$HOME/.config/mbscreenlocker/mbscreenlocker.conf"
# Make config directory if not exist
mkdir -p $CONFIG_DIR
# If config file not exist create one with defaults
if [ ! -f $SCRNLOCKCFG ]; then
cat <<EOF > ${SCRNLOCKCFG}
# Effect to use: dim, blur, dimblur or pixel
effect=pixel
# ScreenLocker program: betterlockscreen or i3lock
screenlocker=i3lock
EOF
fi
# read config variables from file
source <(grep = $SCRNLOCKCFG)
case $LANG in
pl*)
LOCK="Zablokuj ekran"
GENIMGS="Generuj obrazy tła"
LOCKER="Blokada ekranu <small>(super+l)</small>"
TYPETO="wpisz hasło aby odblokować"
SELECT_IMG="Wybierz obrazek"
CACHE="Użyj aktualnej tapety"
EFFECT="Efekt (ustaw i wypróbuj)"
DIM="przyciemnienie"
BLUR="rozmycie"
DIMBLUR="przyciemnienie i rozmycie"
PIXEL="pikseloza"
DESK="Rozmyty pulpit"
EDITCONF="Edytuj plik konfiguracyjny"
LEFTPANEL="Lewy panel"
;;
*)
LOCK="Lock screen now"
GENIMGS="Update Images"
LOCKER="ScreenLocker <small>(super+l)</small>"
TYPETO="type password to unlock"
SELECT_IMG="Select image file"
CACHE="Cache current wallpaper for ScreenLock"
EFFECT="Effect (set and run)"
DIM="dim"
BLUR="blur"
DIMBLUR="dim and blur"
PIXEL="pixel"
DESK="Blurred desktop"
EDITCONF="Edit config file"
LEFTPANEL="Left panel"
;;
esac
. $HOME/.config/mabox/mabox.conf
me="jglockscreen -s"
#help='\nBased on Mabox forum member Shwaybo <a href="https://forum.maboxlinux.org/t/chwp-desktop-wallpaper-changer/496">idea</a>.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n'
out+=("^sep($LOCKER)")
out+=("^sep(<i><small>$TYPETO</small></i>")
#out+=("^sep(Betterlockscreen)")
out+=("$LOCK,mblockscreen")
out+=("^sep($GENIMGS)")
out+=("$SELECT_IMG,mbscreenlocker -s")
out+=("$CACHE,mbscreenlocker -c")
out+=("^sep(<i><small>$EFFECT</small></i>)")
if [ $effect == "dim" -a $screenlocker != "i3lock" ];then
out+=("<b>[ $DIM ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker")
else
out+=("$DIM,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker")
fi
if [ $effect == "blur" -a $screenlocker != "i3lock" ];then
out+=("<b>[ $BLUR ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker")
else
out+=("$BLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker")
fi
if [ $effect == "dimblur" -a $screenlocker != "i3lock" ];then
out+=("<b>[ $DIMBLUR ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker")
else
out+=("$DIMBLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker")
fi
if [ $effect == "pixel" -a $screenlocker != "i3lock" ];then
out+=("<b>[ $PIXEL ]</b>,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker")
else
out+=("$PIXEL,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker")
fi
out+=("^sep()")
if [ $screenlocker = "i3lock" ];then
out+=("<b>[ $DESK ]</b>,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker")
else
out+=("$DESK,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker")
fi
out+=("^sep()")
out+=("$EDITCONF ,geany $SCRNLOCKCFG")
out2+=("^tag(interval)")
for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf "<tt> %4s</tt>,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done
### RUN
if [[ "$1" == "-s" ]]; then
. /usr/bin/pipemenu-standalone.cfg
. $HOME/.config/mabox/mabox.conf
out+=("^sep()")
out+=(" ⮜ $LEFTPANEL,mb-jgtools places")
if [[ $panels_heightpos == "top" ]]; then
MENU_VALIGN="top"
MENU_MARGIN_Y=${panels_topmargin:-0}
elif [[ $panels_heightpos == "bottom" ]]; then
MENU_VALIGN="bottom"
MENU_MARGIN_Y=${panels_topmargin:-0}
else
MENU_VALIGN="center"
fi
MENU_PADDING_TOP=${jgtools_padding:-0}
MENU_HALIGN="left"
jgmenu_icon_size=0
JGWIDTH=40
menu_margin_x=${submenu_spacing:-0}
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
[ -z $jgmenu_use_borders ] && menu_border=0
mkconfigfile
cat <<EOF > ${MENU_ITEMS}
$(printf '%s\n' "${out[@]}")
$(printf '%s\n' "${out2[@]}")
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
exit 0
fi
printf '%s\n' "${out[@]}"
if [[ $1 == "-r" ]]; then
case $LANG in
pl*) REMOVE="Usuń to menu z panelu";;
es*) REMOVE="Eliminar este menú del panel";;
*) REMOVE="Remove this menu from panel";;
esac
printf '%s\n' "^sep()"
printf '%s\n' "<i>$REMOVE</i>,mb-setvar places_jglockscreen=false;mb-jgtools places"
fi
printf '%s\n' "${out2[@]}"
echo $effect
echo $screenlocker

View File

@ -36,7 +36,8 @@ case $LANG in
SYSINFO="Informacje o systemie"
SHORTCUTS="Skróty klawiszowe"
MENUPANELS="Ustawienia Menu/Paneli bocznych"
WALLCHANGER="Tapeta i Blokada Ekranu"
WALLCHANGER="Tapeta"
LOCKSCREEN="Blokada ekranu"
TINT2="Ustawienia panelu Tint2"
CONKY="Ustawienia Conky"
SSH_CONN="Połączenia SSH"
@ -97,7 +98,8 @@ case $LANG in
SYSINFO="System information"
SHORTCUTS="Atajos del teclado"
MENUPANELS="Menu/Paneles laterales"
WALLCHANGER="Wallpaper and ScreenLocker"
WALLCHANGER="Wallpaper"
LOCKSCREEN="ScreenLocker"
TINT2="Tint2 panel settings"
CONKY="Conky settings"
SSH_CONN="SSH Connections"
@ -158,7 +160,8 @@ case $LANG in
SYSINFO="System information"
SHORTCUTS="Keyboard shortcuts"
MENUPANELS="Menu/Sidepanels settings"
WALLCHANGER="Wallpaper and ScreenLocker"
WALLCHANGER="Wallpaper"
LOCKSCREEN="ScreenLocker"
TINT2="Tint2 panel settings"
CONKY="Conky settings"
SSH_CONN="SSH Connections"
@ -175,7 +178,7 @@ case $LANG in
SHOW_ICONS="Show icons"
HIDE_ICONS="Hide icons"
INSTALL="Install"
SIZE="Menu/Sidepanels Size and Font"
SIZE="Font"
FONT_FAMILY="Font Family"
FONT_SIZE="Font Size"
COLOR_SCHEME="Color Scheme"
@ -224,6 +227,7 @@ out2+=("^sep($MODULES)")
out2+=("^sep($PIPEMENUS)")
[[ $places_menusettingspipe = false ]] && out2+=("<i><s>$MENUPANELS</s></i>,mb-setvar places_menusettingspipe=true;$L") || out2+=("$MENUPANELS,mb-setvar places_menusettingspipe=false;$L")
[[ $places_jgwallpaperchanger = false ]] && out2+=("<i><s>$WALLCHANGER</s></i>,mb-setvar places_jgwallpaperchanger=true;$L") || out2+=("$WALLCHANGER,mb-setvar places_jgwallpaperchanger=false;$L")
[[ $places_jglockscreen = false ]] && out2+=("<i><s>$LOCKSCREEN</s></i>,mb-setvar places_jglockscreen=true;$L") || out2+=("$LOCKSCREEN,mb-setvar places_jglockscreen=false;$L")
[[ $places_jgdesktops = false ]] && out2+=("<i><s>$DESKTOPS</s></i>,mb-setvar places_jgdesktops=true;$L") || out2+=("$DESKTOPS,mb-setvar places_jgdesktops=false;$L")
[[ $places_jgdeskmngr = false ]] && out2+=("<i><s>$DESKMNGR</s></i>,mb-setvar places_jgdeskmngr=true;$L") || out2+=("$DESKMNGR,mb-setvar places_jgdeskmngr=false;$L")
[[ $places_jgdeskgrid = false ]] && out2+=("<i><s>$DESKGRID</s></i>,mb-setvar places_jgdeskgrid=true;$L") || out2+=("$DESKGRID,mb-setvar places_jgdeskgrid=false;$L")

View File

@ -1,11 +1,10 @@
#!/bin/bash
# jgwallpaperchanger - rotate desktop wallpaper every n-seconds,
# jgwallpaperchanger - submenu to configure wallpapers
#
CONFIG_DIR="$HOME/.config/mbwallpaper"
CONFIG_FILE="$CONFIG_DIR/mbwallpaper.conf"
WALLPAPERS_LIST="$CONFIG_DIR/wplist"
SCRNLOCKCFG="$HOME/.config/mbscreenlocker/mbscreenlocker.conf"
# Make config directory if not exist
mkdir -p $CONFIG_DIR
@ -26,7 +25,7 @@ fi
source <(grep = $CONFIG_FILE)
case $LANG in
pl*)
TITLE="Zmieniacz tapet i Blokada ekranu"
TITLE="Zmieniacz tapet"
WALLPAPERS="Tapety"
RANDWALL="Losowa tapeta"
CHOOSE="Wybierz tapetę..."
@ -38,19 +37,10 @@ case $LANG in
SEC="sekund"
EDITCONF="Edytuj plik konfiguracyjny"
OPENDIR="Otwórz katalog z tapetami"
LOCKER="Blokada ekranu <small>(super+l)</small>"
TYPETO="wpisz hasło aby odblokować"
CACHE="Użyj aktualnej tapety"
EFFECT="Efekt (ustaw i wypróbuj)"
DIM="przyciemnienie"
BLUR="rozmycie"
DIMBLUR="przyciemnienie i rozmycie"
PIXEL="pikseloza"
DESK="Rozmyty pulpit"
LEFTPANEL="Lewy panel"
;;
*)
TITLE="Wallpaper Changer &amp; ScreenLocker"
TITLE="Wallpaper Changer"
WALLPAPERS="Wallpapers"
RANDWALL="Random Wallpaper"
CHOOSE="Choose Wallpaper..."
@ -62,15 +52,6 @@ case $LANG in
SEC="seconds"
EDITCONF="Edit config file"
OPENDIR="Open wallpaper directory"
LOCKER="ScreenLocker <small>(super+l)</small>"
TYPETO="type password to unlock"
CACHE="Cache current wallpaper for ScreenLock"
EFFECT="Effect (set and run)"
DIM="dim"
BLUR="blur"
DIMBLUR="dim and blur"
PIXEL="pixel"
DESK="Blurred desktop"
LEFTPANEL="Left panel"
;;
esac
@ -80,7 +61,7 @@ esac
me="jgwallpaperchanger -s"
#help='\nBased on Mabox forum member Shwaybo <a href="https://forum.maboxlinux.org/t/chwp-desktop-wallpaper-changer/496">idea</a>.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n'
out+=("^sep($TITLE)")
#out+=("^sep($TITLE)")
out+=("^sep($WALLPAPERS)")
if ! pgrep mbwallpaper > /dev/null; then
out+=("$RANDWALL,mbwallpaper -o;$me")
@ -100,22 +81,8 @@ out+=("^sep()")
out+=("$EDITCONF ,geany $CONFIG_FILE")
out+=("$OPENDIR,pcmanfm -n $wallpaper_dir")
out+=("^sep($LOCKER)")
out+=("^sep(<i><small>$TYPETO</small></i>")
#out+=("^sep(Betterlockscreen)")
out+=("$CACHE,mbscreenlocker -c")
out+=("^sep(<i><small>$EFFECT</small></i>)")
out+=("$DIM,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dim $SCRNLOCKCFG;mbscreenlocker")
out+=("$BLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=blur $SCRNLOCKCFG;mbscreenlocker")
out+=("$DIMBLUR,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=dimblur $SCRNLOCKCFG;mbscreenlocker")
out+=("$PIXEL,mb-setvar screenlocker=betterlockscreen $SCRNLOCKCFG;mb-setvar effect=pixel $SCRNLOCKCFG;mbscreenlocker")
out+=("^sep()")
out+=("$DESK,mb-setvar screenlocker=i3lock $SCRNLOCKCFG;mbscreenlocker")
out+=("^sep()")
out+=("$EDITCONF ,geany $SCRNLOCKCFG")
out2+=("^tag(interval)")
for i in 10 30 60 120 300 600 1800 3600; do out2+=("$(printf "<tt> %4s</tt>,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done
for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf "<tt> %4s</tt>,%s" "$i" "mb-setvar interval=${i} $CONFIG_FILE;$me")");done
### RUN
if [[ "$1" == "-s" ]]; then