1#!/bin/bash
2
3matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:")
4
5if [[ -n $matched ]]; then
6 # We're in Wayland
7 hyprctl dispatch exec -- "waybar"
8 hyprctl dispatch exec -- "blueman-applet"
9 hyprctl dispatch exec -- "gammastep"
10 hyprctl dispatch exec -- "/usr/lib/geoclue-2.0/demos/agent"
11 hyprctl dispatch exec -- "dunst"
12 hyprctl dispatch exec -- "playerctl pause"
13 hyprctl dispatch exec -- "solaar -w hide"
14 hyprctl dispatch exec -- "emacs --daemon"
15 hyprctl dispatch exec -- "xrdb -load ~/.Xresources"
16 hyprctl dispatch exec -- "xfsettingsd"
17 hyprctl dispatch exec -- "darkman get"
18 hyprctl dispatch exec -- "dbus-update-activation-environment --all"
19 hyprctl dispatch exec -- "telegram-desktop"
20 {{- if eq .chezmoi.hostname "angmar" }}
21 hyprctl dispatch exec -- "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"
22 hyprctl dispatch exec -- "firefox-developer-edition"
23 {{- end }}
24 sleep 5
25 hyprctl dispatch exec -- "nextcloud"
26else
27 # We're in i3 (X.org)
28 i3-msg exec "polybar top"
29 i3-msg exec "polybar bottom"
30 i3-msg exec "feh --bg-scale ~/.wallpaper.png"
31 i3-msg exec "blueman-applet"
32 i3-msg exec "redshift"
33 i3-msg exec "/usr/lib/geoclue-2.0/demos/agent"
34 i3-msg exec "dunst"
35 i3-msg exec "playerctl pause"
36 i3-msg exec "setxkbmap -option compose:ralt"
37 i3-msg exec "xset r rate 250 50"
38 i3-msg exec "picom"
39 i3-msg exec "solaar -w hide"
40 i3-msg exec "unclutter --ignore-scrolling --start-hidden"
41 i3-msg exec "emacs --daemon"
42 i3-msg exec "xrdb -load ~/.Xresources"
43 i3-msg exec "xfsettingsd"
44 i3-msg exec "darkman get"
45 i3-msg exec "dbus-update-activation-environment --all"
46 {{- if eq .chezmoi.hostname "angmar" }}
47 i3-msg exec "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"
48 i3-msg workspace 7
49 i3-msg workspace 6
50 i3-msg exec "telegram-desktop"
51 i3-msg workspace 1
52 i3-msg exec "firefox-developer-edition"
53 i3-msg exec "xrandr -r 165.00"
54 {{- end }}
55 xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key del"
56 xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 "key +ctrl z -ctrl"
57 xsetwacom set "Wacom Intuos BT S Pad pad" Button 8 "key +ctrl +shift z -shift -ctrl"
58 sleep 5
59 i3-msg exec "nextcloud"
60fi
61
62exit