diff --git a/.config/bash/bashrc b/.config/bash/bashrc index a4d67e7b89051778747cb95267b852fe409a8454..6e9982bf694030cc39b848dc3880738bbcb2edc9 100644 --- a/.config/bash/bashrc +++ b/.config/bash/bashrc @@ -12,9 +12,9 @@ if [[ $- != *i* ]]; then return fi -# [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/bash/bash_aliases" ] \ -# && . "${XDG_CONFIG_HOME:-$HOME/.config}/bash/bash_aliases" -# [ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases" +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/bash/bash_aliases" ] \ + && . "${XDG_CONFIG_HOME:-$HOME/.config}/bash/bash_aliases" +[ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases" # needed for bash_history [ -d "${XDG_STATE_HOME}/bash" ] || mkdir -p "${XDG_STATE_HOME}/bash" diff --git a/.config/cabal/config b/.config/cabal/config new file mode 100644 index 0000000000000000000000000000000000000000..d7eb764c7a28f9ae355a434b567202d50becea18 --- /dev/null +++ b/.config/cabal/config @@ -0,0 +1,237 @@ +-- This is the configuration file for the 'cabal' command line tool. +-- +-- The available configuration options are listed below. +-- Some of them have default values listed. +-- +-- Lines (like this one) beginning with '--' are comments. +-- Be careful with spaces and indentation because they are +-- used to indicate layout for nested sections. +-- +-- This config file was generated using the following versions +-- of Cabal and cabal-install: +-- Cabal library version: 3.8.1.0 +-- cabal-install version: 3.8.1.0 + + +repository hackage.haskell.org + url: http://hackage.haskell.org/ + -- secure: True + -- root-keys: + -- key-threshold: 3 + +-- ignore-expiry: False +-- http-transport: +-- nix: +-- store-dir: +-- active-repositories: +-- local-no-index-repo: +remote-repo-cache: /home/br-arch/.cache/cabal/packages +-- logs-dir: /home/br-arch/.cache/cabal/logs +-- default-user-config: +-- verbose: 1 +-- compiler: ghc +-- cabal-file: +-- with-compiler: +-- with-hc-pkg: +-- program-prefix: +-- program-suffix: +-- library-vanilla: True +-- library-profiling: +-- shared: +-- static: +-- executable-dynamic: False +-- executable-static: False +-- profiling: +-- executable-profiling: +-- profiling-detail: +-- library-profiling-detail: +-- optimization: True +-- debug-info: False +-- build-info: +-- library-for-ghci: +-- split-sections: False +-- split-objs: False +-- executable-stripping: +-- library-stripping: +-- configure-option: +-- user-install: True +-- package-db: +-- flags: +-- extra-include-dirs: +-- deterministic: +-- cid: +-- extra-lib-dirs: +-- extra-lib-dirs-static: +-- extra-framework-dirs: +extra-prog-path: /home/br-arch/.cache/cabal/bin +-- instantiate-with: +-- tests: False +-- coverage: False +-- library-coverage: +-- exact-configuration: False +-- benchmarks: False +-- relocatable: False +-- response-files: +-- allow-depending-on-private-libs: +-- cabal-lib-version: +-- append: +-- backup: +-- constraint: +-- preference: +-- solver: modular +-- allow-older: False +-- allow-newer: False +-- write-ghc-environment-files: +-- documentation: False +-- doc-index-file: $datadir/doc/$arch-$os-$compiler/index.html +-- only-download: False +-- target-package-db: +-- max-backjumps: 4000 +-- reorder-goals: False +-- count-conflicts: True +-- fine-grained-conflicts: True +-- minimize-conflict-set: False +-- independent-goals: False +-- shadow-installed-packages: False +-- strong-flags: False +-- allow-boot-library-installs: False +-- reject-unconstrained-dependencies: none +-- reinstall: False +-- avoid-reinstalls: False +-- force-reinstalls: False +-- upgrade-dependencies: False +-- index-state: +-- root-cmd: +-- symlink-bindir: +build-summary: /home/br-arch/.cache/cabal/logs/build.log +-- build-log: +remote-build-reporting: none +-- report-planning-failure: False +-- per-component: True +-- run-tests: +jobs: $ncpus +-- keep-going: False +-- offline: False +-- lib: False +-- package-env: +-- overwrite-policy: +-- install-method: +installdir: /home/br-arch/.cache/cabal/bin +-- username: +-- password: +-- password-command: +-- builddir: + +haddock + -- keep-temp-files: False + -- hoogle: False + -- html: False + -- html-location: + -- executables: False + -- tests: False + -- benchmarks: False + -- foreign-libraries: False + -- all: + -- internal: False + -- css: + -- hyperlink-source: False + -- quickjump: False + -- hscolour-css: + -- contents-location: + +init + -- interactive: False + -- cabal-version: 3.0 + -- license: + -- extra-doc-file: + -- tests: + -- test-dir: + -- language: Haskell2010 + -- application-dir: app + -- source-dir: src + +install-dirs user + -- prefix: /home/br-arch/.cache/cabal + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +install-dirs global + -- prefix: /usr/local + -- bindir: $prefix/bin + -- libdir: $prefix/lib + -- libsubdir: $abi/$libname + -- dynlibdir: $libdir/$abi + -- libexecdir: $prefix/libexec + -- libexecsubdir: $abi/$pkgid + -- datadir: $prefix/share + -- datasubdir: $abi/$pkgid + -- docdir: $datadir/doc/$abi/$pkgid + -- htmldir: $docdir/html + -- haddockdir: $htmldir + -- sysconfdir: $prefix/etc + +program-locations + -- alex-location: + -- ar-location: + -- c2hs-location: + -- cpphs-location: + -- doctest-location: + -- gcc-location: + -- ghc-location: + -- ghc-pkg-location: + -- ghcjs-location: + -- ghcjs-pkg-location: + -- greencard-location: + -- haddock-location: + -- happy-location: + -- haskell-suite-location: + -- haskell-suite-pkg-location: + -- hmake-location: + -- hpc-location: + -- hsc2hs-location: + -- hscolour-location: + -- jhc-location: + -- ld-location: + -- pkg-config-location: + -- runghc-location: + -- strip-location: + -- tar-location: + -- uhc-location: + +program-default-options + -- alex-options: + -- ar-options: + -- c2hs-options: + -- cpphs-options: + -- doctest-options: + -- gcc-options: + -- ghc-options: + -- ghc-pkg-options: + -- ghcjs-options: + -- ghcjs-pkg-options: + -- greencard-options: + -- haddock-options: + -- happy-options: + -- haskell-suite-options: + -- haskell-suite-pkg-options: + -- hmake-options: + -- hpc-options: + -- hsc2hs-options: + -- hscolour-options: + -- jhc-options: + -- ld-options: + -- pkg-config-options: + -- runghc-options: + -- strip-options: + -- tar-options: + -- uhc-options: diff --git a/.config/emacs/init.org b/.config/emacs/README.org similarity index 98% rename from .config/emacs/init.org rename to .config/emacs/README.org index c4d9699ee84fbc447839f880c46716c102144946..f93599f32704f18a548de0e3cf735fc1e81244c8 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/README.org @@ -160,7 +160,7 @@ Also gives warnings if the directory it is pointing to does not exist. (defun br/getenv-or (env default &optional suppress-warning) "Return the environent variable ENV or DEFAULT. If ENV or DEFAULT is a - file path (i.e. it starts with \\='~/'\\= or \\='/\\=') expand it and + file path (i.e. it starts with \\='~/\\=' or \\='/\\=') expand it and resolve symlinks. If SUPPRESS-WARNING is nil then warnings will appear if the file path @@ -508,7 +508,10 @@ Free keybinding =C-z= ;; frames `(((or (derived-mode . apropos-mode) (derived-mode . helpful-mode) - (derived-mode . help-mode) + ;; occasionally results in emacs spamming new frames + ;; until it crashes. Reproduce with `C-x C-l' when the + ;; function is disabled. + ;; (derived-mode . help-mode) (derived-mode . info-mode) (major-mode . magit-status-mode) (derived-mode . pdf-view-mode)) @@ -523,7 +526,6 @@ Free keybinding =C-z= (side . bottom) (slot . 0))))) - ;; (setq display-buffer-alist nil) #+end_src * COMMENT !! Keybinding Configuration @@ -993,7 +995,7 @@ set up =org-babel-load-languages= for each language you'd like to use. whether to byte-compile the resulting file, when it is saved." (when (string-equal (buffer-file-name) (file-name-concat br/dotfile-dir - ".config" "emacs" "init.org")) + ".config" "emacs" "README.org")) (let ((org-confirm-babel-evaluate nil)) (org-babel-tangle) ;; FIXME: byte compiling causes startup issue due to void @@ -1013,10 +1015,12 @@ set up =org-babel-load-languages= for each language you'd like to use. (setq org-confirm-babel-evaluate nil) :custom-face + (org-block-begin-line ((t (:foreground "#AA9C84")))) + (org-document-info-keyword ((t (:foreground "#AA9C84")))) (org-level-1 ((t (:foreground "#D79921")))) (org-meta-line ((t (:foreground "#BDAE93")))) - (org-document-info-keyword ((t (:foreground "#AA9C84")))) - (org-block-begin-line ((t (:foreground "#AA9C84"))))) + (org-todo ((t (:foreground "#B16286")))) + ) #+end_src @@ -1928,6 +1932,40 @@ Easily setup flycheck for haskell. See [[https://github.com/flycheck/flycheck-ha #+end_src +** Project Managment +[[https://docs.projectile.mx/projectile/index.html][Projectile]] is a more feature complete version of the built-in +=project.el=. + +Some useful key bindings: + +| Key Binding | Command | Note | +|-------------+-------------------------------------+--------------------------------------------| +| =C-c p p= | ~counsel-projectile-switch-project~ | Switch projects | +| =C-c p f= | ~counsel-projectile-find-file~ | like ~find-file~ but project wide | +| =C-c p s r= | ~counsel-projectile-rg~ | Search the project with cli tool ~ripgrep~ | +|-------------+-------------------------------------+--------------------------------------------| + +#+begin_src emacs-lisp + + (use-package projectile + :bind-keymap + ("C-c p" . projectile-command-map) + :custom + (projectile-project-search-path `((,br/projects-dir . 2))) + (projectile-sort-order 'recentf) + (projectile-switch-project-action #'projectile-dired) + :config + (projectile-mode 1)) + + (use-package counsel-projectile + :after projectile + :custom + (counsel-projectile-switch-project-action #'counsel-projectile-switch-project-action-dired) + :config + (counsel-projectile-mode 1)) + +#+end_src + ** Magit [[https://magit.vc/][Magit]] is the best Git interface I've ever used. Common Git operations are easy to execute quickly using Magit's command panel system. @@ -2037,10 +2075,10 @@ other. ;; 'guile' behaves strangely when importing guix modules, so use ;; 'guix repl' instead (geiser-guile-binary '("guix" "repl")) - (geiser-guile-load-path `(,(substitute-in-file-name - "$DOTFILE_DIR/.local/bin/.guix/modules") - ,(substitute-in-file-name - "$DOTFILE_DIR/guix"))) + (geiser-guile-load-path (list + (file-name-concat + br/dotfile-dir ".local" "bin" ".guix" "modules") + (file-name-concat br/dotfile-dir "guix"))) ) #+end_src @@ -2337,11 +2375,12 @@ for =dired-do-compress-to=. ("p" . nil) ;; Key bindings to quickly move to most used directories ;; Personal + ("SPC pp" . #'counsel-projectile-switch-project) + ("SPC pf" . #'counsel-projectile-find-file) ("SPC b" . (lambda () (interactive) (dired (file-name-concat br/dotfile-dir ".local" "bin")))) - ("SPC p" . (lambda () (interactive) (dired br/projects-dir))) ("SPC df" . (lambda () (interactive) (dired br/dotfile-dir))) ("SPC o" . (lambda () (interactive) (dired br/org-dir))) - ("SPC u" . (lambda () (interactive) (dired my-main-usb))) + ("SPC u" . (lambda () (interactive) (dired (file-name-concat br/xdg-documents-dir "mnt")))) ("SPC v" . (lambda () (interactive) (dired (file-name-concat br/xdg-documents-dir "vm-shared")))) ;; XDG Directories ("SPC e" . (lambda () (interactive) (dired user-emacs-directory))) @@ -2872,7 +2911,6 @@ Automatically open/download a url using =browse-url= (builtin). move the point to the downloaded file. ARGS must be a list." - (interactive) (let ((proc-args (append (list (concat "emacs-" program) "*proc-buf*" program diff --git a/.config/emacs/yasnippets/org-mode/blog-entry-settings b/.config/emacs/yasnippets/org-mode/blog-entry-settings index f0c7654eebe4617f26bf8a5a6cb9654855d62c8b..bc02c8e9fb3843a9626e4732c0b8727eaeab9ae0 100644 --- a/.config/emacs/yasnippets/org-mode/blog-entry-settings +++ b/.config/emacs/yasnippets/org-mode/blog-entry-settings @@ -10,4 +10,7 @@ #+PROPERTY: header-args:python :session *natas-python-session* * ${2:Intro} -{{{date([%Y-%m-%d])}}} $0 \ No newline at end of file +{{{date([%Y-%m-%d])}}} $0 + +* Sources +- \ No newline at end of file diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 594f345cadb6bcd5aa7654f45003de71d03aa233..604bac710b847da723020d102032c495a5e61637 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,9 +1,6 @@ ### Source fish aliases and variables ### -# For now always source the extra config files on Arch -if not type -q guix || grep -q arch /etc/os-release - for file in fish_aliases fish_abbreviations theme-env.fish - [ -f $XDG_CONFIG_HOME/fish/$file ] && . $XDG_CONFIG_HOME/fish/$file - end +for file in fish_aliases fish_abbreviations theme-env.fish + [ -f $XDG_CONFIG_HOME/fish/$file ] && . $XDG_CONFIG_HOME/fish/$file end for file in fenv.main.fish fenv.fish set -l function_file ~/.guix-home/profile/share/fish/functions/$file @@ -19,7 +16,7 @@ fish_default_key_bindings ### Colorscheme ### function set_theme --description "Change theme based on argument (light or dark) or $THEME." - if begin; test $THEME = "light"; and ! string match -q 'st-*' $TERM; or test $argv[1] = "light"; end + if begin; test "$THEME" = "light"; and ! string match -q 'st-*' "$TERM"; or test "$argv[1]" = "light"; end # light theme for all terminals except st set --global fish_color_autosuggestion 51699f set --global fish_color_error cc0000 --bold @@ -158,28 +155,28 @@ end # ex: bak file.txt # result: copies file as file.txt.bak function bak --argument filename - cp $filename{,.bak} + cp "$filename"{,.bak} end function ex --description "Expand or extract bundled & compressed files" - set --local ext (echo $argv[1] | awk -F. '{print $NF}') - switch $ext + set --local ext (echo "$argv[1]" | awk -F. '{print $NF}') + switch "$ext" case tar # non-compressed, just bundled - tar -xvf $argv[1] + tar -xvf "$argv[1]" case gz - if test (echo $argv[1] | awk -F. '{print $(NF-1)}') = tar # tar bundle compressed with gzip - tar -zxvf $argv[1] + if test (echo "$argv[1]" | awk -F. '{print $(NF-1)}') = tar # tar bundle compressed with gzip + tar -zxvf "$argv[1]" else # single gzip - gunzip $argv[1] + gunzip "$argv[1]" end case tgz # same as tar.gz - tar -zxvf $argv[1] + tar -zxvf "$argv[1]" case bz2 # tar compressed with bzip2 - tar -jxvf $argv[1] + tar -jxvf "$argv[1]" case rar - unrar x $argv[1] + unrar x "$argv[1]" case zip - unzip $argv[1] + unzip "$argv[1]" case '*' echo "unknown extension '$ext'" end diff --git a/.config/fish/fish_abbreviations b/.config/fish/fish_abbreviations index 74d90352b31e4aab148d0ff351aa4b8c1ee1f061..c5ee729288475d92ccc8da2c1733b674f117273d 100644 --- a/.config/fish/fish_abbreviations +++ b/.config/fish/fish_abbreviations @@ -6,7 +6,7 @@ abbr -a ... 'cd ../../' # Personal abbr -a .b 'cd $MY_BIN_DIR/' abbr -a .p 'cd $MY_PROJECTS_DIR/' -abbr -a .df 'cd $MY_PROJECTS_DIR/dotfiles/' +abbr -a .df 'cd $DOTFILE_DIR' abbr -a .u 'cd $MY_MAIN_USB/' abbr -a .v 'cd $XDG_DOCUMENTS_DIR/vm-shared/' # XDG Directories diff --git a/.config/river/init b/.config/river/init index cde3e18311156d9964162b0b6fcd7333fdcc6550..2760532461664fb0d8c7f1c3c0c7552680a2dda0 100755 --- a/.config/river/init +++ b/.config/river/init @@ -1,18 +1,17 @@ #!/usr/bin/env sh modkey=Super -riverctl map normal $modkey C spawn "emacsclient -c -a '' -e '(vterm)'" +emacs='emacsclient --create-frame --alternate-editor=""' +riverctl map normal $modkey C spawn "foot" riverctl map normal $modkey B spawn firefox -riverctl map normal $modkey D spawn "emacsclient -c -a '' -e '(dired \"~/documents\")'" -riverctl map normal $modkey Y spawn "emacsclient -c -a '' -e '(info)'" +riverctl map normal $modkey D spawn "$emacs -e '(dired \"~/documents\")'" +riverctl map normal $modkey Y spawn "$emacs -e '(info)'" riverctl map normal $modkey R spawn "bemenu-run -p 'RUN:'" riverctl map normal $modkey S spawn "dmenu-conf-edit" riverctl map normal $modkey+Shift X spawn "swaylock" riverctl map normal $modkey P spawn "\ - emacsclient --create-frame \ - --alternate-editor='' \ - --eval '(find-file (concat (getenv \"ORG_DIR\") \"/tasks.org\"))' \ - --eval '(let ((split-width-threshold 50)) (org-agenda nil \"A\"))'" + $emacs --eval '(find-file (concat (getenv \"ORG_DIR\") \"/tasks.org\"))' \ + --eval '(let ((split-width-threshold 50)) (org-agenda nil \"A\"))'" # Super+Q to close the focused view riverctl map normal $modkey+Shift C close diff --git a/.config/vimium-c/vimium-c.json b/.config/vimium-c/vimium-c.json index 83ac4a22d3d173e8642505d6f1fca018ba640df8..c8ca48b278416e39db7048833224759d11ed15ed 100644 --- a/.config/vimium-c/vimium-c.json +++ b/.config/vimium-c/vimium-c.json @@ -1,11 +1,11 @@ { "name": "Vimium C", - "@time": "1/8/2024, 10:15:47 AM", - "time": 1704705347175, + "@time": "3/19/2024, 8:30:40 AM", + "time": 1710833440335, "environment": { "extension": "1.99.997", "platform": "linux", - "firefox": 121 + "firefox": 123 }, "autoDarkMode": 1, "exclusionRules": [ @@ -64,6 +64,7 @@ "wib: https://wiby.me/?q=%s Wiby", "y|yt: https://www.youtube.com/results?search_query=%s \\", " blank=https://www.youtube.com/ YouTube", + "yy: https://www.youtube.com/@%s", "o: https://odysee.com/$/search?q=%s \\", " blank=https://odysee.com/ Odysee", "a: https://wiki.archlinux.org/index.php?search=%s \\", diff --git a/.config/zsa/moonlander_colemak_l7V9M_rpvAl.bin b/.config/zsa/moonlander_colemak_l7V9M_rpvAl.bin new file mode 100644 index 0000000000000000000000000000000000000000..6c01a63a70a5ff03eb8a8e525128d29b74cef10b Binary files /dev/null and b/.config/zsa/moonlander_colemak_l7V9M_rpvAl.bin differ diff --git a/.librewolf/profiles.ini b/.librewolf/profiles.ini new file mode 100644 index 0000000000000000000000000000000000000000..e5447482bfcb54d987572efc6bcc8dfc687bbf58 --- /dev/null +++ b/.librewolf/profiles.ini @@ -0,0 +1,10 @@ +[Profile0] +Name=default +IsRelative=1 +Path=ywwfrnjc.default +Default=1 + +[General] +StartWithLastProfile=1 +Version=2 + diff --git a/.local/bin/README.org b/.local/bin/README.org index e7290c8613735bcc0e4d8242447975a1ed91999a..5cf3e2135d1fd0ea6425c77808912f9f91720371 100644 --- a/.local/bin/README.org +++ b/.local/bin/README.org @@ -32,13 +32,27 @@ This is a full list of dependencies to run all of my scripts. Inside script each script there is also a list of dependencies should you wish to only use a subset of them. +#+begin_src scheme :results value list :exports results + ;; set ~(setq geiser-guile-binary '("guix" "repl"))~ to make the code + ;; block execute properly. + ;; + ;; geiser-guile-load-path must contain the `my-scripts' module + + (use-modules (guix packages)) + (use-modules (guix build-system python)) + (use-modules (my-scripts)) + + (map car (package-propagated-inputs my-scripts)) +#+end_src + +#+RESULTS: - curl - dash - ffmpeg - gawk - gnupg - grep -- guile-3.0-latest +- guile - mpv - python - python-requests @@ -47,21 +61,6 @@ wish to only use a subset of them. - wget - yt-dlp -** COMMENT Auto Find All Dependencies -Gitlab for some reason does not display the results of org source -block correctly, so manually remove the #+RESULTS: line. - -#+begin_src scheme :results value list - ;; set ~(setq geiser-guile-binary '("guix" "repl"))~ to make the code - ;; block execute properly. - - (use-modules (guix packages)) - (use-modules (guix build-system python)) - (use-modules (my-scripts)) - - (map car (package-propagated-inputs my-scripts)) -#+end_src - * Guix If you use [[https:guix.gnu.org][Gnu Guix]] you can use ~guix install my-scripts~ to install all my scripts and its dependencies. This requires the following steps: diff --git a/.local/bin/dmenu-choose-dir b/.local/bin/dmenu-choose-dir index ff079f5eceb1883b03526c058aa24519e4344509..c2d1d9e145d266d07e4e806012b9d0e787d7e5a3 100755 --- a/.local/bin/dmenu-choose-dir +++ b/.local/bin/dmenu-choose-dir @@ -39,6 +39,6 @@ choose_dir() { # Usage: choose_dir [ search depth ] [ paths ] [ prompt ] return } -[ "$#" -e 3 ] && { usage; exit 1; } +[ "$#" -ne 3 ] && { usage; exit 1; } choose_dir "$1" "$2" "$3" && echo "$dir" exit diff --git a/.local/bin/dmenu-mount b/.local/bin/dmenu-mount index d7018fb5a9728722ff9ceae775a2eea256c6a166..d22994934f56873716180db1cf159a084ddab009 100755 --- a/.local/bin/dmenu-mount +++ b/.local/bin/dmenu-mount @@ -42,7 +42,7 @@ choose_dev() { # Usage: choose_dev [ m(ount) | u(mount) ] "Dmenu prompt" # shellcheck disable=SC2086 dev=$(lsblk -lo NAME,SIZE,TYPE,MOUNTPOINTS \ | case "$1" in - -m) awk '/part $/ { print $1" ("$2")" }' ;; + -m) awk '/part +$/ { print $1" ("$2")" }' ;; -u) awk '/\/mnt/ || /\/home\// { print $1" ("$2")" }' ;; * ) echo "Wrong argument: $1, for choose_dev()" >&2 && return 1 esac \ @@ -57,11 +57,11 @@ mount_dev() { # Usage: [ mount | umount ] [ --all | $dev | -o $mopt $dev $dir ] msg="$(${SUDO} $1 $2 2>&1)" res="$?" case "$1 $2" in - "mount /dev/"*) [ "${res}" != 0 ] && return 1 ;; + "mount /dev/"*) [ "${res}" -ne 0 ] && return 1 ;; * ) esac notify_pp "${res}" "${dev}" "$1" "${msg}" - return + return 0 } case "$1" in diff --git a/.local/bin/gnupg-backup b/.local/bin/gnupg-backup index 1c18ee48690790ac271c7beab4401ce9adcf64e2..509146be552e4e9b8c0c703d022e0bd6ae7ae0ce 100755 --- a/.local/bin/gnupg-backup +++ b/.local/bin/gnupg-backup @@ -5,6 +5,9 @@ # # Dependencies: # - gnupg +# +# TODO: +# - test export of only secret subkeys set -ex @@ -24,52 +27,82 @@ EOF case "$1" in e|export) - backup_dir=gnupg-backup-"$(date '+%Y%m%d')" + echo 'Export subkeys only? (y/N): ' + read -r subkeyonly_p + + if [ "${subkeyonly_p}" = y ]; then + export_keys_option='--export-secret-subkeys' + backup_dir=gnupg-backup-subkeysonly-"$(date '+%Y%m%d_%H%M%S')" + else + export_keys_option='--export-secret-keys' + backup_dir=gnupg-backup-full-"$(date '+%Y%m%d_%H%M%S')" + fi + + [ x"${export_keys_option}" = x ] \ + || [ x"${backup_dir}" = x ] \ + && exit 4 + + cd ~ || exit 3 mkdir "${backup_dir}" || exit 1 - gpg --list-secret-keys - echo 'Which uid to backup: ' - read -r uid - # echo 'Do you want to backup the public key ring [y/n]: ' - # read -r backup_pubring cd "${backup_dir}" || exit 3 - gpg --output private-key.asc \ - --export-options backup \ - --export-secret-keys \ - --armor \ - "${uid}" + + while true; do + gpg --list-secret-keys + echo 'Which uid to backup (or "q" to finish): ' + read -r uid + + [ "${uid}" = q ] && break + + gpg --output private-key-"${uid}".asc \ + --export-options backup \ + "${export_keys_option}" \ + --armor \ + "${uid}" + + fingerprint="$(gpg --fingerprint --keyid-format long "${uid}" \ + | awk -F= '/Key/ { gsub(/[[:blank:]]/, "", $2); print $2 }')" + # consider backing up entire openpgp-revocs.d directory + gpg --gen-revoke --armor --output "${fingerprint}.rev" "${uid}" + done + gpg --export-ownertrust > otrust.txt gpg --output public-keys.asc \ --export \ - --armor \ - --keyring "${GNUPGHOME}"/pubring.gpg - cp "${GNUPGHOME}"/gpg.conf . - fingerprint="$(gpg --fingerprint --keyid-format long "${uid}" \ - | awk -F= '/Key/ { gsub(/[[:blank:]]/, "", $2); print $2 }')" - # consider backing up entire openpgp-revocs.d directory - gpg --gen-revoke --armor --output "${fingerprint}.rev" "${uid}" + --armor + + [ -f "${GNUPGHOME}"/gpg.conf ] && cp "${GNUPGHOME}"/gpg.conf . + [ -f "${GNUPGHOME}"/gpg-agent.conf ] && cp "${GNUPGHOME}"/gpg-agent.conf . + [ -f "${GNUPGHOME}"/sshcontrol ] && cp "${GNUPGHOME}"/sshcontrol . + cd .. || exit 3 gpgtar --output "${backup_dir}".gpg \ - --encrypt \ --symmetric \ --gpg-args '--cipher-algo AES256 --s2k-digest-algo SHA512 --s2k-count 65536 --armor' \ "${backup_dir}" ;; i|import) - [ -f "${2}" ] || { usage; exit 2; } - # num="$(find . -maxdepth 1 -type d -name '*_.+_')" + [ -f "${2}" ] \ + || { echo 'Import expects a gpg encrypted tar archive as argument.' + usage; exit 2; } + output_dir="${2%.gpg}" + mkdir -pv "${output_dir}" || exit 1 gpgtar --directory "${output_dir}" --decrypt "${2}" backup_dir="$(find "${output_dir}" -mindepth 1 -maxdepth 1 -type d)" cd "${backup_dir}" || exit 3 + gpg --import public-keys.asc - gpg --import-options restore --import private-key.asc + gpg --import-options restore --import private-key-*.asc gpg --import-ownertrust < otrust.txt mkdir -pv "${GNUPGHOME}"/openpgp-revocs.d \ - && cp *.rev "${GNUPGHOME}"/openpgp-revocs.d - cp gpg.conf "${GNUPGHOME}" + && cp *.rev "${GNUPGHOME}"/openpgp-revocs.d + + [ -f gpg.conf ] && cp gpg.conf "${GNUPGHOME}" + [ -f gpg-agent.conf ] && cp gpg-agent.conf "${GNUPGHOME}" + [ -f sshcontrol ] && cp sshcontrol "${GNUPGHOME}" ;; - *) usage; exit 4; ;; + ,*) usage; exit 4; ;; esac exit diff --git a/.local/bin/xset-keys-touchpad b/.local/bin/xset-keys-touchpad index c114ee94a89d6d380400d328a4d105d302b1f7b9..921d85c64fb1b78c4803fb2b439559f4fbe98f6c 100755 --- a/.local/bin/xset-keys-touchpad +++ b/.local/bin/xset-keys-touchpad @@ -9,7 +9,11 @@ # increase key repeat delay and rate xset r rate 240 60 +setxkbmap -option caps:ctrl_modifier # Caps := Ctrl # Find the name/id of the touchpad with 'xinput list' and 'xinput list-props # ' for all properties xinput set-prop 'DELL098F:00 04F3:311C Touchpad' 'libinput Tapping Enabled' 1 xinput set-prop 'DELL098F:00 04F3:311C Touchpad' 'libinput Accel Speed' .5 + +# Disable touchpad entirely +# xinput set-prop 'DELL098F:00 04F3:311C Touchpad' 'Device Enabled' 0 diff --git a/.profile b/.profile index 413988fdc1e69347a94d1601d0201a9a30ac57f9..ed2e50150eec2bbb9eee241b37a4abdce2384974 100644 --- a/.profile +++ b/.profile @@ -36,7 +36,7 @@ export XDG_DESKTOP_DIR="$XDG_DOCUMENTS_DIR/desktop" export XDG_DOWNLOAD_DIR="$XDG_DOCUMENTS_DIR/downloads" export XDG_MUSIC_DIR="$XDG_DOCUMENTS_DIR/media/music" export XDG_PICTURES_DIR="$XDG_DOCUMENTS_DIR/media/pictures" -export XDG_VIDEOS_DIR="$XDG_DOCUMENTS_DIR/videos" +export XDG_VIDEOS_DIR="$XDG_DOCUMENTS_DIR/media/videos" # XDG Base Directories export XDG_CACHE_HOME="$HOME/.cache" # Analagous to /var/cache @@ -57,7 +57,7 @@ export ORG_DIR="$XDG_DOCUMENTS_DIR/org" export SUCKLESS_DIR="$HOME/.local/suckless" export BR_MAIL_DIR="${XDG_DOCUMENTS_DIR}/mail" # Software -export BROWSER='librewolf' +export BROWSER='firefox' export DMENU='dmenu -i' export EDITOR='emacsclient --create-frame --alternate-editor=' export SHELL='/bin/fish' @@ -67,7 +67,7 @@ export THEME='dark' ### Software Settings # Exa theming -export EXA_COLORS='da=37:di=36:ex=38;5;76' # file types +export EXA_COLORS='da=38;5;67:di=38;5;148:ex=38;5;76:ln=38;5;72:lp=38;5;148' # file types export EXA_COLORS="$EXA_COLORS:ur=38;5;220:uw=38;5;160:ux=38;5;76:ue=38;5;76" # permission bits export EXA_COLORS="$EXA_COLORS:sn=38;5;76:sb=38;5;76" # file size export EXA_COLORS="$EXA_COLORS:uu=38;5;220:un=38;5;214:gu=38;5;220:gn=38;5;214" # users and groups diff --git a/README.org b/README.org index 575e7d589ba6ccdb82a57042f26477693fbe01fb..f7f348190ea6243e2bd8bc37d917a65134d64f75 100644 --- a/README.org +++ b/README.org @@ -1,10 +1,10 @@ * Dotfiles This repo is a collection of my dotfiles. They should work on any Unix -based OS and are used by me on Artix. The most note worthy configs are: -- =awesomewm=, --- Window manager +based OS and are used by me on Arch and Gnu Guix. These days most of +my configuration is in =Guix= and =Emacs=. +- =river=, --- Wayland compositor - =bash=, =fish= --- Shells - =(n)vim= --- Editor -- =vifm= --- File manager - =emacs= --- Productivity environment - And many other (mostly terminal) programs. There are also lots of usefull scripts in =.local/bin=. diff --git a/guix/br/home/services/README.org b/guix/br/home/services/README.org index b2ec7e63c97421daae59c9b9245ceb6684e1a038..938d20feac213d560589f74e26735764c1701c62 100644 --- a/guix/br/home/services/README.org +++ b/guix/br/home/services/README.org @@ -2,7 +2,7 @@ #+SUBTITLE: README #+AUTHOR: Bryan Rinders #+DATE: <2023-12-24> -#+OPTIONS: ^:{} toc:t num:t +#+OPTIONS: ^:{} toc:t num:t todo:t #+PROPERTY: header-args :export results :eval no-export * TODO how to manage manifests @@ -31,17 +31,18 @@ - [X] switch from ~extend-bash?~ to using ~extend-shells~. - [X] rename module to something more abstract (multi-shell) - [ ] write extension functionality for this service type -** [2/3] xdg.scm +** [2/2] xdg.scm - [X] add ~extend-shells~ to selectively extend shells - [X] rename functions -- [ ] provide the ~​/.guile as a ~plain-file~ and use +- [\] CANCELED provide the ~​/.guile as a ~plain-file~ and use xdg-config-files-service-type to store it in =.config/guile/guile=. + Note: will like also require dependencies readline and some others. -** write my own xdg user directories service type +** DONE write my own xdg user directories service type should simple create the environment variables -** emacs keybindings + +** TODO emacs keybindings #+begin_src emacs-lisp (keymap-set dired-mode-map @@ -53,12 +54,10 @@ should simple create the environment variables "SPC d m" (lambda () (interactive) (dired (getenv "XDG_CONFIG_HOME")))) #+end_src -** emacs config files +** DONE emacs config files recursively add config files to xdg config home ** DONE emacs dependencies -CLOSED: [2023-12-26 Tue 19:26] -- State "DONE" from [2023-12-26 Tue 19:26] e.g. when field ~vterm #t~ then install cmake, libvterm, etc. ** [1/1] password-store service type - [X] create service type in =password-utils.scm= @@ -66,11 +65,11 @@ e.g. when field ~vterm #t~ then install cmake, libvterm, etc. + environment variable + extend profile-service-type + list of extensions for pass (e.g. pass-otp, passmenu) -** mail? +** [0/1] mail? - [ ] create service type - should configure + mbsync -** desktop +** [0/1] desktop - [ ] create service type - should have fields + app-launcher diff --git a/guix/br/home/services/xdg.scm b/guix/br/home/services/xdg.scm index cbb662ed47425b07d7f6018bb302cff3dfc9f171..afd58be3ab048f7888cd6f86a5cb8331375641c4 100644 --- a/guix/br/home/services/xdg.scm +++ b/guix/br/home/services/xdg.scm @@ -25,7 +25,6 @@ ;;; ;;; TODO: when pacman.scm has configuration extension setup, use it. ;;; -;;; TODO: how to know which shells get aliases ;;; ;;; Code: @@ -46,12 +45,16 @@ ("CABAL_DIR" . "$XDG_CACHE_HOME/cabal") ;Haskell ("CARGO_HOME" . "$XDG_DATA_HOME/cargo") ;Rust ("GHCUP_USE_XDG_DIRS" . "True") ;Haskell - ("GNUPGHOME" . "$XDG_DATA_HOME/gnupg") + ;; TODO: wait for home-gpg-agent-service-type to respect the environment + ;; variable. + ;; ("GNUPGHOME" . "$XDG_DATA_HOME/gnupg") ("GTK2_RC_FILES" . "$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0") ("GUILE_HISTORY" . "$XDG_CACHE_HOME/guile/guile_history") ("HISTCONTROL" . "ignoredups:erasedups") ("HISTFILE" . "$XDG_CACHE_HOME/bash/history") ("JUPYTER_CONFIG_DIR" . "$XDG_CONFIG_HOME/jupyter") + ("NODE_REPL_HISTORY" . "$XDG_DATA_HOME/node_repl_history") + ("STACK_XDG" . "1") ("VIMINIT" . "source $XDG_CONFIG_HOME/nvim/init.vim") ("WGETRC" . "$XDG_CONFIG_HOME/wget/wgetrc") ("_JAVA_OPTIONS" . "-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java") @@ -143,6 +146,7 @@ variables and shell aliases."))) ;;; xdg user directories ;;; +;; Overwrite the default behaviour because I don't like it. (define-configuration home-xdg-user-directories-configuration (desktop (string "$HOME/Desktop") diff --git a/guix/br/manifests/devel.scm b/guix/br/manifests/devel.scm index 6defba14e700ce0cc916b11efb58198e625845da..dee23a5d8a7d299305103a24f58202e3e271b775 100644 --- a/guix/br/manifests/devel.scm +++ b/guix/br/manifests/devel.scm @@ -3,6 +3,7 @@ base commencement curl + man version-control wget ) @@ -14,6 +15,9 @@ gcc-toolchain git + man-pages + man-pages-posix + curl wget )) diff --git a/guix/br/manifests/manifest.scm b/guix/br/manifests/manifest.scm deleted file mode 100644 index 1563a9cfb57689373fa87885e4773ed6dae7cde9..0000000000000000000000000000000000000000 --- a/guix/br/manifests/manifest.scm +++ /dev/null @@ -1,15 +0,0 @@ -(specifications->manifest - '( - "cmake" - - "fontconfig" - "glibc-locales" - - "isc-dhcp" - - "python-matplotlib" - "python-numpy" - "python-pandas" - "python-scikit-learn" - "python-scipy" - )) diff --git a/guix/home.scm b/guix/home.scm index 1bc24e7fa34a6e31eb085d6a18664462e9149ace..3faef3d23b611c9c47bb6287dc4c28abb149186d 100644 --- a/guix/home.scm +++ b/guix/home.scm @@ -22,6 +22,7 @@ ((channel-b packages fonts) #:prefix br:) ((channel-b packages gnome-xyz) #:prefix br:) ((channel-b packages hunspell) #:prefix br:) + ((channel-b packages password-utils) #:prefix br:) ((channel-b packages wallpapers) #:prefix br:) ((channel-b packages yambar) #:prefix br:) (gnu home services desktop) @@ -181,15 +182,16 @@ (editor "emacsclient --create-frame --alternate-editor="))) (service br:home-exa-service-type (br:home-exa-configuration - (exa-colors (string-append - "ur=38;5;220:uw=38;5;160:ux=38;5;76:ue=38;5;76" ;permission bits - ":sn=38;5;76:sb=38;5;76" ;file size - ":uu=38;5;220:un=38;5;214" ;users - ":gu=38;5;220:gn=38;5;214" ;groups - ":da=38;5;37" ;date - ":di=36:ex=38;5;76" ;file types - ;; file type extensions - ":*.mp3=38;5;105")) + (exa-colors (string-join + '("ur=38;5;220" "uw=38;5;160" "ux=38;5;76" "ue=38;5;76" ;permission bits + "sn=38;5;76" "sb=38;5;76" ;file size + "uu=38;5;220" "un=38;5;214" ;users + "gu=38;5;220" "gn=38;5;214" ;groups + "da=38;5;67" ;date + "di=38;5;148" "ex=38;5;76" "ln=38;5;72" "lp=38;5;148" ;file types + ;; file type extensions + "*.mp3=38;5;105") + ":")) (extend-shells '(bash fish)) (aliases `(("ll" . ,(file-append eza "/bin/eza" @@ -199,7 +201,11 @@ (service br:home-firefox-service-type (br:home-firefox-configuration (profile ".mozilla/firefox/ywwfrnjc.default") - (userchrome `(("user.js" . ,(in-vicinity dotfiles-directory + (userchrome `(;; `../` little hack to get `profiles.ini` in the + ;; directory above the profile + ("../profiles.ini" . ,(in-vicinity dotfiles-directory + ".librewolf/profiles.ini")) + ("user.js" . ,(in-vicinity dotfiles-directory ".librewolf/user.js")) ("chrome/userChrome.css" . ,(in-vicinity dotfiles-directory @@ -211,6 +217,7 @@ (service br:home-password-store-service-type ;; TODO: should depend on gpg service type (br:home-password-store-configuration + (package br:br-pass) ;uses `bemenu` in `passmenu` (extensions (list pass-otp)) (password-store-dir "${XDG_DOCUMENTS_DIR}/pass"))) (service br:home-multi-shell-aliases-service-type @@ -295,6 +302,10 @@ (branch "testing") (url "https://gitlab.com/bryanrinders/channel-b")) )) + ;; (service home-files-service-type + ;; ;; for some reason guix cannot find the .nix-channels file + ;; `((".nix-channels" ,(in-vicinity dotfiles-directory ".nix-channels")) + ;; )) (service home-xdg-configuration-files-service-type (map (lambda (arg) (apply br:xdg-config-files-symlink-target arg)) diff --git a/guix/system.scm b/guix/system.scm index be43718995f37e9114d6b647b8dd89e0319d8386..7b6a33dfdc133b85772dd543b356b12116c1d436 100644 --- a/guix/system.scm +++ b/guix/system.scm @@ -1,5 +1,6 @@ (use-modules (gnu) + (guix packages) (nongnu packages linux) (nongnu system linux-initrd) ) @@ -144,9 +145,16 @@ and `FS-TYPE' can be found with blkid." nss-certs ntfs-3g openssh + pam-gnupg pulseaudio tlp - %base-packages)) + ;; remove unwanted packages from %base-packages + (filter (lambda (base-package) + (not (member (package-name base-package) + '("mg" "nano" "nvi" ;editors + "wireless-tools" ;deprecated + )))) + %base-packages))) ;; Below is the list of system services. To search for available ;; services, run 'guix system search KEYWORD' in a terminal. @@ -221,6 +229,9 @@ and `FS-TYPE' can be found with blkid." ;; https://mail.gnu.org/archive/html/help-guix/2021-08/msg00089.html (service xorg-server-service-type) (modify-services %base-services + ;; use custom login service with pam-gpg enabled, defined in + ;; pam-services + (delete login-service-type) (udev-service-type config => (udev-configuration (inherit config) @@ -240,6 +251,15 @@ and `FS-TYPE' can be found with blkid." (settings (append '( ; reduce console logging ("kernel.printk" . "0 4 0 4")) %default-sysctl-settings))))))) + (pam-services (cons + ;; add pam-gpg to the default settings of + ;; `login-service-type' + (unix-pam-service "login" + #:login-uid? #t + #:allow-empty-passwords? #f + #:motd "Hello!" + #:gnupg? #t) + (base-pam-services))) (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets (list "/boot/efi")) @@ -299,8 +319,11 @@ and `FS-TYPE' can be found with blkid." ;; 'fat32)) (type "vfat")) ;; usb devices that will appear in /etc/fstab - (br/usb-file-system "Elements" "/elements" "ntfs") - (br/usb-file-system "KOBOeReader" "/ereader" "vfat") - (br/usb-file-system "USB_SANDISK" "/sandisk" "vfat") - (br/usb-file-system "VERBATIM" "/verbatim" "vfat") + (br/usb-file-system "Elements" "/elements" "ntfs") + (br/usb-file-system "Elements2" "/elements2" "vfat") + (br/usb-file-system "KOBOeReader" "/ereader" "vfat") + (br/usb-file-system "SANDISK_2" "/sandisk2" "vfat") + (br/usb-file-system "SANDISK_3" "/sandisk3" "vfat") + (br/usb-file-system "USB_SANDISK" "/sandisk" "vfat") + (br/usb-file-system "VERBATIM" "/verbatim" "vfat") %base-file-systems)))