/ 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