summaryrefslogtreecommitdiffstats
path: root/.config/x11/xinitrc
blob: d943d15336a4ecaf2c3117664c4a7519e8b67765 (plain)
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
96
97
98
99
100
101
102
103
104
105
# vim: filetype=sh

case $(hostname -s) in
	mother)
		icon=" "
		mpd="mpd"
		xscr="xscreensaver --no-splash"
		sleep="sleep 1"
		ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1"
		host="mother"
		doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan
		;;
	po-rbo)
		icon=" "
		mpd="mpd"
		xscr="xscreensaver"
		sleep="sleep 0.1"
		ping="ping -c1 -w1 9.9.9.9 >/dev/null 2>&1"
		host="po-rbo"
		doas mkdir /var/run/r_bousset && doas chown -v r_bousset: /var/run/r_bousset
		;;
	mars)
		icon=" "
		mpd="musicpd"
		xscr="xscreensaver --no-splash"
		sleep="gsleep 1"
		ping="ping -c1 -t1 9.9.9.9 >/dev/null 2>&1"
		host="mars"
		doas mkdir /var/run/jozan && doas chown -v jozan: /var/run/jozan
		;;
esac

[ $host = "po-rbo" ] &&	source "$HOME"/.config/env

$ping && git --git-dir="$HOME"/docs/dotfiles-bsd --work-tree="$HOME" pull

startif() {
	pgrep "$(basename "$1")" >/dev/null || "$@" >/dev/null 2>&1 &
}

dunst_shit() {
	sleep 1
	[ $host = "po-rbo" ] &&	startif /home/r_bousset/.nix-profile/bin/dunst || startif dunst
	sleep 2
	startif mpd-notification
	startif lowbat
	for pid in $(ps aux | grep local/bin/kb | awk '{print $2}'); do
		kill -9 $pid
	done
	[ $host = "mother" ] && "$HOME"/.local/bin/setwp "$HOME"/pics/wp.png || "$HOME"/.local/bin/setwp "$HOME"/pics/wp/129.jpg
	"$HOME"/.local/bin/kb &
}

start_apps() {
	[ $host = "po-rbo" ] && /home/r_bousset/.local/bin/pipe
	startif copyq
	startif nextcloud
	startif rclone-browser
	startif nixGL teams-for-linux
	startif thunderbird
	startif firefox
}

export LANG='en_US.UTF-8'
[ $host = "mother" ] && xrandr --output HDMI-0 --primary --mode 1920x1080 --pos 1440x0 --rotate normal \
	--output DP-0 --mode 1680x1050 --pos 3360x0 --rotate normal \
	--output DP-1 --off \
	--output DP-2 --off \
	--output DP-3 --off \
	--output DP-4 --mode 1440x900 --pos 0x0 --rotate normal \
	--output DP-5 --off
[ $host = "po-rbo" ] && xrandr \
	--output eDP-1 --mode 1920x1200 --pos 0x0 --rotate normal \
	--output HDMI-1 --primary --mode 2560x1440 --pos 1920x0 --rotate normal \
	--output DP-1 --mode 2560x1440 --pos 4480x0 --rotate normal \
	--output HDMI-2 --off \
	--output VIRTUAL-1 --off

dunst_shit
startif picom
pgrep $mpd >/dev/null || $mpd >/dev/null 2>&1
xset s off
xset -dpms
startif $xscr
# doas rc-service wireguard start &&
# 	notify-send -u normal 'wireguard' 'WireGuard started'
# $sleep
pkill wireplumber
pkill pipewire-pulse
pkill pipewire
startif pipewire
$sleep
startif pipewire-pulse
$sleep
startif wireplumber
$sleep
startif nm-applet
$sleep
startif blueman-applet
cd "$HOME"
xrdb "$HOME"/.config/x11/xresources
start_apps &
notify-send -u normal 'Welcome' "$icon Welcome back, partner!"

[ $host = "po-rbo" ] && exec dwm