/ moved screensaver and power options to startup.sh

This commit is contained in:
committer@tuxwarrior
2025-04-12 07:37:04 -05:00
parent 894a8720d7
commit c63ec1e0b5
4 changed files with 56 additions and 17 deletions

View File

@@ -13,10 +13,10 @@ alias gparted="sudo gparted"
alias grep='grep --color=auto'
alias keymap="setxkbmap -model pc105 -layout us,no -option grp:caps_toggle,grp_led:scroll"
alias keyringreset="trash-put /home/poq/.local/share/keyrings/*.keyrings"
alias lock="xautolock -locknow"
alias ls='ls --color=auto'
alias mamapscii='telnet mapscii.me'
alias myip="echo $(wget http://ipinfo.io/ip -qO -)"
alias package-updates="pacman -Qu"
alias sb="source ~/.bashrc"
alias tp="tp.sh"
#alias cp="cp -i" # confirm before overwriting something
@@ -25,10 +25,11 @@ alias tp="tp.sh"
#alias free='free -m' # show sizes in MB
#alias more=less
#alias np='nano -w PKGBUILD'
#alias package-updates="pacman -Qu"
#alias nr="nitrogen --restore"
# x terminal shell start string
# x terminal shell start string | https://askubuntu.com/questions/1340319/ps1-string-full-documentation-and-reference-page
PS1='[\u@\h \W]\$ '
# change the window title of x terminals
@@ -68,6 +69,30 @@ ex ()
fi
}
monitor() {
cmd="info"
if [[ -n $1 ]]; then
cmd=$1
fi
if [ ${cmd} == "on" ] ; then
# (standby) (suspend) (off)
# 18.2 hours | https://superuser.com/questions/1876254/how-to-turn-off-monitor-and-dont-enable-screen-blanking-in-arch-linux
xset dpms 65535 65535 65535
# disable screensaver
xautolock -disable # disable screen locker
elif [ ${cmd} == "off" ] ; then
sleep 3 # sleep, to prevent mouse movement and immediate wake up
xset dpms 0 0 600 # 10 min timout will be active after monitor wakes up
xset dpms force off # shut off the monitor
xautolock -enable # turns on screen locker again
elif [ ${cmd} == "info" ] ; then
xset -q
else
echo "error: unknown command \"${cmd}\""
fi
}
nmrestart() {
systemctl restart NetworkManager
systemctl status NetworkManager
@@ -94,6 +119,12 @@ screensaver() {
xset dpms
xautolock -restart
fi
elif [ ${cmd} == "set" ] ; then
minutes=15
if [[ -n $2 ]]; then
minutes=$2
fi
xautolock -time ${minutes} -locker i3lock_fk.sh
elif [ ${cmd} == "info" ] ; then
xset -q
else

View File

@@ -40,4 +40,4 @@ else
composite -gravity ${random_gravity} /tmp/overlayimage.png /tmp/currentworkspaceblur.png /tmp/lockbackground.png
i3lock --tiling -i /tmp/lockbackground.png
fi
fi

View File

@@ -47,6 +47,10 @@ elif [[ "${XWM}" == "i3" ]]; then
lordOfTheRing.sh
sleep 3.5
# set up screen locking and monitor/display power management
xset dpms 0 0 599 # screen off after X seconds
#xautolock -time 15 -locker i3lock_fk.sh # lock after X minutes
# start miscellanous programs
megasync & # mega sync service
nextcloud & # nextcloud file sync

View File

@@ -209,10 +209,10 @@ exec --no-startup-id nitrogen --restore
exec --no-startup-id pasystray
exec --no-startup-id startup.sh
# screen off after 30 min (1800 sec)
#exec_always --no-startup-id xset dpms 0 0 1800;
# lock after X minutes
#exec --no-startup-id xautolock -time 15 -locker i3lock_fk.sh
# ---
# screen locker
# ---
# locking of screens is handled by startup.sh
# ---
# shortcuts
@@ -250,8 +250,9 @@ bindsym $mod+y [class="REAPER"] focus
bindsym $mod+Ctrl+9 mode "$mode_displays"
set $mode_displays (l)ock displays, (o)ff & lock displays
mode "$mode_displays" {
bindsym l exec --no-startup-id loginctl lock-session
bindsym o exec --no-startup-id xset dpms force off, mode "default"
bindsym l exec --no-startup-id i3lock_fk.sh
#bindsym l exec --no-startup-id loginctl lock-session
bindsym o exec --no-startup-id sleep 3; xset dpms force off; xautolock -locknow
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
@@ -260,15 +261,18 @@ mode "$mode_displays" {
# submenu: logout / reboot / shutdown ++
bindsym $mod+Ctrl+0 mode "$mode_system"
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
set $mode_system (Shift+e)xit/logout, (Shift+r)eboot, (Shift+s)hutdown
#set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
mode "$mode_system" {
bindsym l exec --no-startup-id i3exit lock, mode "default"
bindsym s exec --no-startup-id i3exit suspend, mode "default"
bindsym u exec --no-startup-id i3exit switch_user, mode "default"
bindsym e exec --no-startup-id i3exit logout, mode "default"
bindsym h exec --no-startup-id i3exit hibernate, mode "default"
bindsym r exec --no-startup-id i3exit reboot, mode "default"
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"
#bindsym l exec --no-startup-id i3lock_fk.sh
#bindsym l exec --no-startup-id i3exit lock, mode "default"
bindsym Shift+e exec --no-startup-id i3exit logout
#bindsym h exec --no-startup-id i3exit hibernate, mode "default"
bindsym Shift+r exec --no-startup-id i3exit reboot
#bindsym s exec --no-startup-id i3exit suspend, mode "default"
#bindsym u exec --no-startup-id i3exit switch_user, mode "default"
bindsym Shift+s exec --no-startup-id i3exit shutdown
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"