~ruther/guix-config

f715765326fb16330a483c0d7e6763afa281185b — Rutherther 6 months ago 0e7091d
fix: dwl scripts, new passmenu scripts
M home/modules/ruther/home/dwl/config.h => home/modules/ruther/home/dwl/config.h +2 -1
@@ 232,8 232,9 @@ static const Key keys[] = {
	{ 0,                         Key_Print,                 spawn, SHCMD("%printscreen% -s") },

	/* { MODKEY,                    Key_y,          spawn,      SHCMD("emacs-anywhere") }, */
  // todo better passmenu with totp etc.
	{ MODKEY,                    Key_p,          spawn,      SHCMD("passmenu") },
	{ MODKEY|WLR_MODIFIER_SHIFT, Key_p,          spawn,      SHCMD("passmenu-totp") },
	{ MODKEY|WLR_MODIFIER_ALT,   Key_p,          spawn,      SHCMD("passmenu-multi") },

	{ MODKEY,                    Key_c,          togglesticky,   {0} },
	{ MODKEY,                    Key_s,          entermode,      {.i = SCRATCHPADS} },

M home/modules/ruther/home/dwl/scripts/brightness.sh => home/modules/ruther/home/dwl/scripts/brightness.sh +2 -1
@@ 2,7 2,8 @@

function send_notification() {
    brightness=$(printf "%.0f\n" $(brillo -G))
    dunstify -a "brightness" -u low -r 9991 -h int:value:"$brightness" -i "brightness-$1" "Brightness: $brightness %"
    notify-send "Brightness: $brightness %"
    # dunstify -a "brightness" -u low -r 9991 -h int:value:"$brightness" -i "brightness-$1" "Brightness: $brightness %"
}

case $1 in

M home/modules/ruther/home/dwl/wm.scm => home/modules/ruther/home/dwl/wm.scm +32 -19
@@ 8,6 8,8 @@
  #:use-module (gnu packages terminals)
  #:use-module (gnu packages hardware)
  #:use-module (gnu packages image)
  #:use-module (gnu packages base)
  #:use-module (gnu packages gnome)

  #:use-module (ruther packages wayland)
  #:use-module (ruther home passwords)


@@ 49,15 51,18 @@
;; but I am too lazy for now.
(define brightness-script-builder
  (with-imported-modules '((guix build utils))
    #~(begin
        (use-modules (guix build utils))
                         #~(begin
                             (use-modules (guix build utils))

        (set-path-environment-variable
         "PATH" (list "bin")
         (list #$brillo))
                             (set-path-environment-variable
                              "PATH" (list "bin")
                              (list #$brillo
                                    #$libnotify))

        (invoke #$(file-append bash "/bin/sh")
                #$(local-file "scripts/brightness.sh")))))
                             (apply invoke
                                    (cons* #$(file-append bash "/bin/sh")
                                           #$(local-file "scripts/brightness.sh")
                                           (cdr (program-arguments)))))))

(define-public brightness-script
  (program-file


@@ 67,18 72,23 @@
;; TODO: make this a guile script
;; but I am too lazy for now.
(define printscreen-script-builder
  (with-imported-modules '((guix build utils))
    #~(begin
        (use-modules (guix build utils))

        (set-path-environment-variable
         "PATH" (list "bin")
         (list #$slurp
               #$grim
               #$wl-clipboard))

        (invoke #$(file-append bash "/bin/bash")
                #$(local-file "scripts/print.sh")))))
  (with-imported-modules
   '((guix build utils))
   #~(begin
       (use-modules (guix build utils))

       (set-path-environment-variable
        "PATH" (list "bin")
        (list #$slurp
              #$grim
              #$wl-clipboard
              #$coreutils-minimal))

       (apply invoke
              (cons*
               #$(file-append bash "/bin/bash")
               #$(local-file "scripts/print.sh")
               (cdr (program-arguments)))))))

(define-public printscreen-script
  (program-file


@@ 108,6 118,8 @@
                              (("\"foot\"") (string-append "\"" #$foot "/bin/foot\""))
                              (("\"rofi\"") (string-append "\"" #$rofi-wayland "/bin/rofi\""))
                              (("\"passmenu\"") (string-append "\"" #$password-store-wl "/bin/passmenu\""))
                              (("\"passmenu-totp\"") (string-append "\"" #$password-store-passmenus "/bin/passmenu-totp\""))
                              (("\"passmenu-multi\"") (string-append "\"" #$password-store-passmenus "/bin/passmenu-multi\""))
                              (("\"emacsclient\"") (string-append "\"" #$emacs-pgtk "/bin/emacsclient\""))
                              (("%brightness%") #$brightness-script)
                              (("%printscreen%") #$printscreen-script)))))))))))


@@ 125,6 137,7 @@
     "mpris-ctl"

     "password-store-wl"
     "pass-otp"

     "emacs-pgtk")))


M home/modules/ruther/home/passwords.scm => home/modules/ruther/home/passwords.scm +52 -0
@@ 2,8 2,10 @@
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix build-system trivial)
  #:use-module (ruther packages wayland)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages password-utils))

(define-public password-store-wl


@@ 25,3 27,53 @@
                  (("xdotool=\"ydotool")
                   (string-append "xdotool=\""
                                  (search-input-file inputs "/bin/ydotool"))))))))))))

(define-public password-store-passmenus
  (package
   (name "password-store-passmenus")
   (source (local-file "scripts" #:recursive? #t))
   (build-system trivial-build-system)
   (inputs
    (list
     password-store-wl
     dmenu-wl
     ydotool
     libnotify
     wl-clipboard))
   (arguments
    (list
     #:builder
     (with-imported-modules
      '((guix build utils))
      #~(begin
          (use-modules (guix build utils))
          (copy-recursively #$source (getcwd))

          (define (substitute-passmenu path)
            (substitute* path
                         (("dmenu=dmenu-wl\n")
                          (string-append "dmenu="
                                         (search-input-file %build-inputs "/bin/dmenu-wl")
                                         "\n"))
                         (("xdotool=\"ydotool")
                          (string-append "xdotool=\""
                                         (search-input-file %build-inputs "/bin/ydotool")))
                         (("notify-send")
                          (string-append (search-input-file %build-inputs "/bin/notify-send")))
                         (("wl-copy")
                          (string-append (search-input-file %build-inputs "/bin/wl-copy")))
                         (("pass ")
                          (string-append (search-input-file %build-inputs "/bin/pass")
                                         " "))))

          (substitute-passmenu "passmenu-totp")
          (substitute-passmenu "passmenu-multi")

          (let ((bin (string-append #$output "/bin")))
            (install-file "passmenu-totp" bin)
            (install-file "passmenu-multi" bin))))))
   (version "0")
   (synopsis #f)
   (description #f)
   (license #f)
   (home-page #f)))

Do not follow this link