]> git.ekhem.eu.org Git - guix.git/commitdiff
[home] Change screen layouts with autorandr.
authorJakub Czajka <jakub@ekhem.eu.org>
Fri, 23 Dec 2022 19:43:09 +0000 (20:43 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:53:07 +0000 (19:53 +0100)
autorandr/.config/autorandr/postswitch [new file with mode: 0755]
conf/home/desktop.scm

diff --git a/autorandr/.config/autorandr/postswitch b/autorandr/.config/autorandr/postswitch
new file mode 100755 (executable)
index 0000000..54a46cc
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+#
+# postswitch - Script executed after the layout switch.
+
+if [ `which wallpaper` ]; then
+    wallpaper
+fi
+
+dunstify "🖵 Profile: ${AUTORANDR_CURRENT_PROFILE}"
index db0e97670fb18e47cb945fba233e3f62d8d3b241..54027f70e79c3fbfd31da57ebc972c2e81bf20d3 100644 (file)
@@ -9,8 +9,21 @@
   #:use-module (conf home status-bar)
   #:use-module (conf home wallpaper)
   #:use-module (conf home xcompmgr)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages xorg)
   #:use-module (gnu services)
-  #:export (desktop-services))
+  #:export (autorandr-services
+           desktop-services))
+
+(define autorandr-services
+  (list (service home-program-service-type
+                (home-program-configuration
+                 (packages
+                  (list autorandr
+                        xrandr))
+                 (dotfiles
+                  (list "autorandr/.config/autorandr/postswitch"))))
+       notify-service))
 
 (define desktop-services
   (list status-bar-service