From 214bdb10b93216cfd7020f5bdd1ed0804804d711 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Mon, 21 Nov 2022 23:56:20 +0100 Subject: Improve Xorg setup --- Xresources | 13 +++++++++++++ home-configuration.scm | 35 ++++++++++++++++++++++++++++++----- user-dirs.dirs | 15 +++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 Xresources create mode 100644 user-dirs.dirs diff --git a/Xresources b/Xresources new file mode 100644 index 00000000..ba534392 --- /dev/null +++ b/Xresources @@ -0,0 +1,13 @@ +!! ~/.Xresources: X resources and settings + +*TkTheme: clam + +Xft.antialias: true +Xft.dpi: 96 +Xft.hinting: true +Xft.hintstyle: hintfull +Xft.lcdfilter: lcddefault +Xft.rgba: rgb + +Xcursor.theme: Catppuccin-Mocha-Dark-Cursors +Xcursor.size: 16 diff --git a/home-configuration.scm b/home-configuration.scm index 271bcf93..2e81ed05 100644 --- a/home-configuration.scm +++ b/home-configuration.scm @@ -202,10 +202,27 @@ replacement spec (to which `regexp-substitute/global' is applied)." (provision '(xrdb)) (one-shot? #t) (start #~(lambda _ - ;; TODO: put these files in ~/.config. (invoke #$(package-binary "xrdb") "-merge" - (string-append (getenv "HOME") "/.Xdefaults") - (string-append (getenv "HOME") "/.Xresources"))))) + (string-append (getenv "XDG_CONFIG_HOME") "/X11/Xresources"))))) + + ;; By default, xdotool gets most of "#@\|~()<>[]{} wrong. Make + ;; it use the correct keymap by re-setting the same one again. + (shepherd-service + (documentation "Fix X keyboard map on login; passmenu needs this.") + (provision '(fix-xdotool)) + (one-shot? #t) + (start #~(lambda _ + (use-modules (ice-9 rdelim) + (ice-9 regex) + (ice-9 popen)) + (let ((port (open-pipe* OPEN_READ #$(package-binary "setxkbmap") "-query"))) + (let loop ((line (read-line port))) + (unless (eof-object? line) + (let ((mtch (string-match "^layout:[[:space:]]*" line))) + (if mtch + (system* #$(package-binary "setxkbmap") (match:suffix mtch)) + (loop (read-line port)))))))))) + (shepherd-service (documentation "Set up X displays on login.") (provision '(xorg-setup)) @@ -220,7 +237,12 @@ replacement spec (to which `regexp-substitute/global' is applied)." ;; configures it at 60 Hz, which causes ;; it to briefly turn off every few minutes. "--output" "HDMI-1-1" "--mode" "2560x1440" "--rate" "120.00" - "--right-of" "eDP-1")))))) + "--right-of" "eDP-1") + ;; Set the desktop background picture. Hopefully doing this just after + ;; xrandr works and sets it for both screens. + (invoke #$(package-binary "hsetroot") "-cover" + (string-append (getenv "HOME") + "/pictures/Backgrounds/greece/IMG_20181201_104748_DRO.jpg"))))))) ;; Configuration files for GUI programs in $XDG_CONFIG_HOME. (simple-service @@ -497,7 +519,10 @@ replacement spec (to which `regexp-substitute/global' is applied)." "catppuccin/neomutt/neomuttrc"))) ("lesskey" ,(local-file "lesskey")) ("ranger/rc.conf" ,(local-file "ranger.conf")) - ("X11/XCompose" ,(local-file "XCompose")))) ; see also: $XCOMPOSEFILE variable + ("user-dirs.locale" ,(plain-file "user-dirs.locale" "C")) ; Not sure if this is needed. Arch has it. + ("user-dirs.dirs" ,(local-file "user-dirs.dirs")) + ("X11/XCompose" ,(local-file "XCompose")) ; see also: $XCOMPOSEFILE variable + ("X11/Xresources" ,(local-file "Xresources")))) (simple-service 'terminal-files home-files-service-type diff --git a/user-dirs.dirs b/user-dirs.dirs new file mode 100644 index 00000000..0db0cae3 --- /dev/null +++ b/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/" +XDG_DOWNLOAD_DIR="$HOME/downloads" +XDG_TEMPLATES_DIR="$HOME/" +XDG_PUBLICSHARE_DIR="$HOME/" +XDG_DOCUMENTS_DIR="$HOME/documents" +XDG_MUSIC_DIR="$HOME/music" +XDG_PICTURES_DIR="$HOME/pictures" +XDG_VIDEOS_DIR="$HOME/videos" -- cgit v1.2.3