Change summary
dot_local/bin/executable_startup-i3.tmpl | 54 ----------------------
dot_local/bin/executable_startup.tmpl | 62 ++++++++++++++++++++++++++
2 files changed, 62 insertions(+), 54 deletions(-)
Detailed changes
@@ -1,54 +0,0 @@
-#!/bin/sh -x
-autocutsel -fork
-autocutsel -fork -selection PRIMARY
-
-# Start headless applications
-i3-msg exec "polybar top"
-i3-msg exec "polybar bottom"
-i3-msg exec "feh --bg-scale ~/.wallpaper.png"
-i3-msg exec "blueman-applet"
-i3-msg exec "redshift"
-i3-msg exec "/usr/lib/geoclue-2.0/demos/agent"
-i3-msg exec "dunst"
-i3-msg exec "playerctl pause"
-i3-msg exec "setxkbmap -option compose:ralt"
-i3-msg exec "xset r rate 250 50"
-i3-msg exec "gotify-desktop"
-i3-msg exec "picom"
-i3-msg exec "solaar -w hide"
-i3-msg exec "unclutter --ignore-scrolling --start-hidden"
-i3-msg exec "emacs --daemon"
-i3-msg exec "xrdb -load ~/.Xresources"
-i3-msg exec "xfsettingsd"
-i3-msg exec "darkman get"
-
-i3-msg exec st "zsh -c 'bitw serve'"
-
-{{- if eq .chezmoi.hostname "angmar" }}
-i3-msg exec "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"
-i3-msg workspace 7
-i3-msg exec "hydrus-client"
-i3-msg workspace 6
-i3-msg exec "telegram-desktop"
-i3-msg exec "sprig"
-i3-msg exec "beeper"
-i3-msg workspace 1
-i3-msg exec "firefox-developer-edition"
-i3-msg exec "xrandr -r 165.00"
-{{- end }}
-
-sleep 50
-i3-msg exec "nextcloud"
-
-##############################
-# Wacom tablet configuration #
-##############################
-
-# Tablet button 1 = delete
-xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key del"
-# Tablet button 3 = ctrl+z
-xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 "key +ctrl z -ctrl"
-# Tablet button 4 = ctrl+shift+z
-xsetwacom set "Wacom Intuos BT S Pad pad" Button 8 "key +ctrl +shift z -shift -ctrl"
-
-exit
@@ -0,0 +1,62 @@
+#!/bin/bash
+autocutsel -fork
+autocutsel -fork -selection PRIMARY
+
+matched=$(hyprctl instances | grep -oE "instance [a-zA-Z0-9]{40}_[a-zA-Z0-9]{10}:")
+
+if [[ -n $matched ]]; then
+ # We're in Wayland
+ hyprctl dispatch exec -- "waybar"
+ hyprctl dispatch exec -- "blueman-applet"
+ hyprctl dispatch exec -- "gammastep"
+ hyprctl dispatch exec -- "/usr/lib/geoclue-2.0/demos/agent"
+ hyprctl dispatch exec -- "dunst"
+ hyprctl dispatch exec -- "playerctl pause"
+ hyprctl dispatch exec -- "solaar -w hide"
+ hyprctl dispatch exec -- "emacs --daemon"
+ hyprctl dispatch exec -- "xrdb -load ~/.Xresources"
+ hyprctl dispatch exec -- "xfsettingsd"
+ hyprctl dispatch exec -- "darkman get"
+ hyprctl dispatch exec -- "nextcloud"
+ {{- if eq .chezmoi.hostname "angmar" }}
+ hyprctl dispatch exec -- "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"
+ hyprctl dispatch exec -- "hydrus-client"
+ hyprctl dispatch exec -- "telegram-desktop"
+ hyprctl dispatch exec -- "firefox-developer-edition"
+ {{- end }}
+else
+ # We're in i3 (X.org)
+ i3-msg exec "polybar top"
+ i3-msg exec "polybar bottom"
+ i3-msg exec "feh --bg-scale ~/.wallpaper.png"
+ i3-msg exec "blueman-applet"
+ i3-msg exec "redshift"
+ i3-msg exec "/usr/lib/geoclue-2.0/demos/agent"
+ i3-msg exec "dunst"
+ i3-msg exec "playerctl pause"
+ i3-msg exec "setxkbmap -option compose:ralt"
+ i3-msg exec "xset r rate 250 50"
+ i3-msg exec "picom"
+ i3-msg exec "solaar -w hide"
+ i3-msg exec "unclutter --ignore-scrolling --start-hidden"
+ i3-msg exec "emacs --daemon"
+ i3-msg exec "xrdb -load ~/.Xresources"
+ i3-msg exec "xfsettingsd"
+ i3-msg exec "darkman get"
+ i3-msg exec "nextcloud"
+ {{- if eq .chezmoi.hostname "angmar" }}
+ i3-msg exec "caddy start --adapter caddyfile --config ~/Bulk/Media/Caddyfile"
+ i3-msg workspace 7
+ i3-msg exec "hydrus-client"
+ i3-msg workspace 6
+ i3-msg exec "telegram-desktop"
+ i3-msg workspace 1
+ i3-msg exec "firefox-developer-edition"
+ i3-msg exec "xrandr -r 165.00"
+ {{- end }}
+ xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key del"
+ xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 "key +ctrl z -ctrl"
+ xsetwacom set "Wacom Intuos BT S Pad pad" Button 8 "key +ctrl +shift z -shift -ctrl"
+fi
+
+exit