From 22db8da8b8c252c3f01c30a08c9e5b6aea2b4bae Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 20 Jun 2024 00:04:53 -0600 Subject: Add zathura config, 'pdf' module --- .config/guix/hati.scm | 6 +- .config/guix/modules/base.scm | 4 +- .config/guix/modules/emacs.scm | 4 +- .config/guix/modules/pdf.scm | 224 +++++++++++++++++++++++++++++++++++++++++ .config/guix/modules/xorg.scm | 1 + .config/guix/vali.scm | 4 +- 6 files changed, 235 insertions(+), 8 deletions(-) create mode 100644 .config/guix/modules/pdf.scm diff --git a/.config/guix/hati.scm b/.config/guix/hati.scm index 4967bde..2c08f4e 100644 --- a/.config/guix/hati.scm +++ b/.config/guix/hati.scm @@ -17,7 +17,8 @@ #:use-module (modules dwm) #:use-module (modules utils) #:use-module (modules xorg) - #:use-module (modules ymir)) + #:use-module (modules ymir) + #:use-module (modules pdf)) (define home @@ -25,6 +26,7 @@ (services `(,@bd-base-home-services ,@bd-desktop-home-services + ,@bd-pdf-services ,@bd-dwm-home-services ,(service home-syncthing-service-type))))) @@ -50,7 +52,7 @@ ,@bd-mpd-service ,(service guix-home-service-type `((,username ,home))))) - + (mapped-devices (list (mapped-device (source (uuid "1e9c3cd7-97c2-411a-975a-40222d185563")) (target "hidden") diff --git a/.config/guix/modules/base.scm b/.config/guix/modules/base.scm index 3f9c3dc..79e08db 100644 --- a/.config/guix/modules/base.scm +++ b/.config/guix/modules/base.scm @@ -43,7 +43,7 @@ mail ;; notmuch, offlineimap package-management ;; stow password-utils ;; pass-otp, password-store - pdf ;; xpdf, zathura, zathura-pdf-mupdf + pdf ;; xpdf rsync ;; rsync texlive ;; texlive version-control ;; git @@ -90,8 +90,6 @@ icecat imagemagick mpv - zathura - zathura-pdf-mupdf )) (define bd-base-system-packages diff --git a/.config/guix/modules/emacs.scm b/.config/guix/modules/emacs.scm index 932530c..7ed090a 100644 --- a/.config/guix/modules/emacs.scm +++ b/.config/guix/modules/emacs.scm @@ -21,7 +21,7 @@ mail lisp) -(define (bd-home-emacs-package-list config) +(define (bd-emacs-package-list config) (list ;; direct emacs-all-the-icons @@ -65,5 +65,5 @@ emacs configuration.") (extensions (list (service-extension home-profile-service-type - bd-home-emacs-package-list))) + bd-emacs-package-list))) (default-value #f))) diff --git a/.config/guix/modules/pdf.scm b/.config/guix/modules/pdf.scm new file mode 100644 index 0000000..7b7d26f --- /dev/null +++ b/.config/guix/modules/pdf.scm @@ -0,0 +1,224 @@ +(define-module (modules pdf) + #:use-module (gnu) + #:use-module (gnu home services) + #:use-module (guix gexp) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu system) + #:use-module (gnu packages pdf) ;; zathura, zathura-pdf-mupdf + #:export (bd-pdf-services)) + +(define (bd-pdf-package-list config) + (list + zathura + zathura-pdf-mupdf ;; epub! + )) + +(define bd-pdf-services + (list + (service (service-type (name 'zathura-config) + (description "Installs pdf packages.") + (extensions + (list (service-extension + home-profile-service-type + bd-pdf-package-list))) + (default-value #f))) + (simple-service 'zathurarc + home-files-service-type + `((".config/zathura/zathurarc" + ,(plain-file "zathurarc" " +# start in dark mode +set recolor true +# mouse select copies to clipboard +set selection-clipboard clipboard +set scroll-full-overlap 0.2 +# stops at page break +set scroll-page-aware true +set window-title-basename true +# start at width fit +set adjust-open width +# short version of the file path +set statusbar-home-tilde true +# center screen vertical midpoint +set vertical-center true +# synctex support +set synctex true +set zoom-step 3 + +# lots taken from +# https://web.archive.org/web/20220815064614/https://gist.github.com/ne9z/8778d614b90b85dfe8f6b698ad758f36 +map [normal] scroll left +map [normal] scroll down +map [normal] scroll up +map [normal] scroll right +map [normal] abort +map [insert] abort +map [normal] abort +map [normal] goto top +map [normal] > goto bottom +map [normal] a adjust_window best-fit +map [normal] s adjust_window width +map [normal] F display_link +map [normal] copy_link +map [normal] f follow +map [normal] m mark_add +map [normal] \\' mark_evaluate +map [normal] \\, navigate next +map [normal] \\. navigate previous +map [normal] navigate next +map [normal] navigate previous +map [normal] scroll full-down +map [normal] scroll full-up +map [normal] print +map [normal] c recolor +map [normal] R reload +map [normal] v rotate rotate_cw +map [normal] V rotate rotate_ccw +map [normal] scroll left +map [normal] scroll up +map [normal] scroll down +map [normal] scroll right +map [normal] scroll half-left +map [normal] scroll half-down +map [normal] scroll half-up +map [normal] scroll half-right +map [normal] scroll full-left +map [normal] scroll full-down +map [normal] scroll full-down +map [normal] scroll full-up +map [normal] scroll full-right +map [normal] scroll full-down +map [normal] scroll full-up +map [normal] scroll full-up +map [normal] scroll full-up +map [normal] l jumplist backward +map [normal] r jumplist forward +map [normal] bisect forward +map [normal] bisect backward +# still need to use '/' to trigger search +map [normal] search forward +map [normal] search backward +map [normal] p snap_to_page +map [normal] toggle_index +map [normal] i toggle_index +map [normal] toggle_index +map [normal] toggle_statusbar +map [normal] focus_inputbar +map [normal] d toggle_page_mode +map [normal] q quit +map [normal] + zoom in +map [normal] - zoom out +map [normal] = zoom in +map [normal] toggle_presentation +map [normal] toggle_fullscreen +map [normal] j toggle_fullscreen +map [fullscreen] j toggle_fullscreen +map [fullscreen] q toggle_fullscreen +map [fullscreen] scroll left +map [fullscreen] scroll down +map [fullscreen] scroll up +map [fullscreen] scroll right +map [fullscreen] abort +map [fullscreen] abort +map [fullscreen] goto top +map [fullscreen] > goto bottom +map [fullscreen] a adjust_window best-fit +map [fullscreen] s adjust_window width +map [fullscreen] F display_link +map [fullscreen] copy_link +map [fullscreen] f follow +map [fullscreen] m mark_add +map [fullscreen] \\' mark_evaluate +map [fullscreen] \\, navigate next +map [fullscreen] \\. navigate previous +map [fullscreen] navigate next +map [fullscreen] navigate previous +map [fullscreen] scroll full-down +map [fullscreen] scroll full-up +map [fullscreen] print +map [fullscreen] c recolor +map [fullscreen] R reload +map [fullscreen] v rotate rotate_cw +map [fullscreen] V rotate rotate_ccw +map [fullscreen] scroll left +map [fullscreen] scroll up +map [fullscreen] scroll down +map [fullscreen] scroll right +map [fullscreen] scroll half-left +map [fullscreen] scroll half-down +map [fullscreen] scroll half-up +map [fullscreen] scroll half-right +map [fullscreen] scroll full-left +map [fullscreen] scroll full-down +map [fullscreen] scroll full-down +map [fullscreen] scroll full-up +map [fullscreen] scroll full-right +map [fullscreen] scroll full-down +map [fullscreen] scroll full-up +map [fullscreen] scroll full-up +map [fullscreen] scroll full-up +map [fullscreen] l jumplist backward +map [fullscreen] r jumplist forward +map [fullscreen] bisect forward +map [fullscreen] bisect backward +map [fullscreen] search forward +map [fullscreen] search backward +map [fullscreen] p snap_to_page +map [fullscreen] i toggle_index +map [fullscreen] toggle_index +map [fullscreen] toggle_index +map [fullscreen] toggle_statusbar +map [fullscreen] focus_inputbar +map [fullscreen] d toggle_page_mode +map [fullscreen] + zoom in +map [fullscreen] - zoom out +map [fullscreen] = zoom in +# status bar will obscure last item in index mode +map [index] toggle_statusbar +map [index] q toggle_index +map [index] i toggle_index +map [index] navigate_index up +map [index] navigate_index up +map [index] navigate_index up +map [index] navigate_index down +map [index] navigate_index up +map [index] navigate_index down +map [index] \\< navigate_index top +map [index] \\> navigate_index bottom +map [index] navigate_index top +map [index] > navigate_index bottom +map [index] navigate_index collapse +map [index] navigate_index expand +map [index] navigate_index expand-all +map [index] navigate_index collapse-all +map [index] navigate_index up +map [index] navigate_index down +map [index] navigate_index collapse +map [index] navigate_index expand +map [index] navigate_index select +map [index] navigate_index select +map [index] navigate_index select +map [index] navigate_index select +map [index] toggle_index +map [index] toggle_index +map [index] toggle_index +map [index] toggle_index +map [presentation] i toggle_index +map [presentation] r navigate next +map [presentation] navigate next +map [presentation] navigate next +map [presentation] navigate next +map [presentation] navigate next +map [presentation] l navigate previous +map [presentation] navigate previous +map [presentation] navigate previous +map [presentation] navigate previous +map [presentation] navigate previous +map [presentation] navigate previous +map [presentation] toggle_presentation +map [presentation] q toggle_presentation +map [presentation] navigate previous +map [presentation] navigate previous +map [presentation] navigate next +map [presentation] goto top +map [presentation] > goto bottom")))))) diff --git a/.config/guix/modules/xorg.scm b/.config/guix/modules/xorg.scm index 7cfa312..07c58aa 100644 --- a/.config/guix/modules/xorg.scm +++ b/.config/guix/modules/xorg.scm @@ -130,6 +130,7 @@ xss-lock -- slock & set-bg xset r rate 250 70 xset s 600 +xrandr-defaults exec dwm")) (".config/gtk-2.0/settings.ini" ,(plain-file "settings.ini" " diff --git a/.config/guix/vali.scm b/.config/guix/vali.scm index a1ef44b..fc6f366 100644 --- a/.config/guix/vali.scm +++ b/.config/guix/vali.scm @@ -17,7 +17,8 @@ #:use-module (modules dwm) #:use-module (modules utils) #:use-module (modules xorg) - #:use-module (modules ymir)) + #:use-module (modules ymir) + #:use-module (modules pdf)) (define home @@ -25,6 +26,7 @@ (services `(,@bd-base-home-services ,@bd-desktop-home-services + ,@bd-pdf-services ,@bd-dwm-home-services ,(service home-syncthing-service-type))))) -- cgit v1.2.3