From 682d5e8c818b766724de95bb313ab49406fc35b4 Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Tue, 26 Mar 2024 17:21:58 -0300 Subject: [PATCH] home-environments: radio: Various changes, forgot about commiting --- home-environments/radio.scm | 99 ++++++++++++++----- .../fish/conf.d/fish_custom_functions.fish | 6 +- 2 files changed, 75 insertions(+), 30 deletions(-) diff --git a/home-environments/radio.scm b/home-environments/radio.scm index 96a4494..f80a9a4 100644 --- a/home-environments/radio.scm +++ b/home-environments/radio.scm @@ -37,7 +37,6 @@ #:use-module (gnu packages suckless) #|T|# #:use-module (gnu packages telegram) #:use-module (gnu packages terminals) - #:use-module (gnu packages text-editors) #:use-module (gnu packages tor-browsers) #:use-module (gnu packages toys) #|V|# #:use-module (gnu packages version-control) @@ -69,7 +68,9 @@ #|Radix packages|# #|D|# #:use-module (radix packages disk) #|I|# #:use-module (radix packages image-viewers) - #|F|# #:use-module (radix packages fonts) + #|F|# #:use-module (radix packages freedesktop) + #:use-module (radix packages fonts) + #|P|# #:use-module (radix packages pdf) #|S|# #:use-module (radix packages seninha) #:use-module (radix packages syndication) #|T|# #:use-module (radix packages toys) @@ -80,7 +81,23 @@ #|G|# #:use-module (radix home services gnupg) #|S|# #:use-module (radix home services shells) - #:export (home-environment)) + #:export (home-environment + browser + editor + pager + reader + shell + terminal + wm)) + +#|Default applications|# +(define browser "mullvadbrowser") +(define editor "kak") +(define pager "less") +(define reader "sioyek") +(define shell "fish") +(define terminal "foot") +(define wm "river") (define home-environment (user-home-environment @@ -97,6 +114,7 @@ font-juliamono font-liberation font-meslo-lg-dz font-misc-misc font-un font-wqy-zenhei #|freedesktop |# xdg-utils xdg-desktop-portal xdg-desktop-portal-wlr + xdg-terminal-exec #|games |# minetest supertuxkart xonotic #|gnome |# adwaita-icon-theme #|gnu-doc |# gnu-standards @@ -107,7 +125,7 @@ #|linux |# wireplumber #|math |# libqalculate #|password-utils|# keepassxc - #|pdf |# poppler sioyek + #|pdf |# poppler sioyek/wayland #|pulseaudio |# pamixer pavucontrol #|scheme |# sicp #|seninha |# fmutils @@ -119,7 +137,7 @@ #|toys |# wayneko #|vesion-control|# git #|video |# ffmpeg ffmpegthumbnailer mpv yt-dlp - #|wm |# fnott rivercarro swww waybar + #|wm |# fnott rivercarro riverguile river-bnf swww waybar #|xdisorg |# fuzzel wl-clipboard wlsunset #|zig-xyz |# river)) @@ -138,6 +156,15 @@ (service home-xdg-mime-applications-service-type (home-xdg-mime-applications-configuration + (desktop-entries + (list (xdg-desktop-entry + (name "foot") + (file "org.codeberg.dnkl.foot.desktop") + (type 'application) + (config `((exec . "foot") + (terminal . "true") + (exec-arg . "") + (startup-wm-class . "foot")))))) (default (associate-right ('mullvadbrowser.desktop `("text/html" @@ -290,7 +317,7 @@ #|Code areas|# ((symbol-prefix-proc '~/areas/code/scm/) - '(guix radix zero)) + '(guix misako radix riverguile saayix zero)) #|Radix|# ((partial @radix '/radix/) @@ -312,20 +339,35 @@ (a . "aria2c -j 10 '%'") (i . "ipfs get %") (m . "yt-dlp --prefer-free-formats -x '%'") - (v . "yt-dlp --prefer-free-formats '%'") - (z . "curl -F file=@% https://0x0.st | xsel -b"))) + (u . "curl -F file=@% https://0x0.st | wl-copy") + (v . "yt-dlp --prefer-free-formats '%'"))) + + #|Shell history|# + ,@(list (abbreviation + (name "!!") + (pattern "[^\\']*!!.*") + (position 'anywhere) + (expansion + (fish-function "bang-bang"))) + (abbreviation + (name "!$") + (pattern "[^\\']*!\\$.*") + (position 'anywhere) + (expansion + (fish-function "bang-dollar"))) + (abbreviation + (name "!*") + (pattern "[^\\']*!\\*.*") + (position 'anywhere) + (expansion + (fish-function "bang-star")))) ,@(map (match-lambda ((x . y) (abbreviation (name x) (position 'anywhere) (expansion y)))) - `(#|Shell history|# - (!! . ,(fish-function "bang-bang")) - (!$ . ,(fish-function "bang-dollar")) - (!* . ,(fish-function "bang-star")) - - #|Guix|# + `(#|Guix|# (!dgen . "guix % delete-generations 2w") (!repair . "doas guix build --repair") (!pull . "guix pull") @@ -342,13 +384,13 @@ (:todo . ,(edit "~/areas/meta/todo"))))))))) #|Environment variables services|# - (simple-service 'shell-environment-variables + (simple-service 'home-shell-environment-variables home-environment-variables-service-type `(("PATH" . "$HOME/.local/bin:$PATH") ("ENV" . "$XDG_CONFIG_HOME/dash/init.sh") ("INPUTRC" . "$XDG_CONFIG_HOME/readline/inputrc") ("XINITRC" . "$XDG_CONFIG_HOME/x11/xinitrc"))) - (simple-service 'guile-environment-variables + (simple-service 'home-guile-environment-variables home-environment-variables-service-type `(("GUILE_WARN_DEPRECATED" . "detailed") ("GUILE_HISTORY" . "$XDG_CACHE_HOME/guile/history") @@ -363,22 +405,25 @@ '($HOME/.guix-home/profile $XDG_CONFIG_HOME/guix/current /run/current-system/profile))))) - (simple-service 'language-environment-variables + (simple-service 'home-wayland-environment-variables + home-environment-variables-service-type + `(("QT_QPA_PLATFORM" . "wayland;xcb") + ("QT_WAYLAND_DISABLE_WINDOWDECORATION" . "1"))) + (simple-service 'home-language-environment-variables home-environment-variables-service-type `(("LANG" . "en_US.UTF-8") ("LANGUAGE" . "en_US.UTF-8") ("LC_COLLATE" . "C"))) - (simple-service 'defaut-applications-environment-variables + (simple-service 'home-default-applications-environment-variables home-environment-variables-service-type - `(("BROWSER" . "mullvadbrowser") - ("EDITOR" . "kak") - ("FCEDIT" . "kak") - ("PAGER" . "less") - ("READER" . "sioyek") - ("SHELL" . "fish") - ("TERMINAL" . "foot") - ("VISUAL" . "kak") - ("WM" . "awesome"))) + `(("BROWSER" . ,browser) + ("EDITOR" . ,editor) + ("PAGER" . ,pager) + ("READER" . ,reader) + ("SHELL" . ,shell) + ("TERMINAL" . ,terminal) + ("VISUAL" . ,editor) + ("WM" . ,wm))) #|SSH service|# (service home-openssh-service-type diff --git a/home-environments/radio/files/.config/fish/conf.d/fish_custom_functions.fish b/home-environments/radio/files/.config/fish/conf.d/fish_custom_functions.fish index 9724080..b265b5a 100644 --- a/home-environments/radio/files/.config/fish/conf.d/fish_custom_functions.fish +++ b/home-environments/radio/files/.config/fish/conf.d/fish_custom_functions.fish @@ -5,7 +5,7 @@ function xdg-user-directory end function bang-bang - echo "$history[1]" + string replace '!!' "$history[1]" $argv[1] end function bang-bang-k @@ -16,10 +16,10 @@ end function bang-dollar set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1]) - echo $arr[-1] + string replace '!$' "$arr[-1]" $argv[1] end function bang-star set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1]) - echo $arr[..-2] + string replace '!*' "$arr[..-2]" $argv[1] end