summaryrefslogtreecommitdiff
path: root/tw/home.scm
diff options
context:
space:
mode:
authorTimo Wilken2023-06-03 23:59:17 +0200
committerTimo Wilken2023-06-03 23:59:17 +0200
commit1bb96ebf8b93b856de64d7bb02c8fb47254932cb (patch)
treec7159da346a3179333c72d36248b2a4620758c22 /tw/home.scm
parentbb169097d97e9ff20e56d7d1a950866c6b25f007 (diff)
Indent *-file functions more conveniently
Files with potentially long or complex contents shouldn't be indented quite as far.
Diffstat (limited to 'tw/home.scm')
-rw-r--r--tw/home.scm66
1 files changed, 33 insertions, 33 deletions
diff --git a/tw/home.scm b/tw/home.scm
index 9bc9384a..ebd76aa3 100644
--- a/tw/home.scm
+++ b/tw/home.scm
@@ -298,24 +298,23 @@ auto-expand-secmem
"$_JAVA_OPTIONS${_JAVA_OPTIONS:+ }-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java")))))
(define polybar-wrapper
- (program-file
- "polybar-wrapper"
- #~(begin
- ;; This wrapper program checks that the monitor we want to start
- ;; polybar on is actually connected.
- (use-modules (ice-9 popen)
- (ice-9 rdelim))
- (let* ((connected-str (string-append (getenv "POLYBAR_MONITOR") " connected"))
- (xrandr (open-pipe* OPEN_READ #$(file-append xrandr "/bin/xrandr") "-q"))
- (monitor-connected?
- (let loop ((line (read-line xrandr)))
- (cond
- ((eof-object? line) #f) ; we didn't find our monitor connected
- ((string-prefix? connected-str line) #t) ; the monitor we want is connected
- (else (loop (read-line xrandr))))))) ; keep looking
- (close-pipe xrandr)
- (when monitor-connected?
- (execl #$(file-append polybar "/bin/polybar")))))))
+ (program-file "polybar-wrapper"
+ #~(begin
+ ;; This wrapper program checks that the monitor we want to start
+ ;; polybar on is actually connected.
+ (use-modules (ice-9 popen)
+ (ice-9 rdelim))
+ (let* ((connected-str (string-append (getenv "POLYBAR_MONITOR") " connected"))
+ (xrandr (open-pipe* OPEN_READ #$(file-append xrandr "/bin/xrandr") "-q"))
+ (monitor-connected?
+ (let loop ((line (read-line xrandr)))
+ (cond
+ ((eof-object? line) #f) ; we didn't find our monitor connected
+ ((string-prefix? connected-str line) #t) ; the monitor we want is connected
+ (else (loop (read-line xrandr))))))) ; keep looking
+ (close-pipe xrandr)
+ (when monitor-connected?
+ (execl #$(file-append polybar "/bin/polybar")))))))
(define-public (polybar-service monitor)
(shepherd-service
@@ -529,7 +528,7 @@ auto-expand-secmem
("kitty/diff.conf"
,(combined-text-file "kitty-diff.conf"
(plain-file "kitty-diff-custom.conf"
- "pygments_style bw\n")
+ "pygments_style bw\n")
catppuccin-kitty-diff))
("kitty/kitty.conf"
,(combined-text-file "kitty.conf"
@@ -560,22 +559,23 @@ auto-expand-secmem
(simple-service 'gui-scripts home-files-service-type
`(;; https://sw.kovidgoyal.net/kitty/kittens/diff/
(".local/bin/kdiff" ; show a diff
- ,(program-file "kdiff" #~(apply execl #$(file-append kitty "/bin/kitty") "kitty"
- "+kitten" "diff" (cdr (command-line)))))
+ ,(program-file "kdiff"
+ #~(apply execl #$(file-append kitty "/bin/kitty") "kitty"
+ "+kitten" "diff" (cdr (command-line)))))
(".local/bin/icat" ; kitty's "catimg" equivalent
- ,(program-file "icat" #~(apply execl #$(file-append kitty "/bin/kitty") "kitty"
- "+kitten" "icat" (cdr (command-line)))))
+ ,(program-file "icat"
+ #~(apply execl #$(file-append kitty "/bin/kitty") "kitty"
+ "+kitten" "icat" (cdr (command-line)))))
(".local/bin/screenlock"
- ,(program-file
- "screenlock"
- #~(begin ; Wrapper around i3lock to turn off the screen and pause notifications.
- (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "true")
- (system* #$(file-append xset "/bin/xset") "dpms" "0" "0" "5")
- ;; We mustn't use `file-append' here, as we have to pick up the
- ;; setuid binary for i3lock installed by the system config.
- (system* "i3lock" "-nc" #$catppuccin-background-color)
- (system* #$(file-append xset "/bin/xset") "dpms" "600" "600" "600")
- (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "false"))))
+ ,(program-file "screenlock"
+ #~(begin ; Wrapper around i3lock to turn off the screen and pause notifications.
+ (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "true")
+ (system* #$(file-append xset "/bin/xset") "dpms" "0" "0" "5")
+ ;; We mustn't use `file-append' here, as we have to pick up the
+ ;; setuid binary for i3lock installed by the system config.
+ (system* "i3lock" "-nc" #$catppuccin-background-color)
+ (system* #$(file-append xset "/bin/xset") "dpms" "600" "600" "600")
+ (system* #$(file-append dunst "/bin/dunstctl") "set-paused" "false"))))
;; With #:recursive? #t, Guix keeps the files' permission bits, i.e. makes them executable.
(".local/bin/sessionmenu" ,(local-file "home/files/sessionmenu" #:recursive? #t))
(".local/bin/passmenu" ,(local-file "home/files/passmenu" #:recursive? #t))