Compare commits

...

4 Commits

Author SHA1 Message Date
d4ea79d054 Make dim-screen smarter 2023-12-29 10:23:21 +03:00
17cfe1ba66 Rename task visualizer script 2023-12-29 10:22:49 +03:00
0cb129d95f Set terminal type 2023-12-29 10:21:14 +03:00
be29a4b29a Lock screen after 120s 2023-12-29 10:18:51 +03:00
5 changed files with 39 additions and 21 deletions

View File

@ -34,8 +34,8 @@ exec-once = /usr/libexec/kf5/polkit-kde-authentication-agent-1
# Dim screen after 60 seconds of inactivity # Dim screen after 60 seconds of inactivity
exec-once = swayidle -w timeout 60 'dim-screen &' resume 'undim-screen' exec-once = swayidle -w timeout 60 'dim-screen &' resume 'undim-screen'
# Lock screen after idle for 300s # Lock screen after idle for 120s
exec-once = swayidle -w timeout 300 'lock-screen' exec-once = swayidle -w timeout 120 'lock-screen'
# Dim screen 5 seconds after screen is locked. no -w option here. # Dim screen 5 seconds after screen is locked. no -w option here.
exec-once = swayidle timeout 5 'if pgrep -x swaylock; then dim-screen; fi' resume 'undim-screen' exec-once = swayidle timeout 5 'if pgrep -x swaylock; then dim-screen; fi' resume 'undim-screen'
# Turn monitors off 20 seconds after screen is locked # Turn monitors off 20 seconds after screen is locked

View File

@ -86,7 +86,7 @@ bind-key -n C-Down swap-pane -s '{down-of}'
bind-key -n C-Left swap-pane -s '{left-of}' bind-key -n C-Left swap-pane -s '{left-of}'
bind-key -n C-Right swap-pane -s '{right-of}' bind-key -n C-Right swap-pane -s '{right-of}'
# set -g default-terminal "xterm-256color" set -g default-terminal "xterm-256color"
# tell Tmux that outside terminal supports true color # tell Tmux that outside terminal supports true color
# set -ga terminal-overrides ",xterm-256color*:Tc" # set -ga terminal-overrides ",xterm-256color*:Tc"

View File

@ -23,7 +23,18 @@ def smooth_dimming(initial_brightness, final_brightness, duration, steps):
subprocess.call(['light', '-O']) subprocess.call(['light', '-O'])
initial_brightness = float(subprocess.getoutput('light')) initial_brightness = float(subprocess.getoutput('light'))
final_brightness = 0 if initial_brightness < 20 else 5 if initial_brightness < 20:
final_brightness = max(0, initial_brightness - 10)
elif initial_brightness < 40:
final_brightness = max(10, initial_brightness - 20)
elif initial_brightness < 60:
final_brightness = max(30, initial_brightness - 30)
elif initial_brightness < 80:
final_brightness = max(40, initial_brightness - 40)
elif initial_brightness < 100:
final_brightness = max(50, initial_brightness - 50)
dimming_duration = 0.3 if initial_brightness < 20 else .5 dimming_duration = 0.3 if initial_brightness < 20 else .5
num_steps = 20 if initial_brightness < 20 else 50 num_steps = 20 if initial_brightness < 20 else 50

View File

@ -1,17 +0,0 @@
#!/bin/bash
#
tmux split-window -h
tmux split-window
tmux resize-pane -U 14
tmux resize-pane -R 5
tmux send-keys -t0 "btop" Enter
tmux send-keys -t1 "while true;do task next limit:5;sleep 2;done" Enter
tmux send-keys -t2 "while true;do task burndown.daily;sleep 3;done" Enter
tmux rename-window "tasks"
tmux new-window

24
scripts/tasks Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
#
tasks_window=$(tmux list-windows | grep tasks | cut -d: -f1)
if [[ -z "$tasks_window" ]]; then
tmux create-window
tmux split-window -h
tmux split-window
tmux resize-pane -U 14
tmux resize-pane -R 5
tmux send-keys -t0 "btop" Enter
tmux send-keys -t1 "while true;do task next limit:5;sleep 2;done" Enter
tmux send-keys -t2 "while true;do task burndown.daily;sleep 3;done" Enter
tmux rename-window "tasks"
else
tmux select-window -t $tasks_window
fi