mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-22 09:53:10 -05:00
Update startup script logging
This commit is contained in:
parent
aee7ea1b5d
commit
d1f95edd20
8 changed files with 89 additions and 39 deletions
|
@ -1,14 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE_BAR1="${XDG_STATE_HOME}"/polybar1.log
|
||||||
|
LOG_FILE_BAR2="${XDG_STATE_HOME}"/polybar2.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_BAR1"
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_BAR2"
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# Terminate already running bar instances
|
||||||
killall -q polybar
|
#killall -q polybar # needed if ipc disabled
|
||||||
|
polybar-msg cmd quit
|
||||||
|
|
||||||
# Wait until the processes have been shut down
|
# Wait until the processes have been shut down
|
||||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Launch Polybar, using default config location ~/.config/polybar/config
|
# Launch Polybar
|
||||||
echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log
|
polybar one -r --config=~/.config/polybar/config.ini 2>&1 | tee -a "$LOG_FILE_BAR1" & disown
|
||||||
polybar one -r --config=~/.config/polybar/config.ini 2>&1 | tee -a /tmp/polybar1.log & disown
|
polybar two -r --config=~/.config/polybar/config.ini 2>&1 | tee -a "$LOG_FILE_BAR2" & disown
|
||||||
polybar two -r --config=~/.config/polybar/config.ini 2>&1 | tee -a /tmp/polybar2.log & disown
|
|
||||||
|
|
||||||
echo "Polybar launched..."
|
echo "Polybar launched..."
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE_WIRE="${XDG_STATE_HOME}"/wireplumber.log
|
||||||
|
LOG_FILE_PIPE="${XDG_STATE_HOME}"/pipewire.log
|
||||||
|
LOG_FILE_PULSE="${XDG_STATE_HOME}"/pipewire-pulse.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_WIRE"
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_PIPE"
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_PULSE"
|
||||||
|
|
||||||
# Kill any running pipewire processes
|
# Kill any running pipewire processes
|
||||||
killall -q wireplumber & killall -q pipewire-pulse & killall -q pipewire
|
killall -q wireplumber & killall -q pipewire-pulse & killall -q pipewire
|
||||||
|
|
||||||
|
@ -12,8 +21,7 @@ while pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
until pgrep -u $UID -f /usr/lib/xdg-desktop-portal >/dev/null; do sleep 1; done
|
until pgrep -u $UID -f /usr/lib/xdg-desktop-portal >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Launch pipewire
|
# Launch pipewire
|
||||||
echo "---" | tee -a /tmp/{wireplumber.log,pipewire.log,pipewire-pulse.log}
|
/usr/bin/wireplumber 2>&1 | tee -a "$LOG_FILE_WIRE" & disown
|
||||||
/usr/bin/wireplumber 2>&1 | tee -a /tmp/wireplumber.log & disown
|
/usr/bin/pipewire 2>&1 | tee -a "$LOG_FILE_PIPE" & disown
|
||||||
/usr/bin/pipewire 2>&1 | tee -a /tmp/pipewire.log & disown
|
/usr/bin/pipewire-pulse 2>&1 | tee -a "$LOG_FILE_PULSE" & disown
|
||||||
/usr/bin/pipewire-pulse 2>&1 | tee -a /tmp/pipewire-pulse.log & disown
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE="${XDG_STATE_HOME}"/polybar.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE"
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# Terminate already running bar instances
|
||||||
#killall -q polybar # needed if ipc disabled
|
#killall -q polybar # needed if ipc disabled
|
||||||
polybar-msg cmd quit
|
polybar-msg cmd quit
|
||||||
|
@ -8,7 +13,5 @@ polybar-msg cmd quit
|
||||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Launch Polybar
|
# Launch Polybar
|
||||||
echo "---" | tee -a /tmp/polybar.log
|
polybar one -r --config=~/.config/polybar/config.ini 2>&1 | tee -a "$LOG_FILE" & disown
|
||||||
polybar one -r --config=~/.config/polybar/config.ini 2>&1 | tee -a /tmp/polybar.log & disown
|
|
||||||
|
|
||||||
echo "Polybar launched..."
|
|
||||||
|
|
|
@ -1,17 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# dim screen after 2 minutes, turn screen off after 10, suspend after an hour
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
echo "---" | tee -a /tmp/swayidle-dim.log
|
#LOG_FILE_DIM="${XDG_STATE_HOME}"/swayidle-dim.log
|
||||||
swayidle -w \
|
LOG_FILE_LOCK="${XDG_STATE_HOME}"/swayidle.log
|
||||||
timeout 120 "light -O && light -S .1" \
|
|
||||||
resume "light -I" \
|
|
||||||
2>&1 | tee -a /tmp/swayidle-dim.log & disown
|
|
||||||
|
|
||||||
echo "---" | tee -a /tmp/swayidle.log
|
#echo "--- ${START_TIME} ---" > "$LOG_FILE_DIM"
|
||||||
swayidle -w \
|
echo "--- ${START_TIME} ---" > "$LOG_FILE_LOCK"
|
||||||
timeout 600 "wlr-randr --output eDP-1 --off" \
|
|
||||||
timeout 3600 "loginctl suspend" \
|
# kill running processes
|
||||||
resume "wlr-randr --output eDP-1 --on" \
|
killall -q swayidle
|
||||||
before-sleep "if ![[ pgrep -x waylock ]]; then waylock -fork-on-lock -init-color 0x000000; fi" \
|
|
||||||
2>&1 | tee -a /tmp/swayidle.log & disown
|
# dim screen after 2 minutes, lock after 5, turn off after 15, suspend after 60
|
||||||
|
#swayidle -w \
|
||||||
|
# timeout 120 'light -O && light -S .1' \
|
||||||
|
# resume 'light -I' \
|
||||||
|
# 2>&1 | tee -a "$LOG_FILE_DIM" & disown
|
||||||
|
|
||||||
|
swayidle -w \
|
||||||
|
timeout 120 'light -O && light -S .1' \
|
||||||
|
resume 'light -I' \
|
||||||
|
timeout 300 'waylock-launcher' \
|
||||||
|
resume 'light -I' \
|
||||||
|
timeout 900 'light -I && wlr-randr --output eDP-1 --off' \
|
||||||
|
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
|
||||||
|
timeout 3600 'loginctl suspend' \
|
||||||
|
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
|
||||||
|
2>&1 | "$LOG_FILE_LOCK" & disown
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE="${XDG_STATE_HOME}"/tint2.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE"
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# Terminate already running bar instances
|
||||||
killall -q tint2
|
killall -q tint2
|
||||||
|
|
||||||
|
@ -7,8 +12,7 @@ killall -q tint2
|
||||||
while pgrep -u $UID -x tint2 >/dev/null; do sleep 1; done
|
while pgrep -u $UID -x tint2 >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Launch tint2
|
# Launch tint2
|
||||||
echo "---" | tee -a /tmp/tint2.log
|
tint2 2>&1 | tee -a "$LOG_FILE" & disown
|
||||||
tint2 2>&1 | tee -a /tmp/tint2.log & disown
|
|
||||||
|
|
||||||
# Final command won't work without sleep
|
# Final command won't work without sleep
|
||||||
sleep 1 &&
|
sleep 1 &&
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE="${XDG_STATE_HOME}"/waybar.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE"
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# Terminate already running bar instances
|
||||||
killall -q waybar
|
killall -q waybar
|
||||||
|
|
||||||
|
@ -10,6 +15,5 @@ while pgrep -u $UID -x waybar >/dev/null; do sleep 1; done
|
||||||
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# Launch Waybar
|
# Launch Waybar
|
||||||
echo "---" | tee -a /tmp/waybar.log
|
waybar 2>&1 | tee -a "$LOG_FILE" & disown
|
||||||
waybar 2>&1 | tee -a /tmp/waybar.log & disown
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE="${XDG_STATE_HOME}"/xidlehook.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE"
|
||||||
|
|
||||||
# Wait on pipewire or "--not-when-audio" will break everything
|
# Wait on pipewire or "--not-when-audio" will break everything
|
||||||
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# lock screen after 10 minutes
|
# lock screen after 10 minutes
|
||||||
echo "---" | tee -a /tmp/xidlehook.log
|
xidlehook \
|
||||||
xidlehook --not-when-audio --not-when-fullscreen \
|
--not-when-audio \
|
||||||
--timer 600 "xset s activate" "" \
|
--not-when-fullscreen \
|
||||||
2>&1 | tee -a /tmp/xidlehook.log & disown
|
--timer 600 'xset s activate' '' \
|
||||||
|
2>&1 | tee -a "$LOG_FILE" & disown
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
START_TIME=`date +"%b %d, %Y %T"`
|
||||||
|
LOG_FILE="${XDG_STATE_HOME}"/xidlehook.log
|
||||||
|
|
||||||
|
echo "--- ${START_TIME} ---" > "$LOG_FILE"
|
||||||
|
|
||||||
# Wait on pipewire or "--not-when-audio" will break everything
|
# Wait on pipewire or "--not-when-audio" will break everything
|
||||||
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# dim screen after 2 minutes, lock screen after 10, suspend after an hour
|
# dim screen after 2 minutes, lock screen after 10, suspend after an hour
|
||||||
echo "---" | tee -a /tmp/xidlehook.log
|
xidlehook \
|
||||||
xidlehook --not-when-audio --not-when-fullscreen \
|
--not-when-audio \
|
||||||
--timer 120 "killall -q redshift && xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
--not-when-fullscreen \
|
||||||
--timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
--timer 120 'killall -q redshift && xrandr --output eDP-1 --brightness .1' 'xrandr --output eDP-1 --brightness 1 && redshift -r & disown' \
|
||||||
--timer 3000 "loginctl suspend" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
--timer 480 'xset s activate' 'xrandr --output eDP-1 --brightness 1 && redshift -r & disown' \
|
||||||
2>&1 | tee -a /tmp/xidlehook.log & disown
|
--timer 3000 'loginctl suspend' 'xrandr --output eDP-1 --brightness 1 && redshift -r & disown' \
|
||||||
|
2>&1 | tee -a "$LOG_FILE" & disown
|
||||||
|
|
Loading…
Reference in a new issue