aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2026-01-28 00:38:43 -0800
committerMark Nipper <nipsy@bitgnome.net>2026-01-28 00:38:43 -0800
commitd9379c12a4e90c4e07d67f34d92aa6bebf28f15c (patch)
treeb96fa3aed80ef7164673f791390ef2a98305be3d /home
parent5d6b0878336d750032ba677152305cfc1fb88ef3 (diff)
downloadnix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar.gz
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar.bz2
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar.lz
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar.xz
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.tar.zst
nix-d9379c12a4e90c4e07d67f34d92aa6bebf28f15c.zip
Add custom swaybg and better separate i3 and sway configurations
Diffstat (limited to '')
-rw-r--r--home/nipsy/caladan.nix5
-rw-r--r--home/nipsy/common/optional/desktops/default.nix1
-rw-r--r--home/nipsy/common/optional/desktops/sway/config (renamed from home/nipsy/caladan/sway/config)2
-rw-r--r--home/nipsy/common/optional/desktops/sway/default.nix6
-rwxr-xr-xhome/nipsy/common/optional/desktops/sway/swaybg46
-rw-r--r--home/nipsy/fangorn.nix1
-rw-r--r--home/nipsy/ginaz.nix1
-rw-r--r--home/nipsy/kaitain.nix1
-rw-r--r--home/nipsy/richese.nix1
9 files changed, 61 insertions, 3 deletions
diff --git a/home/nipsy/caladan.nix b/home/nipsy/caladan.nix
index a79bbe7..644d69f 100644
--- a/home/nipsy/caladan.nix
+++ b/home/nipsy/caladan.nix
@@ -3,14 +3,15 @@
imports = [
common/core
common/optional/desktops
- common/optional/desktops/services/xscreensaver.nix
+ #common/optional/desktops/i3
+ #common/optional/desktops/services/xscreensaver.nix
+ common/optional/desktops/sway
common/optional/desktops/xdg.nix
common/optional/secrets.nix
#inputs.sops-nix.homeManagerModules.sops
];
home.file = {
- ".config/sway/config".source = ./caladan/sway/config;
".mailcap".text = ''
#application/msword; antiword -rs '%s'; copiousoutput; description=Microsoft Word Document
application/pdf; pdftotext '%s' -; copiousoutput; description=Adobe Portable Document Format
diff --git a/home/nipsy/common/optional/desktops/default.nix b/home/nipsy/common/optional/desktops/default.nix
index d2f141d..4209fc9 100644
--- a/home/nipsy/common/optional/desktops/default.nix
+++ b/home/nipsy/common/optional/desktops/default.nix
@@ -3,7 +3,6 @@
./fonts.nix
./ghostty.nix
#./gtk.nix
- ./i3
./services/dunst.nix
];
}
diff --git a/home/nipsy/caladan/sway/config b/home/nipsy/common/optional/desktops/sway/config
index dcedd45..b11d6ea 100644
--- a/home/nipsy/caladan/sway/config
+++ b/home/nipsy/common/optional/desktops/sway/config
@@ -45,6 +45,8 @@ output * mode 2560x1440@143.972Hz adaptive_sync on allow_tearing yes bg ~/bg/Sta
exec swayidle -w \
timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"'
+exec ~/bin/swaybg
+
### Default options
default_border none
default_floating_border none
diff --git a/home/nipsy/common/optional/desktops/sway/default.nix b/home/nipsy/common/optional/desktops/sway/default.nix
new file mode 100644
index 0000000..7ef26f4
--- /dev/null
+++ b/home/nipsy/common/optional/desktops/sway/default.nix
@@ -0,0 +1,6 @@
+{
+ home.file = {
+ ".config/sway/config".source = ./config;
+ "bin/swaybg".source = ./swaybg;
+ };
+}
diff --git a/home/nipsy/common/optional/desktops/sway/swaybg b/home/nipsy/common/optional/desktops/sway/swaybg
new file mode 100755
index 0000000..ae1a41e
--- /dev/null
+++ b/home/nipsy/common/optional/desktops/sway/swaybg
@@ -0,0 +1,46 @@
+#!/usr/bin/env zsh
+
+# bail out if not running under sway
+if [[ ! -S ${SWAYSOCK} ]]; then
+ echo "no running sway detected, ${0:t} bailing out" >&2
+ exit 0
+fi
+
+# record our own PID to avoid duplicate invocations
+PIDFILE="/dev/shm/${0:t}.pid"
+
+# check for already running script
+if [[ -f ${PIDFILE} ]]; then
+ for i in $(pidof -x ${0:t}); do
+ if [[ ${i} -eq $(cat ${PIDFILE}) ]]; then
+ echo "${0:t} already running!" >&2
+ exit 1
+ fi
+ done
+fi
+
+# record current PID
+echo ${$} > ${PIDFILE}
+
+# main loop
+while true; do
+
+ # sleep initially as sway will load its default background
+ sleep 10m
+
+ # test for continued presence of sway and bail if not found
+ if [[ ! -S ${SWAYSOCK} ]]; then
+ echo "sway has stopped running, ${0:t} bailing out" >&2
+ exit 0
+ fi
+
+ # build array of only type file present underneath my background directory
+ bg=(~/bg/**/*(.))
+
+ # select and set our new background at random based on the array length
+ swaymsg -s ${SWAYSOCK} output '*' bg ${bg[$((RANDOM % $#bg + 1))]} fill
+
+done
+
+# exit with error since we should never get here
+exit 1
diff --git a/home/nipsy/fangorn.nix b/home/nipsy/fangorn.nix
index 4a50c81..bd7a95d 100644
--- a/home/nipsy/fangorn.nix
+++ b/home/nipsy/fangorn.nix
@@ -3,6 +3,7 @@
imports = [
common/core
common/optional/desktops
+ common/optional/desktops/i3
common/optional/desktops/services/blueman-applet.nix
common/optional/desktops/services/xscreensaver.nix
common/optional/secrets.nix
diff --git a/home/nipsy/ginaz.nix b/home/nipsy/ginaz.nix
index 918a988..838681f 100644
--- a/home/nipsy/ginaz.nix
+++ b/home/nipsy/ginaz.nix
@@ -8,6 +8,7 @@
imports = [
common/core
common/optional/desktops
+ common/optional/desktops/i3
common/optional/desktops/services/blueman-applet.nix
common/optional/desktops/services/xscreensaver.nix
common/optional/desktops/xdg.nix
diff --git a/home/nipsy/kaitain.nix b/home/nipsy/kaitain.nix
index cffa32f..406da99 100644
--- a/home/nipsy/kaitain.nix
+++ b/home/nipsy/kaitain.nix
@@ -3,6 +3,7 @@
imports = [
common/core
common/optional/desktops
+ common/optional/desktops/i3
common/optional/secrets.nix
];
diff --git a/home/nipsy/richese.nix b/home/nipsy/richese.nix
index 7f73858..aac211f 100644
--- a/home/nipsy/richese.nix
+++ b/home/nipsy/richese.nix
@@ -3,6 +3,7 @@
imports = [
common/core
common/optional/desktops
+ common/optional/desktops/i3
common/optional/secrets.nix
];