From e42a386265350dd524e079464e4c8a3dd103cac5 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sat, 7 Mar 2026 00:30:44 -0500 Subject: start splitting things into separate modules --- config/foot.scm | 48 +++++++++++++ config/packages.scm | 168 +++++++++++++++++++++++++++++++++++++++++++++ config/sway.scm | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 408 insertions(+) create mode 100644 config/foot.scm create mode 100644 config/packages.scm create mode 100644 config/sway.scm (limited to 'config') diff --git a/config/foot.scm b/config/foot.scm new file mode 100644 index 0000000..42251a0 --- /dev/null +++ b/config/foot.scm @@ -0,0 +1,48 @@ +(define-library (config foot) + (export foot-config) + (import (scheme base) + (ini)) + (begin + (define foot-config + (parameterize + ((current-output-port + (open-output-string))) + (scm->ini + '((#f + ("font" . "monospace:size=12")) + + ;; Nord theme + (colors-dark + ("background" . "2e3440") + ("foreground" . "d8dee9") + ("cursor" . "2e3440 d8dee9") + + ("regular0" . "3b4252") + ("regular1" . "bf616a") + ("regular2" . "a3be8c") + ("regular3" . "ebcb8b") + ("regular4" . "81a1c1") + ("regular5" . "b48ead") + ("regular6" . "88c0d0") + ("regular7" . "e5e9f0") + + ("bright0" . "4c566a") + ("bright1" . "bf616a") + ("bright2" . "a3be8c") + ("bright3" . "ebcb8b") + ("bright4" . "81a1c1") + ("bright5" . "b48ead") + ("bright6" . "8fbcbb") + ("bright7" . "eceff4") + + ("dim0" . "373e4d") + ("dim1" . "94545d") + ("dim2" . "809575") + ("dim3" . "b29e75") + ("dim4" . "68809a") + ("dim5" . "8c738c") + ("dim6" . "6d96a5") + ("dim7" . "aeb3bb")))) + (get-output-string (current-output-port)))))) + + diff --git a/config/packages.scm b/config/packages.scm new file mode 100644 index 0000000..b7992fd --- /dev/null +++ b/config/packages.scm @@ -0,0 +1,168 @@ +(define-library (config packages) + (export home) + (import (scheme base) + (gnu packages)) + (begin + (define essential-cli + '("adb" + "bat" + "bind:utils" + "cava" + "chibi-scheme" + "cmus" + "curl" + "fastfetch" + "fd" + "ffmpeg" + "file" + "flatpak" + "gcc-toolchain" + "ghc-tldr" + "git" + "git:send-email" + "go" + "guile" + "guile-ini" + "guile-lib" + "htop" + "jq" + "keepassxc" + "nmap" + "pamixer" + "pulsemixer" + "racket" + "rlwrap" + "rsync" + "sbcl" + "screen" + "strace" + "syncthing" + "tree" + "unzip" + "zig" + "zip")) + + + ;; "emacs-cape" + ;; "emacs-corfu" + ;; "emacs-org" + (define emacs + '("emacs" + "emacs-2048-game" + "emacs-bluetooth" + "emacs-dumb-jump" + "emacs-elfeed" + "emacs-elfeed-org" + "emacs-ellama" + "emacs-elpher" + "emacs-emms" + "emacs-emojify" + "emacs-f" + "emacs-geiser" + "emacs-geiser-guile" + "emacs-go-mode" + "emacs-guix" + "emacs-jabber" + "emacs-lsp-mode" + "emacs-lsp-ui" + "emacs-markdown-mode" + "emacs-nord-theme" + "emacs-nov-el" + "emacs-org-bullets" + "emacs-org-download" + "emacs-org-emms" + "emacs-org-mime" + "emacs-org-pandoc-import" + "emacs-org-roam" + "emacs-org-transclusion" + "emacs-origami" + "emacs-ox-hugo" + "emacs-pdf-tools" + "emacs-persist" + "emacs-pinentry" + "emacs-racket-mode" + "emacs-request" + "emacs-restclient" + "emacs-simple-httpd" + "emacs-slime" + "emacs-sqlite3-api" + "emacs-toc-org" + "emacs-tramp" + "emacs-transmission" + "emacs-typescript-mode" + "emacs-websocket" + "emacs-which-key" + "emacs-wttrin" + "emacs-yaml-mode" + "emacs-zig-mode" + "ispell")) + + (define sway + '("font-fira-mono" + "font-google-noto-emoji" + "foot" + "gammastep" + "grim" + "grimshot" + "gst-libav" + "gst-plugins-bad" + "gst-plugins-base" + "gst-plugins-good" + "gst-plugins-ugly" + "imv" + "mpv" + "noisetorch" + "pinentry" + "pipe-viewer" + "slurp" + "tesseract-ocr" + "waypipe" + "wl-clipboard" + "wofi" + "xdg-user-dirs" + "zbar")) + + + ;; "icecat" + ;; "krita" + ;; "nyxt" + ;; "patchage" + ;; "ungoogled-chromium" + (define essential-gui + '("darktable" + "gimp" + "libreoffice" + "mumble" + "obs" + "obs-vkcapture" + "obs-wlrobs" + "transmission")) + + + ;; "luanti" + ;; "minetest-worldedit" + ;; "luanti-mineclone" + ;; "openmw" + (define gaming + '("protonup" + "steam" + "crispy-doom" + "freedoom")) + + (define email + '("isync" + "mb2md" + "mu")) + + (define misc + '("sicp")) + + (define home + (specifications->packages + (append + essential-gui + essential-cli + emacs + email + sway + gaming))))) diff --git a/config/sway.scm b/config/sway.scm new file mode 100644 index 0000000..f9cd0df --- /dev/null +++ b/config/sway.scm @@ -0,0 +1,192 @@ +(define-library (config sway) + (export sway-config) + (import (scheme base) + (config-generation sway)) + (begin + (define screenshot-menu "guile --r7rs -L ~/src/wofi-guile/lib/ ~/src/screenshot-menu.scm") + + (define sway-config + (scm->sway-config + ;;; Variables + `((set $mod Mod4 ; Logo key. Use Mod1 for Alt. + $hyper Mod1+Mod4+Shift+Control + $meh Mod1+Shift+Control + + ;; Home row directions keys, like vim. + $left h + $down j + $up k + $right l + + ;; Prefered terminal emulator + $term "foot" + + ;; Preferred editor + $editor "emacsclient -c -a emacs" + + ;; Preferred application launcher + $menu "wofi -c ~/.config/wofi/config -I" + + ;; Preferred music player + $music "foot cmus") + + + ;; Output configuration + (output ((* bg "#2E3440" solid_color) + (HDMI-A-1 mode 1920x1080@144Hz))) + + ;; Input configuration + ;; (input "9580:110:HUION_Huion_Tablet_Pen" map_to_output HDMI-A-1) + + ;; Hide cursor after 3 seconds + (seat * hide_cursor 3000) + + (input "1133:50504:Logitech_USB_Receiver_Mouse" + ((accel_profile flat) + (pointer_accel -0.4))) + +;;; Key bindings + (bindsyms + ;; Kill focused window + ;; (($mod+Shift+q $meh+q) kill) + ;; Start launcher + ;; (($hyper+d $mod+d) exec $menu) + ;; Reload the config file + ;; ($mod+Shift+c reload) + ;; Lock sway + (($meh+l $mod+Semicolon) exec swaylock -c "#000000") + ;; Exit sway + ;; ($mod+Shift+e exec swaynag -t warning -m "You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session." -b "Yes, exit sway" "herd stop sway") + ;; Screenshot menu + ($meh+a exec ,screenshot-menu)) + + ;; Drag floating windows by holding down $mod and left mouse button. + ;; Resize them with right mouse button + $mod. + ;; Also works for non-floating windows. + ;; Change normal to inverse to use left mouse buttor for resizing and right + ;; mouse button for dragging. + (floating_modifier $mod normal) + + ;; Moving around + ;; (bindsyms + ;; ;; Moving focus around + ;; (($mod+$left $mod+Left) focus left) + ;; (($mod+$down $mod+Down) focus down) + ;; (($mod+$up $mod+Up) focus up) + ;; (($mod+$right $mod+Right) focus right) + + ;; ;; Move the focused window by adding Shift + ;; (($mod+Shift+$left $mod+Shift+Left) move left) + ;; (($mod+Shift+$down $mod+Shift+Down) move down) + ;; (($mod+Shift+$up $mod+Shift+Up) move up) + ;; (($mod+Shift+$right $mod+Shift+Right) move right)) + + ;; Workspaces + (bindsyms + ;; Switch to workspace + ;; ($mod+1 workspace number 1) + ;; ($mod+2 workspace number 2) + ;; ($mod+3 workspace number 3) + ;; ($mod+4 workspace number 4) + ;; ($mod+5 workspace number 5) + ;; ($mod+6 workspace number 6) + ;; ($mod+7 workspace number 7) + ;; ($mod+8 workspace number 8) + ;; ($mod+9 workspace number 9) + ;; ($mod+0 workspace number 10) + + ;; Move focused container to workspace + ;; ($mod+Shift+1 move container to workspace number 1) + ;; ($mod+Shift+2 move container to workspace number 2) + ;; ($mod+Shift+3 move container to workspace number 3) + ;; ($mod+Shift+4 move container to workspace number 4) + ;; ($mod+Shift+5 move container to workspace number 5) + ;; ($mod+Shift+6 move container to workspace number 6) + ;; ($mod+Shift+7 move container to workspace number 7) + ;; ($mod+Shift+8 move container to workspace number 8) + ;; ($mod+Shift+9 move container to workspace number 9) + ;; ($mod+Shift+0 move container to workspace number 10) + + ;; Split the current object + ;; ($mod+b splith) + ;; ($mod+v splitv) + + ;; Switch the current container layout style + ;; ($mod+s layout stacking) + ;; ($mod+w layout tabbed) + ;; ($mod+e layout toggle split) + + ;; Make the current focus fullscreen + ;; ($mod+f fullscreen) + + ;; Toggle focus between tiling and floating mode + ;; ($mod+Shift+space floating toggle) + + ;; Swap focus between the tiling area and the floating area + ;; ($mod+space focus mode_toggle) + + ;; Move focus to the parent container + ;; ($mod+a focus parent) + ) + + ;;; Scratchpad + ;; (bindsyms + ;; ;; Move the currently focused window to the scratchpad + ;; ($mod+Shift+minus move scratchpad) + ;; ;; Show the next scratchpad window or hide the focused scratchpad window. + ;; ;; If there are multiple scratchpad windows, this command cycles through them. + ;; ($mod+minus scratchpad show)) + + ;;; Resizing + ;; (mode "resize" + ;; ((bindsyms + ;; (($left Left) resize shrink width 10px) + ;; (($down Down) resize grow height 10px) + ;; (($up Up) resize shrink height 10px) + ;; (($right Right) resize grow width 10px) + + ;; ;; Return to default mode + ;; (Return mode "default") + ;; (Escape mode "default")))) + ;; (bindsym $mod+r mode "resize") + + ;;; Media + (bindsyms + (XF86AudioRaiseVolume exec pamixer --increase 5) + (XF86AudioLowerVolume exec pamixer --decrease 5) + (XF86AudioMute exec pamixer --toggle-mute) + (XF86AudioPlay exec emacsclient -e "(emms-pause)") + (XF86AudioNext exec emacsclient -e "(emms-next)") + (XF86AudioPrev exec emacsclient -e "(emms-previous)") + (XF86Search exec $menu)) + + ;; Applications + (bindsyms + ;; Start music player on workspace 5 + ($hyper+m (workspace 5) (exec $music) (workspace back_and_forth)) + ;; Start terminal + ;; (($mod+Return $mod+Shift+t) exec emacsclient -c -e "(new-eshell)") + ;; Start editor + (($mod+t $hyper+t) exec $editor)) + + ;; TODO REMOVE + (exec "hash dbus-update-activation-environment 2>/dev/null") + (exec_always "dbus-update-activation-environment --all") + + ;;; Styling + + (font "pango:Noto Sans Mono" 8) + (titlebar_padding 7 1) + + ;; Remove titlebar by default + (for-window (title ".*") border pixel 2) + + (for-window (class ".*") inhibit_idle fullscreen) + (for-window (app_id ".*") inhibit_idle fullscreen) + + ;; Class border backgr. text indicator child_border + (client.focused "#bf616a" "#bf616a" "#ffffff" "#bf616a" "#bf616a") + (client.focused_inactive "#333333" "#5f676a" "#ffffff" "#484e50" "#5f676a") + (client.unfocused "#333333" "#222222" "#888888" "#292d2e" "#222222") + (client.urgent "#2f343a" "#900000" "#ffffff" "#900000" "#900000") + (client.placeholder "#000000" "#0c0c0c" "#ffffff" "#000000" "#0c0c0c")))))) -- cgit