blob: 4a6bd11514f4c154bbc2447941f78b7bce24e8b7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
source ~/.config/zsh/paths.zsh;
source ~/.config/zsh/config.zsh;
##### Helpers {{{
action="$1";
# Is logout command (Cleanup)
is_kill() { [[ "$action" == "kill" ]]; }
# Focus on a tag/ws
focus_tag() { [[ ! -z "$1" ]] && dwmc view $(($1 - 1)); sleep 0.2; }
# Only run when there are no windows on the screen
on_startup() { is_kill || [[ "$(wmctrl -l | wc -l)" = "0" ]] && $@ & }
# Run only once. If an instance is already running, noop
once() {
local name=$1; shift;
if (is_kill); then
pkill "$name";
else
pgrep $name || $@ &
fi;
}
# Kill previous instance and run again
run() {
local name=$1; shift;
[[ ! -z "$name" ]] && pkill "$name" && sleep 0.1;
is_kill || $@ &
}
spew() {
local name=$1; shift;
[[ ! -z "$name" ]] && pkill "$name" && sleep 0.1;
is_kill || setsid -f "$@"
}
# }}}
##### Autostart {{{
echo "[Autostart]: Running daemons";
# Key daemon
spew "shotkey" shotkey;
# Wallpaper
run "" ~/.fehbg;
# Notification daemon
spew "dunst" dunst -config ~/.config/dunst/dunstrc;
# Compositor
spew "picom" picom --config ~/.config/picom.conf;
# Scheduler
spew "remind" remind -k'notify-send -a reminder %s' -z10 "$REMINDER_FILE";
# Battery watcher
run "" ~/scripts/battery-watch.sh start;
# KDEconnect connect
# run "" kdeconnect-cli --refresh;
once "easyeffects" easyeffects --gapplication-service;
# }}}
##### Initialized applications {{{
echo "[Autostart]: Checking applications";
applications() {
sleep 0.5;
run "dwmblocks" dwmblocks;
on_startup sidekick;
# spew "thunderbird" thunderbird;
#focus_tag 9;
#on_startup :today;
#on_startup :tasks;
#focus_tag 6;
#on_startup sensible-browser;
#focus_tag 1;
}
applications &
# }}}
disown;
|