From a98bfd21b17e120897b9f2b2791fce830e062e47 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 Feb 2025 16:29:18 -0600 Subject: [PATCH] More iterating --- lib/modules/home/default.nix | 20 +- lib/modules/home/eww/eww.scss | 114 ---- lib/modules/home/eww/eww.yuck | 105 ---- .../home/eww/scripts/battery-time.bash | 3 - .../home/eww/scripts/hypr-workspaces.bash | 78 --- .../home/eww/scripts/workspaces/.gitignore | 2 - .../home/eww/scripts/workspaces/default.nix | 23 - .../eww/scripts/workspaces/src/.gitignore | 1 - .../eww/scripts/workspaces/src/Cargo.lock | 96 ---- .../eww/scripts/workspaces/src/Cargo.toml | 19 - .../home/eww/scripts/workspaces/src/main.rs | 186 ------- lib/modules/home/hyprland.nix | 437 --------------- lib/modules/home/kitty.nix | 178 ------ lib/modules/home/niri/config.kdl | 509 ------------------ lib/modules/home/plasma-manager.nix | 287 ---------- lib/modules/home/sway-laptop.nix | 6 - lib/modules/home/sway.nix | 421 --------------- lib/modules/home/swaylock.nix | 32 -- lib/modules/home/waybar.nix | 371 ------------- .../colors/catppuccin-mocha-sapphire.toml | 58 -- lib/modules/home/wezterm/wezterm.lua | 167 ------ packages/hosts/default.nix | 32 +- packages/shells/default.nix | 3 + 23 files changed, 35 insertions(+), 3113 deletions(-) delete mode 100644 lib/modules/home/eww/eww.scss delete mode 100644 lib/modules/home/eww/eww.yuck delete mode 100755 lib/modules/home/eww/scripts/battery-time.bash delete mode 100755 lib/modules/home/eww/scripts/hypr-workspaces.bash delete mode 100644 lib/modules/home/eww/scripts/workspaces/.gitignore delete mode 100644 lib/modules/home/eww/scripts/workspaces/default.nix delete mode 100644 lib/modules/home/eww/scripts/workspaces/src/.gitignore delete mode 100644 lib/modules/home/eww/scripts/workspaces/src/Cargo.lock delete mode 100644 lib/modules/home/eww/scripts/workspaces/src/Cargo.toml delete mode 100644 lib/modules/home/eww/scripts/workspaces/src/main.rs delete mode 100644 lib/modules/home/hyprland.nix delete mode 100644 lib/modules/home/kitty.nix delete mode 100644 lib/modules/home/niri/config.kdl delete mode 100644 lib/modules/home/plasma-manager.nix delete mode 100644 lib/modules/home/sway-laptop.nix delete mode 100644 lib/modules/home/sway.nix delete mode 100644 lib/modules/home/swaylock.nix delete mode 100644 lib/modules/home/waybar.nix delete mode 100644 lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml delete mode 100644 lib/modules/home/wezterm/wezterm.lua diff --git a/lib/modules/home/default.nix b/lib/modules/home/default.nix index fcac5b3..3d1f34a 100644 --- a/lib/modules/home/default.nix +++ b/lib/modules/home/default.nix @@ -181,7 +181,7 @@ in # }; home.file.".config/eww".source = - config.lib.file.mkOutOfStoreSymlink /etc/nixos/flake/modules/home-manager/eww; + config.lib.file.mkOutOfStoreSymlink /etc/nixos/modules/home-manager/eww; }; mako = @@ -293,11 +293,15 @@ in */ }; - desktop = { - imports = with homeManagerModules; [ - ghostty - ]; - }; + desktop = + { config, lib, ... }: + { + config = lib.mkIf config.lyte.desktop { + imports = with homeManagerModules; [ + ghostty + ]; + }; + }; # ewwbar = {}; @@ -1232,11 +1236,11 @@ in # }; home.file."${config.xdg.configHome}/niri" = { - source = config.lib.file.mkOutOfStoreSymlink /etc/nix/flake/modules/home-manager/niri; + source = config.lib.file.mkOutOfStoreSymlink /etc/nixos/modules/home-manager/niri; }; home.file."${config.xdg.configHome}/fuzzel" = { - source = config.lib.file.mkOutOfStoreSymlink /etc/nix/flake/modules/home-manager/fuzzel; + source = config.lib.file.mkOutOfStoreSymlink /etc/nixos/modules/home-manager/fuzzel; }; }; diff --git a/lib/modules/home/eww/eww.scss b/lib/modules/home/eww/eww.scss deleted file mode 100644 index 07ebc6a..0000000 --- a/lib/modules/home/eww/eww.scss +++ /dev/null @@ -1,114 +0,0 @@ -$base: #1e1e2e; -$mantle: #181825; -$crust: #11111b; -$text: #cdd6f4; -$subtext0: #a6adc8; -$subtext1: #bac2de; -$surface0: #313244; -$surface1: #45475a; -$surface2: #585b70; -$overlay0: #6c7086; -$overlay1: #7f849c; -$overlay2: #9399b2; -$blue: #89b4fa; -$lavender: #b4befe; -$sapphire: #74c7ec; -$sky: #89dceb; -$teal: #94e2d5; -$green: #a6e3a1; -$yellow: #f9e2af; -$peach: #fab387; -$maroon: #eba0ac; -$red: #f38ba8; -$mauve: #cba6f7; -$pink: #f5c2e7; -$flamingo: #f2cdcd; -$rosewater: #f5e0dc; - -* { - all: unset; -} - -.bar0, -.bar1, -.bar { - background-color: $base; - color: $text; - border-radius: 5px; - border: solid 0px $base; - font-family: IosevkaLyteTerm; - font-size: 12.0pt; -} - -.leftsidestuff slider { - color: $sapphire; -} - -.metric {} - -.metric label { - padding-right: 5px; -} - -.metric scale { - /*background-color: #ff00ff;*/ -} - -.metric scale trough { - background-color: $surface1; - color: $mantle; - border-radius: 50px; - min-height: 5px; - min-width: 50px; -} - -.metric scale trough highlight { - background-color: $flamingo; - color: $base; - border-radius: 10px; -} - -.bar0>*, -.bar1>*, -.bar>* { - padding-left: 8px; - padding-right: 8px; -} - -.vol .muted, -.mic .live { - color: $red; -} - -.vol .live, -.mic .muted { - color: $sapphire; -} - -.workspace { - /* height: 100%; */ - /* height: 32px; */ - margin: 0; - padding-top: 0px; - padding-bottom: 0px; - padding-left: 5px; - padding-right: 5px; - color: #666666; -} - -.workspace.occupied { - color: $text; -} - -.workspace.occupied.active, -.workspace.active { - color: $base; - background-color: $subtext1; -} - -.workspace.occupied.focused.active, -.workspace.occupied.focused, -.workspace.focused { - color: $base; - background-color: $sapphire; -} \ No newline at end of file diff --git a/lib/modules/home/eww/eww.yuck b/lib/modules/home/eww/eww.yuck deleted file mode 100644 index 30ce94e..0000000 --- a/lib/modules/home/eww/eww.yuck +++ /dev/null @@ -1,105 +0,0 @@ -(defwidget bar [] - (centerbox :orientation "h" - (leftsidestuff) - (box) - (rightsidestuff) - )) - -(defwindow bar0 - :monitor 0 - :stacking "fg" - :exclusive true - :geometry - (geometry - :x "0%" - :y "5px" - :width "80%" - :height "32px" - :anchor "bottom center") - (bar)) - -(defwindow bar1 - :monitor 1 - :stacking "fg" - :exclusive true - :geometry - (geometry - :x "0%" - :y "5px" - :width "80%" - :height "32px" - :anchor "bottom center") - (bar)) - -(defwidget rightsidestuff [] - (box :class "rightsidestuff" :orientation "h" :space-evenly false :halign "end" :valign "center" :spacing 10 - (music) - (systray) - )) - -(defwidget leftsidestuff [] - (box :class "leftsidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10 - time - ; TODO: idle inhibitor? - ; TODO: get these to align properly? icons seem lower than they should be? - (box :class "mic" ( - box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "} - ) {"${micVolume}%"} - ) - (box :class "vol" ( - box :class {muted == "false" ? "live" : "muted"} {muted == "false" ? "󰕾 " : "󰖁 "} - ) {"${volume}%"} - ) - {" ${round(EWW_CPU["avg"], 0)}%"} - {" ${round(EWW_RAM["used_mem_perc"], 0)}%"} - ; TODO: have these "widgets" be omitted entirely instead of just empty strings - {(showBrightness == "true") ? (" ${brightness}%") : ""} - {(showBattery == "true") ? ("󱊣 ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""} - (box :orientation "h" :space-evenly false :halign "start" :valign "center" (workspaces)) - )) - -(defwidget music [] - (box :class "music" - :orientation "h" - :halign "end" - :space-evenly false - {music != "" ? "${music}" : ""})) - -(deflisten music :initial "" - "playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true") - -(deflisten volume :initial "0" - "pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done") - -(deflisten muted :initial "false" - "pamixer --get-mute; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-mute; done") - -(deflisten micVolume :initial "0" - "pamixer --default-source --get-volume; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-volume; done") - -(deflisten micMuted :initial "false" - "pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done") - - ; "upower -d | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'; upower --monitor-detail | rg '\\s*(time to empty|time to full):\\s*(\\d.*)\$' -r '\$2'") - -; (deflisten batteryTime :initial "unknown" -; "upower -d | rg '\s*time to empty:\s*(\d.*)\$' -r '\$1'; upower --monitor-detail | rg '\\s*time to empty:\\s*(\\d.*)\$' -r '\$1'") - -(defpoll time :interval "1s" - "date '+%a %b %d %H:%M:%S'") - -(defpoll showBrightness :interval "24h" - ; if we have at least one file in /sys/class/backlight, we should try and show brightness - "if [ \"$(find /sys/class/backlight -mindepth 1 -maxdepth 1 | head -n 1 | wc -l)\" == \"1\" ]; then echo true; else echo false; fi") - -(defpoll showBattery :interval "24h" - ; if we have at least one battery in /sys/class/power_supply, we should try and show battery levels - "if find /sys/class/power_supply -mindepth 1 -maxdepth 1 2>&1 | rg '\/sys\/class\/power_supply\/BAT' 2>&1 > /dev/null; then echo true; else echo false; fi") - -(defpoll brightness :interval "10s" - "echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))") - -(deflisten batteryTime :initial "unknown" "scripts/battery-time.bash") - -(deflisten workspace "scripts/hypr-workspaces.bash") -(defwidget workspaces [] (literal :content workspace)) diff --git a/lib/modules/home/eww/scripts/battery-time.bash b/lib/modules/home/eww/scripts/battery-time.bash deleted file mode 100755 index 28c307b..0000000 --- a/lib/modules/home/eww/scripts/battery-time.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -{ upower -d; upower --monitor-detail; } \ - | rg '\s*time to.*:\s*(\d.*)\s*$' -r '$1' diff --git a/lib/modules/home/eww/scripts/hypr-workspaces.bash b/lib/modules/home/eww/scripts/hypr-workspaces.bash deleted file mode 100755 index 6cbd72e..0000000 --- a/lib/modules/home/eww/scripts/hypr-workspaces.bash +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -# TODO: we're mixing bash arrays and not-arrays - get it together -declare -A OCCUPIED -declare -A ACTIVE -declare -A FOCUSED - -#define icons for workspaces 1-9 -spaces=(1 2 3 4 5 6 7 8 9) -icons=(1 2 3 4 5 6 7 8 9) - -occupy() { export OCCUPIED["$1"]=occupied; } -unoccupy() { unset "OCCUPIED[$1]"; } - -activate() { export ACTIVE["$1"]=active; } -deactivate() { unset "ACTIVE[$1]"; } - -focus() { export FOCUSED["$1"]=focused; } -unfocus() { unset "FOCUSED[$1]"; } - -workspaces() { - for s in "${spaces[@]}"; do - unfocus "$s" - deactivate "$s" - unoccupy "$s" - done - - # TODO: avoid recomputing these each time and actually listen to the events? - mons_json=$(hyprctl monitors -j) - for num in $(hyprctl workspaces -j | jq -r '.[] | select(.windows > 0) | .id'); do - occupy "$num" - done - - for num in $(echo "$mons_json" | jq -r '.[].activeWorkspace.id'); do - activate "$num" - done - - for num in $(echo "$mons_json" | jq -r '.[] | select(.focused) | .activeWorkspace.id'); do - focus "$num" - done - - # TODO: would be nice to have monitors' workspaces show up in left-to-right - # order as laid out in physical/pixel space - # this would make glancing at the workspace indicator more intuitive - # - # TODO: might be nice to exclude certain windows as counting towards "occupation" such as xwaylandvideobridge or w/e - # - # NOTE: maybe I can group workspaces by their monitor with some mechanism for "unassigned" workspace to show up by a "primary" monitor - - # render eww widget - echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \ - (box :class \"workspaces\" :orientation \"h\" :spacing 0 :space-evenly \"true\" \ - (button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"workspace ${ACTIVE[1]} ${OCCUPIED[1]} ${FOCUSED[1]}\" \"${icons[0]}\") \ - (button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"workspace ${ACTIVE[2]} ${OCCUPIED[2]} ${FOCUSED[2]}\" \"${icons[1]}\") \ - (button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"workspace ${ACTIVE[3]} ${OCCUPIED[3]} ${FOCUSED[3]}\" \"${icons[2]}\") \ - (button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"workspace ${ACTIVE[4]} ${OCCUPIED[4]} ${FOCUSED[4]}\" \"${icons[3]}\") \ - (button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"workspace ${ACTIVE[5]} ${OCCUPIED[5]} ${FOCUSED[5]}\" \"${icons[4]}\") \ - (button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"workspace ${ACTIVE[6]} ${OCCUPIED[6]} ${FOCUSED[6]}\" \"${icons[5]}\") \ - (button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"workspace ${ACTIVE[7]} ${OCCUPIED[7]} ${FOCUSED[7]}\" \"${icons[6]}\") \ - (button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"workspace ${ACTIVE[8]} ${OCCUPIED[8]} ${FOCUSED[8]}\" \"${icons[7]}\") \ - (button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"workspace ${ACTIVE[9]} ${OCCUPIED[9]} ${FOCUSED[9]}\" \"${icons[8]}\") \ - ) \ - )" -} - -workspace_reader() { - while read -r l; do - workspaces "$l" - done -} - -# initial render -workspaces - -# listen to events and re-render -nc -U "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | workspace_reader - -echo '(box "EXITING")' diff --git a/lib/modules/home/eww/scripts/workspaces/.gitignore b/lib/modules/home/eww/scripts/workspaces/.gitignore deleted file mode 100644 index 0bc0bbc..0000000 --- a/lib/modules/home/eww/scripts/workspaces/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -./target -./result diff --git a/lib/modules/home/eww/scripts/workspaces/default.nix b/lib/modules/home/eww/scripts/workspaces/default.nix deleted file mode 100644 index d03d180..0000000 --- a/lib/modules/home/eww/scripts/workspaces/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs ? import { }, -}: -let - # lock = builtins.fromJSON (builtins.readFile ../../../../../flake.lock); - # nixpkgsRev = lock.nodes.nixpkgs.locked.rev; - # pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev}.tar.gz") {}; - pname = "hyprland-workspaces-eww"; - version = "1.0.0"; - src = ./src; -in -pkgs.rustPlatform.buildRustPackage { - inherit pname version src; - cargoHash = "sha256-6Wl3cOIxlPJjzEuzNhCBZJXayL8runQfAxPruvzh2Vc="; - # cargoHash = pkgs.lib.fakeHash; - checkType = "release"; - postBuild = '' - # pushd target/*/release - # ls -la - # ${pkgs.upx}/bin/upx --best --lzma hyprland-workspaces-eww - # popd - ''; -} diff --git a/lib/modules/home/eww/scripts/workspaces/src/.gitignore b/lib/modules/home/eww/scripts/workspaces/src/.gitignore deleted file mode 100644 index eb5a316..0000000 --- a/lib/modules/home/eww/scripts/workspaces/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/lib/modules/home/eww/scripts/workspaces/src/Cargo.lock b/lib/modules/home/eww/scripts/workspaces/src/Cargo.lock deleted file mode 100644 index 10e543c..0000000 --- a/lib/modules/home/eww/scripts/workspaces/src/Cargo.lock +++ /dev/null @@ -1,96 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "hyprland-workspaces-eww" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "itoa" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "proc-macro2" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "serde" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "syn" -version = "2.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" diff --git a/lib/modules/home/eww/scripts/workspaces/src/Cargo.toml b/lib/modules/home/eww/scripts/workspaces/src/Cargo.toml deleted file mode 100644 index 2fd947d..0000000 --- a/lib/modules/home/eww/scripts/workspaces/src/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "hyprland-workspaces-eww" -version = "0.1.0" -edition = "2021" - -[[bin]] -name = "hyprland-workspaces-eww" -path = "./main.rs" - -[dependencies] -serde = "1.0.217" -serde_json = "1.0.137" - -[profile.release] -strip = true -opt-level = "z" -lto = true -codegen-units = 1 -panic = "abort" diff --git a/lib/modules/home/eww/scripts/workspaces/src/main.rs b/lib/modules/home/eww/scripts/workspaces/src/main.rs deleted file mode 100644 index a77ecc2..0000000 --- a/lib/modules/home/eww/scripts/workspaces/src/main.rs +++ /dev/null @@ -1,186 +0,0 @@ -mod workspace { - pub struct Workspace { - id: usize, - icon: char, - pub is_active: bool, - pub is_occupied: bool, - pub is_focused: bool, - } - - impl Workspace { - pub fn new(id: usize) -> Self { - Self { - id, - icon: id.to_string().chars().next().unwrap_or('?'), - is_active: false, - is_occupied: false, - is_focused: false, - } - } - - pub fn id(&self) -> usize { - return self.id; - } - - pub fn icon(&self) -> char { - return self.icon; - } - - pub fn clear_states(&mut self) { - self.is_active = false; - self.is_occupied = false; - self.is_focused = false; - } - } -} - -mod eww {} - -mod hypr { - pub mod hyprland { - - pub mod workspace { - pub type Id = usize; - pub type Name = String; - } - - pub mod socket2 { - use super::workspace; - use std::{error::Error, fmt::Display, num::ParseIntError, str::FromStr}; - - #[derive(Debug)] - pub enum Event { - Workspace(workspace::Id), - Exit(), - WorkspaceV2(String, String), - } - - #[derive(Debug)] - pub enum EventParseError { - UnknownEventType(String), - MissingParameters(String), - InvalidParameters(String, String), - ParseIntError(ParseIntError), - } - - impl From for EventParseError { - fn from(value: ParseIntError) -> Self { - Self::ParseIntError(value) - } - } - - impl Error for EventParseError {} - - impl Display for EventParseError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - EventParseError::UnknownEventType(event_type) => { - write!(f, "unknown event type: {event_type}") - } - - EventParseError::MissingParameters(event_type) => { - write!(f, "missing parameters for event type: {event_type}") - } - - EventParseError::ParseIntError(err) => { - write!(f, "error parsing integer: {err}") - } - EventParseError::InvalidParameters(event_type, params) => { - write!( - f, - "invalid parameters for event type {event_type}: {params}" - ) - } - } - } - } - - impl FromStr for Event { - type Err = EventParseError; - - fn from_str(s: &str) -> Result { - let (event_type, rest): (&str, Option<&str>) = s - .find(">>") - .map(|n| { - let (a, b) = s.split_at(n); - (a, Option::Some(&b[2..])) - }) - .unwrap_or((s, Option::None)); - match (event_type, rest) { - ("workspace", None) => { - Err(EventParseError::MissingParameters(event_type.to_string())) - } - ("workspace", Some(workspace)) => Ok(Event::Workspace(workspace.parse()?)), - ("workspacev2", Some(args)) => { - let args: (String, String) = args - .split_once(',') - .map(|(a, b)| (a.to_string(), b.to_string())) - .ok_or(EventParseError::InvalidParameters( - event_type.to_string(), - args.to_string(), - ))?; - Ok(Event::WorkspaceV2(args.0, args.1)) - } - ("exit", _) => Ok(Event::Exit()), - _ => Err(EventParseError::UnknownEventType(event_type.to_string())), - } - } - } - } - } -} - -use hypr::hyprland::socket2::Event; -use std::{ - collections::HashMap, - env, - error::Error, - io::{BufRead, BufReader}, - os::unix::net::UnixStream, -}; -use workspace::Workspace; - -fn main() -> Result<(), Box> { - let mut workspaces: HashMap = - (1..=9).map(|n| (n, Workspace::new(n))).collect(); - let path = format!( - "{}/hypr/{}/.socket2.sock", - env::var("XDG_RUNTIME_DIR")?, - env::var("HYPRLAND_INSTANCE_SIGNATURE")? - ); - - eprintln!("opening {}", path); - let stream = UnixStream::connect(&path)?; - let event_lines = BufReader::new(stream).lines(); - for l in event_lines.into_iter() { - match l?.parse::() { - Ok(e) => match e { - Event::Workspace(i) => match workspaces.get_mut(&i) { - Some(related_workspace) => { - eprintln!( - "setting workspace {} (id: {}) as active", - related_workspace.icon(), - related_workspace.id() - ); - related_workspace.is_active = true - } - None => { - eprintln!("event for untracked workspace {}", i); - } - }, - Event::Exit() => break, - other => { - eprintln!("unhandled event: {:?}", other); - } - }, - Err(e) => eprintln!("error parsing event: {}", e), - } - render(&workspaces)?; - } - - Ok(()) -} - -fn render(workspaces: &HashMap) -> Result<(), Box> { - Ok(()) -} diff --git a/lib/modules/home/hyprland.nix b/lib/modules/home/hyprland.nix deleted file mode 100644 index 422f016..0000000 --- a/lib/modules/home/hyprland.nix +++ /dev/null @@ -1,437 +0,0 @@ -{ - pkgs, - style, - config, - lib, - # font, - ... -}: -let - inherit (style) colors; -in -{ - # TODO: Hyprland seems to sometimes use a ton of CPU? - - home.packages = with pkgs; [ - glib - swayosd - ]; - - home.file."${config.xdg.configHome}/hypr/hyprpaper.conf" = { - enable = true; - text = '' - preload = ~/.wallpaper - wallpaper = ,~/.wallpaper - ''; - }; - - wayland.windowManager.hyprland = { - enable = true; - settings = { - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - monitor = [ - # See https://wiki.hyprland.org/Configuring/Monitors/ - ",preferred,auto,auto" - ]; - - xwayland = { - force_zero_scaling = true; - }; - - exec-once = [ - "hyprpaper" - "mako" - "swayosd-server" - "eww daemon" - "[workspace 1 silent] firefox" - "[workspace 1 silent] wezterm" - "xwaylandvideobridge" - "systemctl --user import-environment QT_QPA_PLATFORMTHEME" - "hypridle" - ]; - - exec = [ - ''gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"'' - ''gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"'' - ]; - - env = [ - "XCURSOR_SIZE,24" - "QT_QPA_PLATFORMTHEME,qt6ct" - "GTK_THEME,Adwaita-dark" - ]; - - input = { - kb_layout = "us"; - kb_options = "ctrl:nocaps"; - - /* - kb_variant = - kb_model = - kb_rules = - */ - - follow_mouse = 2; - - repeat_delay = 180; - repeat_rate = 120; - - touchpad = { - natural_scroll = "yes"; - tap-to-click = true; - middle_button_emulation = true; - disable_while_typing = false; - }; - }; - - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - }; - - binds = { - allow_workspace_cycles = true; - }; - - cursor = { - no_warps = true; - }; - - general = { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - "col.active_border" = "0xff${colors.primary} 0xff${colors.green} 45deg"; - "col.inactive_border" = "0xff${colors.fgdim}"; - - gaps_in = 3; - gaps_out = 6; - border_size = 2; - resize_on_border = true; - no_focus_fallback = false; - - layout = "dwindle"; - }; - - decoration = { - rounding = 10; - rounding_power = 4.0; - - /* - blur = "no"; - blur_size = 3 - blur_passes = 1 - blur_new_optimizations = on - */ - - shadow = { - enabled = true; - color = "rgba(1a1a1aee)"; - range = 4; - render_power = 3; - }; - - dim_inactive = false; - }; - - "$mod" = "SUPER"; - bind = [ - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - /* - "$mod, return, exec, wezterm" - "$mod SHIFT, return, exec, wezterm" - */ - "$mod, return, exec, wezterm" - "$mod SHIFT, return, exec, [float] wezterm start --always-new-process" - "$mod, U, exec, firefox" - "$mod, space, exec, tofi-run | xargs hyprctl dispatch exec --" - "$mod, D, exec, tofi-drun | xargs hyprctl dispatch exec --" - "$mod, C, killactive," - "$mod SHIFT, E, exit," - "$mod, E, exec, dolphin" - "$mod, F, togglefloating," - "$mod SHIFT, F, fullscreen," - "$mod, R, exec, anyrun" - "$mod, S, pseudo, # dwindle" - "$mod, P, togglesplit, # dwindle" - - # Move focus with mod + arrow keys - "$mod, left, movefocus, l" - "$mod, right, movefocus, r" - "$mod, up, movefocus, u" - "$mod, down, movefocus, d" - "$mod, h, movefocus, l" - "$mod, l, movefocus, r" - "$mod, k, movefocus, u" - "$mod, j, movefocus, d" - "$mod SHIFT, H, movewindow, l silent" - "$mod SHIFT, L, movewindow, r silent" - "$mod SHIFT, K, movewindow, u silent" - "$mod SHIFT, J, movewindow, d silent" - - "$mod SHIFT, V, exec, swayosd-client --input-volume mute-toggle" - ", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle" - ", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle" - ", XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise" - ", XF86AudioLowerVolume, exec, swayosd-client --output-volume lower" - - ", XF86MonBrightnessUp, exec, swayosd-client --brightness raise" - ", XF86MonBrightnessDown, exec, swayosd-client --brightness lower" - - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPrev, exec, playerctl previous" - - "$mod, tab, workspace, previous" - "ALT, tab, workspace, previous" - - # Switch workspaces with mod + [0-9] - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - # Move active window to a workspace with mod + SHIFT + [0-9] - "$mod SHIFT, 1, movetoworkspacesilent, 1" - "$mod SHIFT, 2, movetoworkspacesilent, 2" - "$mod SHIFT, 3, movetoworkspacesilent, 3" - "$mod SHIFT, 4, movetoworkspacesilent, 4" - "$mod SHIFT, 5, movetoworkspacesilent, 5" - "$mod SHIFT, 6, movetoworkspacesilent, 6" - "$mod SHIFT, 7, movetoworkspacesilent, 7" - "$mod SHIFT, 8, movetoworkspacesilent, 8" - "$mod SHIFT, 9, movetoworkspacesilent, 9" - "$mod SHIFT, 0, movetoworkspacesilent, 10" - "$mod SHIFT, S, exec, clipshot" - - # Scroll through existing workspaces with mod + scroll - "$mod, mouse_down, workspace, e+1" - "$mod, mouse_up, workspace, e-1" - "CTRL SHIFT $mod, L, exec, hyprlock" - "$mod CTRL, space, exec, makoctl dismiss" - "$mod SHIFT CTRL, space, exec, makoctl restore" - "$mod SHIFT, space, exec, makoctl invoke default" - "$mod, E, exec, thunar" - ]; - - # Move/resize windows with mod + LMB/RMB and dragging - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - }; - - extraConfig = '' - animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - bezier = overshot, 0.05, 0.9, 0.1, 1.1 - - # name, onoff, speed, curve, style - animation = global, 1, 2, default - animation = fadeDim, 1, 2, default - animation = windowsOut, 1, 2, default, popin 80% - } - - dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - # master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below - pseudotile = yes - preserve_split = 1 - # no_gaps_when_only = true - } - - master { - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more - # new_is_master = true - } - - gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = on - } - - ## Example per-device config - ## See https://wiki.hyprland.org/Configuring/Keywords/#executing for more - ## device:epic-mouse-v1 { - ## sensitivity = -0.5 - ## } - - ## See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - windowrulev2 = idleinhibit,class:^.*([Ss]lippi).*$ - windowrulev2 = float,class:^.*$ - windowrulev2 = tile,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$ - # windowrulev2 = opacity 1.0 0.95,class:^.*$ - windowrulev2 = center 1,floating:1 - - windowrulev2 = opacity 0.0 override, class:^(xwaylandvideobridge)$ - windowrulev2 = noanim, class:^(xwaylandvideobridge)$ - windowrulev2 = noinitialfocus, class:^(xwaylandvideobridge)$ - windowrulev2 = maxsize 1 1, class:^(xwaylandvideobridge)$ - windowrulev2 = noblur, class:^(xwaylandvideobridge)$ - windowrulev2 = nofocus, class:^(xwaylandvideobridge)$ - ''; - }; - - programs.hyprlock = { - enable = true; - settings = { - # docs: https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock - - general = { - grace = 0; - no_fade_out = true; - }; - - input-field = [ - { - monitor = ""; - fade_on_empty = false; - placeholder_text = "Locked"; - rounding = 5; - font_size = 20; - font_color = "rgba(255, 255, 255, 1.0)"; - inner_color = "rgba(31, 31, 47, 0.95)"; - outer_color = "0xff74c7ec 0xff74c7ec 45deg"; - outline_thickness = 3; - position = "0, -200"; - - dots_size = 0.1; - size = "300 75"; - font_family = "IosevkaLyteTerm"; - - shadow_passes = 3; - shadow_size = 8; - shadow_color = "rgba(0, 0, 0, 1.0)"; - shadow_boost = 0.8; - } - ]; - - background = [ - { - path = "~/.wallpaper"; - blur_passes = 2; - } - ]; - - label = [ - { - monitor = ""; - font_size = 64; - - halign = "center"; - valign = "center"; - text_align = "center"; - - # rotate = 10; - position = "0, 250"; - font_family = "IosevkaLyteTerm"; - text = ''Locked for $USER''; - - shadow_passes = 1; - shadow_size = 8; - shadow_color = "rgba(0, 0, 0, 1.0)"; - shadow_boost = 0.5; - } - - { - monitor = ""; - font_size = 32; - - halign = "center"; - valign = "center"; - text_align = "center"; - color = "rgba(255, 255, 255, 0.5)"; - - position = "0 100"; - font_family = "IosevkaLyteTerm"; - text = "cmd[update:1000] date '+%a %b %d %H:%M:%S'"; - - shadow_passes = 3; - shadow_size = 1; - shadow_color = "rgba(0, 0, 0, 1.0)"; - shadow_boost = 1.0; - } - - { - monitor = ""; - font_size = 200; - - halign = "center"; - valign = "center"; - text_align = "center"; - color = "rgba(220, 240, 255, 0.8)"; - position = "0 500"; - font_family = "NerdFontSymbolsOnly"; - text = "󰍁"; - - shadow_passes = 3; - shadow_size = 1; - shadow_color = "rgba(0, 0, 0, 1.0)"; - shadow_boost = 1.0; - } - ]; - }; - }; - - services.hypridle = - let - secondsPerMinute = 60; - lockSeconds = 10 * secondsPerMinute; - in - { - enable = true; - settings = { - general = { - after_sleep_cmd = "hyprctl dispatch dpms on"; - before_sleep_cmd = "loginctl lock-session"; - ignore_dbus_inhibit = false; - lock_cmd = "pidof hyprlock || hyprlock"; - }; - - listener = [ - { - timeout = lockSeconds - 300; - on-timeout = ''notify-send "Auto-locking in 5 minutes"''; - on-resume = ''notify-send "Auto-locking cancelled"''; - } - { - timeout = lockSeconds - 180; - on-timeout = ''notify-send "Auto-locking in 3 minutes"''; - } - { - timeout = lockSeconds - 120; - on-timeout = ''notify-send "Auto-locking in 2 minutes"''; - } - { - timeout = lockSeconds - 60; - on-timeout = ''notify-send "Auto-locking in 1 minute"''; - } - { - timeout = lockSeconds - 30; - on-timeout = ''notify-send "Auto-locking in 30 seconds"''; - } - { - timeout = lockSeconds - 10; - on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"''; - } - { - timeout = lockSeconds; - on-timeout = ''loginctl lock-session''; - } - { - timeout = lockSeconds + 5; - on-timeout = ''hyprctl dispatch dpms off''; - on-resume = ''hyprctl dispatch dpms on''; - } - ]; - }; - }; -} diff --git a/lib/modules/home/kitty.nix b/lib/modules/home/kitty.nix deleted file mode 100644 index 57cb93a..0000000 --- a/lib/modules/home/kitty.nix +++ /dev/null @@ -1,178 +0,0 @@ -{ - colors, - font, - ... -}: -{ - programs.kitty = { - enable = true; - darwinLaunchOptions = [ "--single-instance" ]; - shellIntegration = { - enableFishIntegration = true; - }; - settings = with colors.withHashPrefix; { - font_family = font.name; - bold_font = "${font.name} Heavy"; - italic_font = "${font.name} Italic"; - bold_italic_font = "${font.name} Heavy Italic"; - font_size = toString font.size; - inactive_text_alpha = "0.5"; - copy_on_select = true; - hide_window_decorations = "yes"; - - scrollback_lines = 500000; - - symbol_map = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono"; - - # use `kitty + list-fonts --psnames` to get the font's PostScript name - - allow_remote_control = true; - listen_on = "unix:/tmp/kitty"; - repaint_delay = 3; - input_delay = 3; - sync_to_monitor = true; - - adjust_line_height = 0; - window_padding_width = "10.0"; - window_margin_width = "0.0"; - - confirm_os_window_close = 0; - - enabled_layouts = "splits:split_axis=vertical,stack"; - - shell_integration = "disabled"; - - enable_audio_bell = true; - visual_bell_duration = "0.25"; - visual_bell_color = bg3; - - url_style = "single"; - - strip_trailing_spaces = "smart"; - - # open_url_modifiers ctrl - - tab_bar_align = "left"; - tab_bar_style = "separator"; - tab_separator = ''""''; - tab_bar_edge = "bottom"; - tab_title_template = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "''; - active_tab_font_style = "normal"; - - ## name: Catppuccin Kitty Mocha - ## author: Catppuccin Org - ## license: MIT - ## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf - ## blurb: Soothing pastel theme for the high-spirited! - - # The basic colors - foreground = text; - background = bg; - selection_foreground = bg; - selection_background = text; - - # Cursor colors - cursor = text; - cursor_text_color = bg; - - # URL underline color when hovering with mouse - url_color = primary; - - # Kitty window border colors - active_border_color = primary; - inactive_border_color = bg3; - bell_border_color = urgent; - - # OS Window titlebar colors - wayland_titlebar_color = "system"; - macos_titlebar_color = "system"; - - # Tab bar colors - active_tab_foreground = bg; - active_tab_background = primary; - inactive_tab_foreground = fgdim; - inactive_tab_background = bg2; - tab_bar_background = bg; - - # Colors for marks (marked text in the terminal) - mark1_foreground = bg; - mark1_background = blue; - mark2_foreground = bg; - mark2_background = purple; - mark3_foreground = bg; - mark3_background = blue; - - # The 16 terminal colors - - # black - color0 = colors.withHashPrefix."0"; - color8 = colors.withHashPrefix."8"; - - # red - color1 = colors.withHashPrefix."1"; - color9 = colors.withHashPrefix."9"; - - # green - color2 = colors.withHashPrefix."2"; - color10 = colors.withHashPrefix."10"; - - # yellow - color3 = colors.withHashPrefix."3"; - color11 = colors.withHashPrefix."11"; - - # blue - color4 = colors.withHashPrefix."4"; - color12 = colors.withHashPrefix."12"; - - # magenta - color5 = colors.withHashPrefix."5"; - color13 = colors.withHashPrefix."13"; - - # cyan - color6 = colors.withHashPrefix."6"; - color14 = colors.withHashPrefix."14"; - - # white - color7 = colors.withHashPrefix."7"; - color15 = colors.withHashPrefix."15"; - }; - keybindings = { - "ctrl+shift+1" = "change_font_size all 12.5"; - "ctrl+shift+2" = "change_font_size all 18.5"; - "ctrl+shift+3" = "change_font_size all 26"; - "ctrl+shift+4" = "change_font_size all 32"; - "ctrl+shift+5" = "change_font_size all 48"; - "ctrl+shift+o" = "launch --type=tab --stdin-source=@screen_scrollback $EDITOR"; - - "ctrl+shift+equal" = "change_font_size all +0.5"; - "ctrl+shift+minus" = "change_font_size all -0.5"; - - "shift+insert" = "paste_from_clipboard"; - "ctrl+shift+v" = "paste_from_selection"; - "ctrl+shift+c" = "copy_to_clipboard"; - - # kill pane - "ctrl+shift+q" = "close_window"; - - # kill tab - "ctrl+alt+shift+q" = "close_tab"; - - "ctrl+shift+j" = "launch --location=hsplit --cwd=current"; - "ctrl+shift+l" = "launch --location=vsplit --cwd=current"; - - "ctrl+alt+shift+k" = "move_window up"; - "ctrl+alt+shift+h" = "move_window left"; - "ctrl+alt+shift+l" = "move_window right"; - "ctrl+alt+shift+j" = "move_window down"; - - "ctrl+h" = "neighboring_window left"; - "ctrl+l" = "neighboring_window right"; - "ctrl+k" = "neighboring_window up"; - "ctrl+j" = "neighboring_window down"; - "ctrl+shift+h" = "nth_window -1"; - "ctrl+shift+space>u" = "kitten hints --type=url --program @"; - - "ctrl+shift+z" = "toggle_layout stack"; - }; - }; -} diff --git a/lib/modules/home/niri/config.kdl b/lib/modules/home/niri/config.kdl deleted file mode 100644 index 095fc98..0000000 --- a/lib/modules/home/niri/config.kdl +++ /dev/null @@ -1,509 +0,0 @@ -// This config is in the KDL format: https://kdl.dev -// "/-" comments out the following node. -// Check the wiki for a full description of the configuration: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview - -switch-events { - lid-close { spawn "swaylock"; } - // lid-open { spawn "notify-send" "The laptop lid is open!"; } -} - -// Input device configuration. -// Find the full list of options on the wiki: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Input -input { - keyboard { - // repeat-delay 180; - // repeat-rate 120; - - xkb { - // You can set rules, model, layout, variant and options. - // For more information, see xkeyboard-config(7). - - // For example: - // layout "us,ru" - options "ctrl:nocaps" - } - } - - // Next sections include libinput settings. - // Omitting settings disables them, or leaves them at their default values. - touchpad { - // off - tap - // dwt - // dwtp - natural-scroll - // accel-speed 0.2 - // accel-profile "flat" - // scroll-method "two-finger" - // disabled-on-external-mouse - } - - mouse { - // off - // natural-scroll - // accel-speed 0.2 - // accel-profile "flat" - // scroll-method "no-scroll" - } - - trackpoint { - // off - // natural-scroll - // accel-speed 0.2 - // accel-profile "flat" - // scroll-method "on-button-down" - // scroll-button 273 - // middle-emulation - } - - // Uncomment this to make the mouse warp to the center of newly focused windows. - // warp-mouse-to-focus - - // Focus windows and outputs automatically when moving the mouse into them. - // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - // focus-follows-mouse max-scroll-amount="0%" -} - -// You can configure outputs by their name, which you can find -// by running `niri msg outputs` while inside a niri instance. -// The built-in laptop monitor is usually called "eDP-1". -// Find more information on the wiki: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs -// Remember to uncomment the node by removing "/-"! -/-output "eDP-1" { - // Uncomment this line to disable this output. - // off - - // Resolution and, optionally, refresh rate of the output. - // The format is "x" or "x@". - // If the refresh rate is omitted, niri will pick the highest refresh rate - // for the resolution. - // If the mode is omitted altogether or is invalid, niri will pick one automatically. - // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. - mode "1920x1080@120.030" - - // You can use integer or fractional scale, for example use 1.5 for 150% scale. - scale 2 - - // Transform allows to rotate the output counter-clockwise, valid values are: - // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. - transform "normal" - - // Position of the output in the global coordinate space. - // This affects directional monitor actions like "focus-monitor-left", and cursor movement. - // The cursor can only move between directly adjacent outputs. - // Output scale and rotation has to be taken into account for positioning: - // outputs are sized in logical, or scaled, pixels. - // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080, - // so to put another output directly adjacent to it on the right, set its x to 1920. - // If the position is unset or results in an overlap, the output is instead placed - // automatically. - position x=1280 y=0 -} - -// Settings that influence how windows are positioned and sized. -// Find more information on the wiki: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout -layout { - // Set gaps around windows in logical pixels. - gaps 5 - - // When to center a column when changing focus, options are: - // - "never", default behavior, focusing an off-screen column will keep at the left - // or right edge of the screen. - // - "always", the focused column will always be centered. - // - "on-overflow", focusing a column will center it if it doesn't fit - // together with the previously focused column. - center-focused-column "never" - - // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between. - preset-column-widths { - // Proportion sets the width as a fraction of the output width, taking gaps into account. - // For example, you can perfectly fit four windows sized "proportion 0.25" on an output. - // The default preset widths are 1/3, 1/2 and 2/3 of the output. - // proportion 0.33333 - proportion 0.5 - // proportion 0.66667 - - // Fixed sets the width in logical pixels exactly. - // fixed 1920 - } - - // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. - // preset-window-heights { } - - // You can change the default width of the new windows. - // default-column-width { proportion 0.5; } - // If you leave the brackets empty, the windows themselves will decide their initial width. - // default-column-width {} - - // By default focus ring and border are rendered as a solid background rectangle - // behind windows. That is, they will show up through semitransparent windows. - // This is because windows using client-side decorations can have an arbitrary shape. - // - // If you don't like that, you should uncomment `prefer-no-csd` below. - // Niri will draw focus ring and border *around* windows that agree to omit their - // client-side decorations. - // - // Alternatively, you can override it with a window rule called - // `draw-border-with-background`. - - // You can change how the focus ring looks. - focus-ring { - // Uncomment this line to disable the focus ring. - // off - - // How many logical pixels the ring extends out from the windows. - width 2 - - // Colors can be set in a variety of ways: - // - CSS named colors: "red" - // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa" - // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others. - - // Color of the ring on the active monitor. - active-color "#7fc8ff" - - // Color of the ring on inactive monitors. - inactive-color "#505050" - - // You can also use gradients. They take precedence over solid colors. - // Gradients are rendered the same as CSS linear-gradient(angle, from, to). - // The angle is the same as in linear-gradient, and is optional, - // defaulting to 180 (top-to-bottom gradient). - // You can use any CSS linear-gradient tool on the web to set these up. - // Changing the color space is also supported, check the wiki for more info. - // - // active-gradient from="#80c8ff" to="#bbddff" angle=45 - - // You can also color the gradient relative to the entire view - // of the workspace, rather than relative to just the window itself. - // To do that, set relative-to="workspace-view". - // - // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" - } - - // You can also add a border. It's similar to the focus ring, but always visible. - border { - // The settings are the same as for the focus ring. - // If you enable the border, you probably want to disable the focus ring. - off - - width 2 - active-color "#ffc87f" - inactive-color "#505050" - - // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" - // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" - } - - // Struts shrink the area occupied by windows, similarly to layer-shell panels. - // You can think of them as a kind of outer gaps. They are set in logical pixels. - // Left and right struts will cause the next window to the side to always be visible. - // Top and bottom struts will simply add outer gaps in addition to the area occupied by - // layer-shell panels and regular gaps. - struts { - // left 64 - // right 64 - // top 64 - // bottom 64 - } -} - -// Add lines like this to spawn processes at startup. -// Note that running niri as a session supports xdg-desktop-autostart, -// which may be more convenient to use. -// See the binds section below for more spawn examples. -spawn-at-startup "wezterm" -spawn-at-startup "firefox" -spawn-at-startup "mako" -spawn-at-startup "swayosd-server" -spawn-at-startup "swaybg -i ~/.wallpaper" - -// Uncomment this line to ask the clients to omit their client-side decorations if possible. -// If the client will specifically ask for CSD, the request will be honored. -// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. -// This option will also fix border/focus ring drawing behind some semitransparent windows. -// After enabling or disabling this, you need to restart the apps for this to take effect. -// prefer-no-csd - -// You can change the path where screenshots are saved. -// A ~ at the front will be expanded to the home directory. -// The path is formatted with strftime(3) to give you the screenshot date and time. -screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" - -// You can also set this to null to disable saving screenshots to disk. -// screenshot-path null - -// Animation settings. -// The wiki explains how to configure individual animations: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations -animations { - // Uncomment to turn off all animations. - // off - - // Slow down all animations by this factor. Values below 1 speed them up instead. - // slowdown 3.0 -} - -// Window rules let you adjust behavior for individual windows. -// Find more information on the wiki: -// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules - -// Work around WezTerm's initial configure bug -// by setting an empty default-column-width. -/-window-rule { - // This regular expression is intentionally made as specific as possible, - // since this is the default config, and we want no false positives. - // You can get away with just app-id="wezterm" if you want. - match app-id=r#"^org\.wezfurlong\.wezterm$"# - default-column-width {} -} - -// Example: block out two password managers from screen capture. -// (This example rule is commented out with a "/-" in front.) -/-window-rule { - match app-id=r#"^org\.keepassxc\.KeePassXC$"# - match app-id=r#"^org\.gnome\.World\.Secrets$"# - - block-out-from "screen-capture" - - // Use this instead if you want them visible on third-party screenshot tools. - // block-out-from "screencast" -} - -// Example: enable rounded corners for all windows. -// (This example rule is commented out with a "/-" in front.) -window-rule { - geometry-corner-radius 10 - clip-to-geometry true -} - -binds { - // Keys consist of modifiers separated by + signs, followed by an XKB key name - // in the end. To find an XKB name for a particular key, you may use a program - // like wev. - // - // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt - // when running as a winit window. - // - // Most actions that you can bind here can also be invoked programmatically with - // `niri msg action do-something`. - - // Mod-Shift-/, which is usually the same as Mod-?, - // shows a list of important hotkeys. - Mod+Shift+Slash { show-hotkey-overlay; } - - // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+T { spawn "wezterm"; } - Mod+Space { spawn "fuzzel"; } - Mod+D { spawn "fuzzel --drun"; } - Super+Control+Shift+L { spawn "swaylock"; } - - // You can also use a shell. Do this if you need pipes, multiple commands, etc. - // Note: the entire command goes as a single argument in the end. - // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } - - // Example volume keys mappings for PipeWire & WirePlumber. - // The allow-when-locked=true property makes them work even when the session is locked. - XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; } - XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } - - Mod+Q { close-window; } - - Mod+Left { focus-column-left; } - Mod+Down { focus-window-down; } - Mod+Up { focus-window-up; } - Mod+Right { focus-column-right; } - Mod+h { focus-column-left; } - Mod+j { focus-window-down; } - Mod+k { focus-window-up; } - Mod+l { focus-column-right; } - - Mod+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down; } - Mod+Ctrl+Up { move-window-up; } - Mod+Ctrl+Right { move-column-right; } - Mod+Ctrl+H { move-column-left; } - Mod+Ctrl+J { move-window-down; } - Mod+Ctrl+K { move-window-up; } - Mod+Ctrl+L { move-column-right; } - - // Alternative commands that move across workspaces when reaching - // the first or last window in a column. - // Mod+j { focus-window-or-workspace-down; } - // Mod+K { focus-window-or-workspace-up; } - // Mod+L { focus-window-or-workspace-right; } - // Mod+h { focus-window-or-workspace-left; } - // Mod+Ctrl+J { move-window-down-or-to-workspace-down; } - // Mod+Ctrl+K { move-window-up-or-to-workspace-up; } - - Mod+Home { focus-column-first; } - Mod+End { focus-column-last; } - Mod+Ctrl+Home { move-column-to-first; } - Mod+Ctrl+End { move-column-to-last; } - - Mod+Shift+Left { focus-monitor-left; } - Mod+Shift+Down { focus-monitor-down; } - Mod+Shift+Up { focus-monitor-up; } - Mod+Shift+Right { focus-monitor-right; } - Mod+Shift+H { focus-monitor-left; } - Mod+Shift+J { focus-monitor-down; } - Mod+Shift+K { focus-monitor-up; } - Mod+Shift+L { focus-monitor-right; } - - Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } - Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } - Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } - Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } - Mod+Shift+Ctrl+H { move-column-to-monitor-left; } - Mod+Shift+Ctrl+J { move-column-to-monitor-down; } - Mod+Shift+Ctrl+K { move-column-to-monitor-up; } - Mod+Shift+Ctrl+L { move-column-to-monitor-right; } - - // Alternatively, there are commands to move just a single window: - // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } - // ... - - // And you can also move a whole workspace to another monitor: - // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } - // ... - - Mod+Page_Down { focus-workspace-down; } - Mod+Page_Up { focus-workspace-up; } - Mod+U { focus-workspace-down; } - Mod+I { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - Mod+Ctrl+U { move-column-to-workspace-down; } - Mod+Ctrl+I { move-column-to-workspace-up; } - - // Alternatively, there are commands to move just a single window: - // Mod+Ctrl+Page_Down { move-window-to-workspace-down; } - // ... - - Mod+Shift+Page_Down { move-workspace-down; } - Mod+Shift+Page_Up { move-workspace-up; } - Mod+Shift+U { move-workspace-down; } - Mod+Shift+I { move-workspace-up; } - - // You can bind mouse wheel scroll ticks using the following syntax. - // These binds will change direction based on the natural-scroll setting. - // - // To avoid scrolling through workspaces really fast, you can use - // the cooldown-ms property. The bind will be rate-limited to this value. - // You can set a cooldown on any bind, but it's most useful for the wheel. - Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } - Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } - Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; } - Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; } - - Mod+WheelScrollRight { focus-column-right; } - Mod+WheelScrollLeft { focus-column-left; } - Mod+Ctrl+WheelScrollRight { move-column-right; } - Mod+Ctrl+WheelScrollLeft { move-column-left; } - - // Usually scrolling up and down with Shift in applications results in - // horizontal scrolling; these binds replicate that. - Mod+Shift+WheelScrollDown { focus-column-right; } - Mod+Shift+WheelScrollUp { focus-column-left; } - Mod+Ctrl+Shift+WheelScrollDown { move-column-right; } - Mod+Ctrl+Shift+WheelScrollUp { move-column-left; } - - // Similarly, you can bind touchpad scroll "ticks". - // Touchpad scrolling is continuous, so for these binds it is split into - // discrete intervals. - // These binds are also affected by touchpad's natural-scroll, so these - // example binds are "inverted", since we have natural-scroll enabled for - // touchpads by default. - // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } - // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } - - // You can refer to workspaces by index. However, keep in mind that - // niri is a dynamic workspace system, so these commands are kind of - // "best effort". Trying to refer to a workspace index bigger than - // the current workspace count will instead refer to the bottommost - // (empty) workspace. - // - // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on - // will all refer to the 3rd workspace. - Mod+1 { focus-workspace 1; } - Mod+2 { focus-workspace 2; } - Mod+3 { focus-workspace 3; } - Mod+4 { focus-workspace 4; } - Mod+5 { focus-workspace 5; } - Mod+6 { focus-workspace 6; } - Mod+7 { focus-workspace 7; } - Mod+8 { focus-workspace 8; } - Mod+9 { focus-workspace 9; } - Mod+Ctrl+1 { move-column-to-workspace 1; } - Mod+Ctrl+2 { move-column-to-workspace 2; } - Mod+Ctrl+3 { move-column-to-workspace 3; } - Mod+Ctrl+4 { move-column-to-workspace 4; } - Mod+Ctrl+5 { move-column-to-workspace 5; } - Mod+Ctrl+6 { move-column-to-workspace 6; } - Mod+Ctrl+7 { move-column-to-workspace 7; } - Mod+Ctrl+8 { move-column-to-workspace 8; } - Mod+Ctrl+9 { move-column-to-workspace 9; } - - // Alternatively, there are commands to move just a single window: - // Mod+Ctrl+1 { move-window-to-workspace 1; } - - // Switches focus between the current and the previous workspace. - Mod+Tab { focus-workspace-previous; } - - // Consume one window from the right into the focused column. - Mod+Comma { consume-window-into-column; } - // Expel one window from the focused column to the right. - Mod+Period { expel-window-from-column; } - - // There are also commands that consume or expel a single window to the side. - Mod+BracketLeft { consume-or-expel-window-left; } - Mod+BracketRight { consume-or-expel-window-right; } - - Mod+R { switch-preset-column-width; } - Mod+Shift+R { switch-preset-window-height; } - Mod+Ctrl+R { reset-window-height; } - Mod+F { maximize-column; } - Mod+Shift+F { fullscreen-window; } - Mod+C { center-column; } - - // Finer width adjustments. - // This command can also: - // * set width in pixels: "1000" - // * adjust width in pixels: "-5" or "+5" - // * set width as a percentage of screen width: "25%" - // * adjust width as a percentage of screen width: "-10%" or "+10%" - // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, - // set-column-width "100" will make the column occupy 200 physical screen pixels. - Mod+Minus { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } - - // Finer height adjustments when in column with other windows. - Mod+Shift+Minus { set-window-height "-10%"; } - Mod+Shift+Equal { set-window-height "+10%"; } - - // Actions to switch layouts. - // Note: if you uncomment these, make sure you do NOT have - // a matching layout switch hotkey configured in xkb options above. - // Having both at once on the same hotkey will break the switching, - // since it will switch twice upon pressing the hotkey (once by xkb, once by niri). - // Mod+Space { switch-layout "next"; } - // Mod+Shift+Space { switch-layout "prev"; } - - Print { screenshot; } - Ctrl+Print { screenshot-screen; } - Alt+Print { screenshot-window; } - - // The quit action will show a confirmation dialog to avoid accidental exits. - Mod+Shift+E { quit; } - Ctrl+Alt+Delete { quit; } - - // Powers off the monitors. To turn them back on, do any input like - // moving the mouse or pressing any other key. - Mod+Shift+P { power-off-monitors; } -} diff --git a/lib/modules/home/plasma-manager.nix b/lib/modules/home/plasma-manager.nix deleted file mode 100644 index d204ddc..0000000 --- a/lib/modules/home/plasma-manager.nix +++ /dev/null @@ -1,287 +0,0 @@ -{ - programs.plasma = { - enable = true; - shortcuts = { - "ActivityManager"."switch-to-activity-851c180f-d52d-4fe4-b7ed-a10e70cf4ce8" = [ ]; - # "KDE Keyboard Layout Switcher"."Switch to Last-Used Keyboard Layout" = "Meta+Alt+L"; - # "KDE Keyboard Layout Switcher"."Switch to Next Keyboard Layout" = "Meta+Alt+K"; - # "kaccess"."Toggle Screen Reader On and Off" = "Meta+Alt+S"; - # "kcm_touchpad"."Disable Touchpad" = "Touchpad Off"; - # "kcm_touchpad"."Enable Touchpad" = "Touchpad On"; - # "kcm_touchpad"."Toggle Touchpad" = ["Touchpad Toggle" "Meta+Ctrl+Zenkaku Hankaku,Touchpad Toggle" "Meta+Ctrl+Zenkaku Hankaku"]; - # "kmix"."decrease_microphone_volume" = "Microphone Volume Down"; - "kmix"."decrease_volume" = "Volume Down"; - "kmix"."decrease_volume_small" = "Shift+Volume Down"; - "kmix"."increase_microphone_volume" = "Microphone Volume Up"; - "kmix"."increase_volume" = "Volume Up"; - "kmix"."increase_volume_small" = "Shift+Volume Up"; - "kmix"."mic_mute" = [ - "Microphone Mute" - "Meta+Volume Mute,Microphone Mute" - "Meta+Shift+V" - "Meta+Volume Mute,Mute Microphone" - ]; - "kmix"."mute" = "Volume Mute"; - # "ksmserver"."Halt Without Confirmation" = "none,,Shut Down Without Confirmation"; - "ksmserver"."Lock Session" = [ - "Meta+Ctrl+Shift+L" - "Screensaver,Meta+L" - "Screensaver,Lock Session" - ]; - # "ksmserver"."Log Out" = "Ctrl+Alt+Del"; - # "ksmserver"."Log Out Without Confirmation" = "none,,Log Out Without Confirmation"; - # "ksmserver"."LogOut" = "none,,Log Out"; - # "ksmserver"."Reboot" = "none,,Reboot"; - # "ksmserver"."Reboot Without Confirmation" = "none,,Reboot Without Confirmation"; - # "ksmserver"."Shut Down" = "none,,Shut Down"; - # "kwin"."Activate Window Demanding Attention" = "Meta+Ctrl+A"; - # "kwin"."Cycle Overview" = []; - # "kwin"."Cycle Overview Opposite" = []; - # "kwin"."Decrease Opacity" = "none,,Decrease Opacity of Active Window by 5%"; - # "kwin"."Edit Tiles" = "Meta+T"; - "kwin"."Expose" = "Ctrl+F9"; - "kwin"."ExposeAll" = [ - "Ctrl+F10" - "Launch (C),Ctrl+F10" - "Launch (C),Toggle Present Windows (All desktops)" - ]; - "kwin"."ExposeClass" = "Ctrl+F7"; - "kwin"."ExposeClassCurrentDesktop" = [ ]; - "kwin"."Grid View" = "Meta+G"; - "kwin"."Increase Opacity" = "none,,Increase Opacity of Active Window by 5%"; - "kwin"."Kill Window" = "Meta+Ctrl+Esc"; - "kwin"."Move Tablet to Next Output" = [ ]; - "kwin"."MoveMouseToCenter" = "Meta+F6"; - "kwin"."MoveMouseToFocus" = "Meta+F5"; - "kwin"."MoveZoomDown" = [ ]; - "kwin"."MoveZoomLeft" = [ ]; - "kwin"."MoveZoomRight" = [ ]; - "kwin"."MoveZoomUp" = [ ]; - "kwin"."Overview" = "Meta+W"; - "kwin"."Setup Window Shortcut" = "none,,Setup Window Shortcut"; - "kwin"."Show Desktop" = "Meta+D"; - "kwin"."Switch One Desktop Down" = "Meta+Ctrl+Down"; - "kwin"."Switch One Desktop Up" = "Meta+Ctrl+Up"; - "kwin"."Switch One Desktop to the Left" = "Meta+Ctrl+Left"; - "kwin"."Switch One Desktop to the Right" = "Meta+Ctrl+Right"; - "kwin"."Switch Window Down" = "Meta+Alt+Down"; - "kwin"."Switch Window Left" = "Meta+Alt+Left"; - "kwin"."Switch Window Right" = "Meta+Alt+Right"; - "kwin"."Switch Window Up" = "Meta+Alt+Up"; - "kwin"."Switch to Desktop 1" = "Ctrl+F1"; - "kwin"."Switch to Desktop 10" = "none,,Switch to Desktop 10"; - "kwin"."Switch to Desktop 11" = "none,,Switch to Desktop 11"; - "kwin"."Switch to Desktop 12" = "none,,Switch to Desktop 12"; - "kwin"."Switch to Desktop 13" = "none,,Switch to Desktop 13"; - "kwin"."Switch to Desktop 14" = "none,,Switch to Desktop 14"; - "kwin"."Switch to Desktop 15" = "none,,Switch to Desktop 15"; - "kwin"."Switch to Desktop 16" = "none,,Switch to Desktop 16"; - "kwin"."Switch to Desktop 17" = "none,,Switch to Desktop 17"; - "kwin"."Switch to Desktop 18" = "none,,Switch to Desktop 18"; - "kwin"."Switch to Desktop 19" = "none,,Switch to Desktop 19"; - "kwin"."Switch to Desktop 2" = "Ctrl+F2"; - "kwin"."Switch to Desktop 20" = "none,,Switch to Desktop 20"; - "kwin"."Switch to Desktop 3" = "Ctrl+F3"; - "kwin"."Switch to Desktop 4" = "Ctrl+F4"; - "kwin"."Switch to Desktop 5" = "none,,Switch to Desktop 5"; - "kwin"."Switch to Desktop 6" = "none,,Switch to Desktop 6"; - "kwin"."Switch to Desktop 7" = "none,,Switch to Desktop 7"; - "kwin"."Switch to Desktop 8" = "none,,Switch to Desktop 8"; - "kwin"."Switch to Desktop 9" = "none,,Switch to Desktop 9"; - "kwin"."Switch to Next Desktop" = "none,,Switch to Next Desktop"; - "kwin"."Switch to Next Screen" = "none,,Switch to Next Screen"; - "kwin"."Switch to Previous Desktop" = "none,,Switch to Previous Desktop"; - "kwin"."Switch to Previous Screen" = "none,,Switch to Previous Screen"; - "kwin"."Switch to Screen 0" = "none,,Switch to Screen 0"; - "kwin"."Switch to Screen 1" = "none,,Switch to Screen 1"; - "kwin"."Switch to Screen 2" = "none,,Switch to Screen 2"; - "kwin"."Switch to Screen 3" = "none,,Switch to Screen 3"; - "kwin"."Switch to Screen 4" = "none,,Switch to Screen 4"; - "kwin"."Switch to Screen 5" = "none,,Switch to Screen 5"; - "kwin"."Switch to Screen 6" = "none,,Switch to Screen 6"; - "kwin"."Switch to Screen 7" = "none,,Switch to Screen 7"; - "kwin"."Switch to Screen Above" = "none,,Switch to Screen Above"; - "kwin"."Switch to Screen Below" = "none,,Switch to Screen Below"; - "kwin"."Switch to Screen to the Left" = "none,,Switch to Screen to the Left"; - "kwin"."Switch to Screen to the Right" = "none,,Switch to Screen to the Right"; - "kwin"."Toggle Night Color" = [ ]; - "kwin"."Toggle Window Raise/Lower" = "none,,Toggle Window Raise/Lower"; - "kwin"."Walk Through Windows" = "Alt+Tab"; - "kwin"."Walk Through Windows (Reverse)" = "Alt+Shift+Tab"; - "kwin"."Walk Through Windows Alternative" = "none,,Walk Through Windows Alternative"; - "kwin"."Walk Through Windows Alternative (Reverse)" = - "none,,Walk Through Windows Alternative (Reverse)"; - "kwin"."Walk Through Windows of Current Application" = "Alt+`"; - "kwin"."Walk Through Windows of Current Application (Reverse)" = "Alt+~"; - "kwin"."Walk Through Windows of Current Application Alternative" = - "none,,Walk Through Windows of Current Application Alternative"; - "kwin"."Walk Through Windows of Current Application Alternative (Reverse)" = - "none,,Walk Through Windows of Current Application Alternative (Reverse)"; - "kwin"."Window Above Other Windows" = "none,,Keep Window Above Others"; - "kwin"."Window Below Other Windows" = "none,,Keep Window Below Others"; - "kwin"."Window Close" = "Alt+F4"; - "kwin"."Window Fullscreen" = "none,,Make Window Fullscreen"; - "kwin"."Window Grow Horizontal" = "none,,Expand Window Horizontally"; - "kwin"."Window Grow Vertical" = "none,,Expand Window Vertically"; - "kwin"."Window Lower" = "none,,Lower Window"; - "kwin"."Window Maximize" = "Meta+PgUp"; - "kwin"."Window Maximize Horizontal" = "none,,Maximize Window Horizontally"; - "kwin"."Window Maximize Vertical" = "none,,Maximize Window Vertically"; - "kwin"."Window Minimize" = "Meta+PgDown"; - "kwin"."Window Move" = "none,,Move Window"; - "kwin"."Window Move Center" = "none,,Move Window to the Center"; - "kwin"."Window No Border" = "none,,Toggle Window Titlebar and Frame"; - "kwin"."Window On All Desktops" = "none,,Keep Window on All Desktops"; - "kwin"."Window One Desktop Down" = "Meta+Ctrl+Shift+Down"; - "kwin"."Window One Desktop Up" = "Meta+Ctrl+Shift+Up"; - "kwin"."Window One Desktop to the Left" = "Meta+Ctrl+Shift+Left"; - "kwin"."Window One Desktop to the Right" = "Meta+Ctrl+Shift+Right"; - "kwin"."Window One Screen Down" = "none,,Move Window One Screen Down"; - "kwin"."Window One Screen Up" = "none,,Move Window One Screen Up"; - "kwin"."Window One Screen to the Left" = "none,,Move Window One Screen to the Left"; - "kwin"."Window One Screen to the Right" = "none,,Move Window One Screen to the Right"; - "kwin"."Window Operations Menu" = "Alt+F3"; - "kwin"."Window Pack Down" = "none,,Move Window Down"; - "kwin"."Window Pack Left" = "none,,Move Window Left"; - "kwin"."Window Pack Right" = "none,,Move Window Right"; - "kwin"."Window Pack Up" = "none,,Move Window Up"; - "kwin"."Window Quick Tile Bottom" = "Meta+Down"; - "kwin"."Window Quick Tile Bottom Left" = "none,,Quick Tile Window to the Bottom Left"; - "kwin"."Window Quick Tile Bottom Right" = "none,,Quick Tile Window to the Bottom Right"; - "kwin"."Window Quick Tile Left" = "Meta+Left"; - "kwin"."Window Quick Tile Right" = "Meta+Right"; - "kwin"."Window Quick Tile Top" = "Meta+Up"; - "kwin"."Window Quick Tile Top Left" = "none,,Quick Tile Window to the Top Left"; - "kwin"."Window Quick Tile Top Right" = "none,,Quick Tile Window to the Top Right"; - "kwin"."Window Raise" = "none,,Raise Window"; - "kwin"."Window Resize" = "none,,Resize Window"; - "kwin"."Window Shade" = "none,,Shade Window"; - "kwin"."Window Shrink Horizontal" = "none,,Shrink Window Horizontally"; - "kwin"."Window Shrink Vertical" = "none,,Shrink Window Vertically"; - "kwin"."Window to Desktop 1" = "none,,Window to Desktop 1"; - "kwin"."Window to Desktop 10" = "none,,Window to Desktop 10"; - "kwin"."Window to Desktop 11" = "none,,Window to Desktop 11"; - "kwin"."Window to Desktop 12" = "none,,Window to Desktop 12"; - "kwin"."Window to Desktop 13" = "none,,Window to Desktop 13"; - "kwin"."Window to Desktop 14" = "none,,Window to Desktop 14"; - "kwin"."Window to Desktop 15" = "none,,Window to Desktop 15"; - "kwin"."Window to Desktop 16" = "none,,Window to Desktop 16"; - "kwin"."Window to Desktop 17" = "none,,Window to Desktop 17"; - "kwin"."Window to Desktop 18" = "none,,Window to Desktop 18"; - "kwin"."Window to Desktop 19" = "none,,Window to Desktop 19"; - "kwin"."Window to Desktop 2" = "none,,Window to Desktop 2"; - "kwin"."Window to Desktop 20" = "none,,Window to Desktop 20"; - "kwin"."Window to Desktop 3" = "none,,Window to Desktop 3"; - "kwin"."Window to Desktop 4" = "none,,Window to Desktop 4"; - "kwin"."Window to Desktop 5" = "none,,Window to Desktop 5"; - "kwin"."Window to Desktop 6" = "none,,Window to Desktop 6"; - "kwin"."Window to Desktop 7" = "none,,Window to Desktop 7"; - "kwin"."Window to Desktop 8" = "none,,Window to Desktop 8"; - "kwin"."Window to Desktop 9" = "none,,Window to Desktop 9"; - "kwin"."Window to Next Desktop" = "none,,Window to Next Desktop"; - "kwin"."Window to Next Screen" = "Meta+Shift+Right"; - "kwin"."Window to Previous Desktop" = "none,,Window to Previous Desktop"; - "kwin"."Window to Previous Screen" = "Meta+Shift+Left"; - "kwin"."Window to Screen 0" = "none,,Move Window to Screen 0"; - "kwin"."Window to Screen 1" = "none,,Move Window to Screen 1"; - "kwin"."Window to Screen 2" = "none,,Move Window to Screen 2"; - "kwin"."Window to Screen 3" = "none,,Move Window to Screen 3"; - "kwin"."Window to Screen 4" = "none,,Move Window to Screen 4"; - "kwin"."Window to Screen 5" = "none,,Move Window to Screen 5"; - "kwin"."Window to Screen 6" = "none,,Move Window to Screen 6"; - "kwin"."Window to Screen 7" = "none,,Move Window to Screen 7"; - "kwin"."view_actual_size" = "Meta+0"; - "kwin"."view_zoom_in" = [ - "Meta++" - "Meta+=,Meta++" - "Meta+=,Zoom In" - ]; - "kwin"."view_zoom_out" = "Meta+-"; - "mediacontrol"."mediavolumedown" = "none,,Media volume down"; - "mediacontrol"."mediavolumeup" = "none,,Media volume up"; - "mediacontrol"."nextmedia" = "Media Next"; - "mediacontrol"."pausemedia" = "Media Pause"; - "mediacontrol"."playmedia" = "none,,Play media playback"; - "mediacontrol"."playpausemedia" = "Media Play"; - "mediacontrol"."previousmedia" = "Media Previous"; - "mediacontrol"."stopmedia" = "Media Stop"; - "org_kde_powerdevil"."Decrease Keyboard Brightness" = "Keyboard Brightness Down"; - "org_kde_powerdevil"."Decrease Screen Brightness" = "Monitor Brightness Down"; - "org_kde_powerdevil"."Decrease Screen Brightness Small" = "Shift+Monitor Brightness Down"; - "org_kde_powerdevil"."Hibernate" = "Hibernate"; - "org_kde_powerdevil"."Increase Keyboard Brightness" = "Keyboard Brightness Up"; - "org_kde_powerdevil"."Increase Screen Brightness" = "Monitor Brightness Up"; - "org_kde_powerdevil"."Increase Screen Brightness Small" = "Shift+Monitor Brightness Up"; - "org_kde_powerdevil"."PowerDown" = "Power Down"; - "org_kde_powerdevil"."PowerOff" = "Power Off"; - "org_kde_powerdevil"."Sleep" = "Sleep"; - "org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off"; - "org_kde_powerdevil"."Turn Off Screen" = [ ]; - "org_kde_powerdevil"."powerProfile" = [ - "Battery" - "Meta+B,Battery" - "Meta+B,Switch Power Profile" - ]; - "plasmashell"."activate application launcher" = [ - "Meta" - "Alt+F1,Meta" - "Alt+F1,Activate Application Launcher" - ]; - "plasmashell"."activate task manager entry 1" = "Meta+1"; - "plasmashell"."activate task manager entry 10" = "none,Meta+0,Activate Task Manager Entry 10"; - "plasmashell"."activate task manager entry 2" = "Meta+2"; - "plasmashell"."activate task manager entry 3" = "Meta+3"; - "plasmashell"."activate task manager entry 4" = "Meta+4"; - "plasmashell"."activate task manager entry 5" = "Meta+5"; - "plasmashell"."activate task manager entry 6" = "Meta+6"; - "plasmashell"."activate task manager entry 7" = "Meta+7"; - "plasmashell"."activate task manager entry 8" = "Meta+8"; - "plasmashell"."activate task manager entry 9" = "Meta+9"; - "plasmashell"."clear-history" = "none,,Clear Clipboard History"; - "plasmashell"."clipboard_action" = "Meta+Ctrl+X"; - "plasmashell"."cycle-panels" = "Meta+Alt+P"; - "plasmashell"."cycleNextAction" = "none,,Next History Item"; - "plasmashell"."cyclePrevAction" = "none,,Previous History Item"; - "plasmashell"."manage activities" = "Meta+Q"; - "plasmashell"."next activity" = "Meta+A,none,Walk through activities"; - "plasmashell"."previous activity" = "Meta+Shift+A,none,Walk through activities (Reverse)"; - "plasmashell"."repeat_action" = "none,Meta+Ctrl+R,Manually Invoke Action on Current Clipboard"; - "plasmashell"."show dashboard" = "Ctrl+F12"; - "plasmashell"."show-barcode" = "none,,Show Barcode…"; - "plasmashell"."show-on-mouse-pos" = "Meta+V"; - "plasmashell"."stop current activity" = "Meta+S"; - "plasmashell"."switch to next activity" = "none,,Switch to Next Activity"; - "plasmashell"."switch to previous activity" = "none,,Switch to Previous Activity"; - "plasmashell"."toggle do not disturb" = "none,,Toggle do not disturb"; - }; - configFile = { - "baloofilerc"."General"."dbVersion" = 2; - "baloofilerc"."General"."exclude filters" = - "*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.tfstate*,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.terraform,.venv,venv,core-dumps,lost+found"; - "baloofilerc"."General"."exclude filters version" = 9; - "dolphinrc"."General"."ViewPropsTimestamp" = "2025,1,11,13,50,1.5779999999999998"; - "dolphinrc"."KFileDialog Settings"."Places Icons Auto-resize" = false; - "dolphinrc"."KFileDialog Settings"."Places Icons Static Size" = 22; - "kactivitymanagerdrc"."activities"."851c180f-d52d-4fe4-b7ed-a10e70cf4ce8" = "Default"; - "kactivitymanagerdrc"."main"."currentActivity" = "851c180f-d52d-4fe4-b7ed-a10e70cf4ce8"; - "kded5rc"."Module-device_automounter"."autoload" = false; - "kdeglobals"."WM"."activeBackground" = "49,54,59"; - "kdeglobals"."WM"."activeBlend" = "252,252,252"; - "kdeglobals"."WM"."activeForeground" = "252,252,252"; - "kdeglobals"."WM"."inactiveBackground" = "42,46,50"; - "kdeglobals"."WM"."inactiveBlend" = "161,169,177"; - "kdeglobals"."WM"."inactiveForeground" = "161,169,177"; - "kwalletrc"."Wallet"."First Use" = false; - "kwinrc"."Desktops"."Id_1" = "75f95093-aa81-4dfd-9013-8c7489e1eed5"; - "kwinrc"."Desktops"."Number" = 1; - "kwinrc"."Desktops"."Rows" = 1; - "kwinrc"."Tiling"."padding" = 4; - "kwinrc"."Tiling/f18ce12b-2106-508f-9542-e4e6c6fbf75f"."tiles" = - "{\"layoutDirection\":\"horizontal\",\"tiles\":[{\"width\":0.25},{\"width\":0.5},{\"width\":0.25}]}"; - "kwinrc"."Xwayland"."Scale" = 1.75; - "plasma-localerc"."Formats"."LANG" = "en_US.UTF-8"; - }; - dataFile = { - }; - }; -} diff --git a/lib/modules/home/sway-laptop.nix b/lib/modules/home/sway-laptop.nix deleted file mode 100644 index b83bd34..0000000 --- a/lib/modules/home/sway-laptop.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - wayland.windowManager.sway = { - # TODO: firefox initial open on workspace 2 - # TODO: kitty initial open on workspace 1 - }; -} diff --git a/lib/modules/home/sway.nix b/lib/modules/home/sway.nix deleted file mode 100644 index e49ad93..0000000 --- a/lib/modules/home/sway.nix +++ /dev/null @@ -1,421 +0,0 @@ -{ - style, - lib, - config, - ... -}: -{ - programs.foot = { - enable = true; - }; - - xdg = { - enable = true; - mimeApps = { - enable = true; - defaultApplications = { - "x-scheme-handler/http" = "firefox.desktop"; - "x-scheme-handler/https" = "firefox.desktop"; - }; - }; - }; - - wayland.windowManager.sway = { - /* - TODO: - + Super+r should rotate the selected group of windows. - + Super+Control+{1-9} should control the size of the preselect space. - + Super+Shift+b should balance the size of all selected nodes. - set $tilers "(wezterm.*|kitty.*|firefox.*|slack.*|Slack.*|thunar.*|Alacritty.*|alacritty.*|Discord.*|discord.*)" - for_window [title=".*"] floating enable - for_window [app_id=$tilers] floating disable - - # for_window [title=".*"] opacity $opacity - - # TODO: I forget why I needed this - could google it I expect? - exec /usr/lib/polkit-kde-authentication-agent-1 - - # prevent all windows from stealing focus - no_focus [class=".*"] - */ - - enable = true; - - systemd = { - enable = true; - variables = [ - "DISPLAY" - "WAYLAND_DISPLAY" - "SWAYSOCK" - "XDG_CURRENT_DESKTOP" - "XDG_SESSION_TYPE" - "NIXOS_OZONE_WL" - "XCURSOR_THEME" - "XCURSOR_SIZE" - "PATH" - ]; - }; - - # TODO: stuff is opening on workspace 10 (0?) - extraConfig = '' - exec --no-startup-id { - swaymsg "workspace 1" - } - - set $tilers "(wezterm.*|kitty.*|firefox.*|[Ss]lack.*|thunar.*|[Aa]lacritty.*|[Dd]iscord.*)" - for_window [title=".*"] floating enable - for_window [app_id=$tilers] floating disable - ''; - config = { - defaultWorkspace = "1"; - - workspaceOutputAssign = [ - /* - { - output = "eDP"; - workspace = "1"; - */ - ]; - - # TODO: popup_during_fullscreen smart - focus = { - wrapping = "no"; # maybe workspace? - followMouse = "no"; - mouseWarping = false; - }; - - modifier = "Mod4"; - - gaps = { - smartBorders = "on"; - }; - - window = { - border = 2; - titlebar = false; - }; - - floating = { - modifier = config.wayland.windowManager.sway.config.modifier; - titlebar = false; - }; - - startup = [ - { command = "kdeconnect-indicator"; } - { command = "mako"; } - { - command = "swaybg -i $HOME/.wallpaper"; - } - { - command = "swayosd-server"; - } - { - command = "waybar"; - } - { - command = lib.concatStringsSep " " [ - "swayidle -w" - "before-sleep 'swaylock'" - "timeout 300 'notify-send \"Idling in 5 minutes\"' resume 'notify-send \"Idling cancelled.\"'" - "timeout 480 'notify-send -u critical \"Idling in 2 minutes\"'" - "timeout 510 'notify-send -u critical \"Idling in 90 seconds\"'" - "timeout 540 'notify-send -u critical \"Idling in 60 seconds!\"'" - "timeout 570 'notify-send -u critical \"Idling in 30 seconds!\"'" - "timeout 590 'notify-send -u critical \"Idling in 10 seconds!\"'" - "timeout 591 'notify-send -u critical \"Idling in 9 seconds!\"'" - "timeout 592 'notify-send -u critical \"Idling in 8 seconds!\"'" - "timeout 593 'notify-send -u critical \"Idling in 7 seconds!\"'" - "timeout 594 'notify-send -u critical \"Idling in 6 seconds!\"'" - "timeout 595 'notify-send -u critical \"Idling in 5 seconds!\"'" - "timeout 596 'notify-send -u critical \"Idling in 4 seconds!\"'" - "timeout 597 'notify-send -u critical \"Idling in 3 seconds!\"'" - "timeout 598 'notify-send -u critical \"Idling in 2 seconds!\"'" - "timeout 599 'notify-send -u critical \"Idling in 1 second!\"'" - "timeout 600 'swaylock -f'" - "timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'" - ]; - } - # {command = "firefox";} - # {command = "wezterm";} - ]; - - modes = { - resize = { - "h" = "resize shrink width 10 px or 10 ppt"; - "j" = "resize grow height 10 px or 10 ppt"; - "k" = "resize shrink height 10 px or 10 ppt"; - "l" = "resize grow width 10 px or 10 ppt"; - - "left" = "resize shrink width 10 px or 10 ppt"; - "down" = "resize grow height 10 px or 10 ppt"; - "up" = "resize shrink height 10 px or 10 ppt"; - "right" = "resize grow width 10 px or 10 ppt"; - - "return" = ''mode "default"''; - "escape" = ''mode "default"''; - }; - }; - - input = { - "type:keyboard" = { - xkb_options = "ctrl:nocaps"; - repeat_delay = "180"; - repeat_rate = "100"; - }; - - "type:pointer" = { - accel_profile = "flat"; - pointer_accel = "0.5"; - }; - - "type:touchpad" = { - dwt = "disabled"; - tap = "enabled"; - natural_scroll = "enabled"; - middle_emulation = "enabled"; - # pointer_accel - }; - }; - keybindings = - let - mod = config.wayland.windowManager.sway.config.modifier; - menu = "tofi-run | xargs swaymsg exec --"; - in - { - "${mod}+control+space" = "exec makoctl dismiss"; - "${mod}+shift+space" = "exec makoctl invoke"; - # "${mod}+return" = "exec kitty --single-instance"; - "${mod}+return" = "exec wezterm"; - "${mod}+shift+return" = "exec floating-term"; - "${mod}+shift+alt+return" = "exec kitty"; - "${mod}+c" = "kill"; - "${mod}+shift+c" = "kill # TODO: kill -9?"; - "${mod}+alt+space" = "exec wofi --show drun"; - "${mod}" = "exec ${menu}"; - "${mod}+space" = "exec ${menu}"; - "${mod}+shift+s" = "exec clipshot"; - "${mod}+e" = "exec thunar"; - "${mod}+shift+r" = "reload"; - "${mod}+control+Escape" = "exit"; - "${mod}+shift+e" = "exit"; - "${mod}+shift+p" = "exec pass-chooser"; - "${mod}+control+j" = "split v"; - "${mod}+control+l" = "split h"; - "${mod}+control+f" = "focus mode_toggle"; - - "${mod}+h" = "focus left"; - "${mod}+j" = "focus down"; - "${mod}+k" = "focus up"; - "${mod}+l" = "focus right"; - - "${mod}+left" = "focus left"; - "${mod}+down" = "focus down"; - "${mod}+up" = "focus up"; - "${mod}+right" = "focus right"; - - "${mod}+shift+h" = "move left"; - "${mod}+shift+j" = "move down"; - "${mod}+shift+k" = "move up"; - "${mod}+shift+l" = "move right"; - - "${mod}+shift+left" = "move left"; - "${mod}+shift+down" = "move down"; - "${mod}+shift+up" = "move up"; - "${mod}+shift+right" = "move right"; - - "${mod}+1" = "workspace 1"; - "${mod}+2" = "workspace 2"; - "${mod}+3" = "workspace 3"; - "${mod}+4" = "workspace 4"; - "${mod}+5" = "workspace 5"; - "${mod}+6" = "workspace 6"; - "${mod}+7" = "workspace 7"; - "${mod}+8" = "workspace 8"; - "${mod}+9" = "workspace 9"; - "${mod}+0" = "workspace 10"; - - "${mod}+shift+1" = "move container to workspace 1"; - "${mod}+shift+2" = "move container to workspace 2"; - "${mod}+shift+3" = "move container to workspace 3"; - "${mod}+shift+4" = "move container to workspace 4"; - "${mod}+shift+5" = "move container to workspace 5"; - "${mod}+shift+6" = "move container to workspace 6"; - "${mod}+shift+7" = "move container to workspace 7"; - "${mod}+shift+8" = "move container to workspace 8"; - "${mod}+shift+9" = "move container to workspace 9"; - "${mod}+shift+0" = "move container to workspace 10"; - - "${mod}+b" = "splith"; - "${mod}+v" = "splitv"; - - "${mod}+shift+f" = "fullscreen toggle"; - "${mod}+f" = "floating toggle"; - "${mod}+s" = "floating disable"; - "${mod}+alt+f" = "focus mode_toggle"; - "${mod}+p" = "focus parent"; - "${mod}+period" = "focus child"; - "${mod}+comma" = "focus child"; - - "${mod}+tab" = "workspace back_and_forth"; - "alt+tab" = "workspace back_and_forth"; - - "${mod}+minus" = "gaps inner current minus 5"; - "${mod}+plus" = "gaps inner current plus 5"; - "${mod}+control+alt+h" = "gaps horizontal current minus 5"; - "${mod}+control+alt+l" = "gaps horizontal current plus 5"; - "${mod}+control+alt+j" = "gaps vertical current minus 5"; - "${mod}+control+alt+k" = "gaps vertical current plus 5"; - - # TODO: this should also reset the horizontal and vertical gaps? - "${mod}+control+equal" = "gaps inner current set 0"; - - "${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; - "${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; - "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; - "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; - "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; - "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; - "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; - "control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; - "control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; - "XF86AudioPlay" = "exec playerctl play-pause"; - "XF86AudioNext" = "exec playerctl next"; - "XF86AudioPrev" = "exec playerctl previous"; - "--locked ${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle"; - "--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; - "--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; - "--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; - "--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; - "--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; - "--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; - "--locked control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%"; - "--locked control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%"; - "--locked XF86AudioPlay" = "exec playerctl play-pause"; - "--locked XF86AudioNext" = "exec playerctl next"; - "--locked XF86AudioPrev" = "exec playerctl previous"; - - /* - "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10"; - "XF86MonBrightnessDown" = "exec swayosd-client --brightness -10"; - "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15"; - "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15"; - "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120"; - "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120"; - "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor"; - "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor"; - "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; - "XF86MonBrightnessUp" = "exec brightnessctl set +10%"; - "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%"; - "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%"; - "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-"; - "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%"; - "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - */ - - "${mod}+control+shift+l" = "exec swaylock"; - - "${mod}+shift+alt+f" = "for_window [class=$tilers] floating toggle"; - }; - assigns = { }; - bars = [ ]; - colors = with style.colors; { - background = bg; - focused = { - background = bg; - border = primary; - childBorder = primary; - indicator = primary; - text = bg; - }; - focusedInactive = { - background = bg; - border = bg3; - childBorder = bg3; - indicator = bg; - text = bg; - }; - placeholder = { - background = bg; - border = primary; - childBorder = primary; - indicator = primary; - text = text; - }; - unfocused = { - background = bg; - border = bg3; - childBorder = bg3; - indicator = bg; - text = text; - }; - urgent = { - background = urgent; - border = urgent; - childBorder = urgent; - indicator = urgent; - text = bg; - }; - }; - }; - }; - - # this doesn't work due to weird quoting bugs AFAICT - /* - services.swayidle = let - bins = rec { - swaylock = builtins.trace "${pkgs.swaylock}/bin/swaylock" "${pkgs.swaylock}/bin/swaylock"; - swaymsg = "${pkgs.sway}/bin/swaymsg"; - notify-send = "${swaymsg} exec -- ${pkgs.libnotify}/bin/notify-send"; - }; - in (with bins; { - enable = true; - - events = [ - { - event = "before-sleep"; - command = swaylock; - } - ]; - - timeouts = [ - { - timeout = 5; - command = "${notify-send} \\\"Idling in 300 seconds\\\""; - resumeCommand = "${notify-send} \\\"Idling cancelled.\\\""; - } - { - # timeout = 540; - timeout = 6; - command = "${notify-send} 'Idling in 90 seconds'"; - } - { - # timeout = 570; - timeout = 7; - command = "${notify-send} 'Idling in 60 seconds'"; - } - { - # timeout = 600; - timeout = 8; - command = "${notify-send} 'Idling in 30 seconds...'"; - } - { - # timeout = 630; - timeout = 9; - command = "${swaylock} -f"; - } - { - # timeout = 660; - timeout = 10; - command = "${swaymsg} 'output * dpms off'"; - resumeCommand = "${swaymsg} 'output * dpms on' & ${swaymsg} exec -- maybe-good-morning &"; - } - ]; - }); - */ -} diff --git a/lib/modules/home/swaylock.nix b/lib/modules/home/swaylock.nix deleted file mode 100644 index 0e878aa..0000000 --- a/lib/modules/home/swaylock.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ style, ... }: -{ - programs.swaylock = { - enable = true; - settings = { - color = "ffffffff"; - image = "~/.wallpaper"; - font = style.font.name; - show-failed-attempts = true; - ignore-empty-password = true; - - indicator-radius = "150"; - indicator-thickness = "30"; - - inside-color = "11111100"; - inside-clear-color = "11111100"; - inside-ver-color = "11111100"; - inside-wrong-color = "11111100"; - - key-hl-color = "a1efe4"; - separator-color = "11111100"; - - line-color = "111111cc"; - line-uses-ring = true; - - ring-color = "111111cc"; - ring-clear-color = "f4bf75"; - ring-ver-color = "66d9ef"; - ring-wrong-color = "f92672"; - }; - }; -} diff --git a/lib/modules/home/waybar.nix b/lib/modules/home/waybar.nix deleted file mode 100644 index ee4f9e1..0000000 --- a/lib/modules/home/waybar.nix +++ /dev/null @@ -1,371 +0,0 @@ -{ - pkgs, - style, - ... -}: -{ - programs.waybar = { - enable = true; - settings = { - mainBar = { - "layer" = "top"; - "position" = "bottom"; - "output" = [ - "eDP-1" - "DP-3" - ]; - "height" = 50; - "modules-left" = [ - "idle_inhibitor" - "sway/workspaces" - "sway/window" - ]; - "modules-center" = [ ]; - "modules-right" = [ - "privacy" - "power-profiles-daemon" - "mpris" - ## "disk" - ## TODO: will need a custom module for Disk IO - - ## "wireplumber" # pulseaudio module is more featureful - "pulseaudio" - "network" - "cpu" - "memory" - "temperature" - "backlight" - "battery" - - "bluetooth" - "tray" - "clock" - ]; - "bluetooth" = { - "format" = ""; - "on-click" = "${pkgs.blueman}/bin/blueman-manager"; - }; - "wireplumber" = { - "format" = "{volume}% {icon}"; - "on-click" = "helvum"; - }; - "sway/workspaces" = { - "disable-scroll" = false; - "persistent_workspaces" = { - }; - "all-outputs" = true; - "format" = "{name}"; - }; - "idle_inhibitor" = { - "format" = "{icon}"; - "format-icons" = { - "activated" = "󰈈"; - "deactivated" = "󰈉"; - }; - }; - "tray" = { - "icon-size" = 24; - "spacing" = 4; - "show-passive-items" = true; - }; - "clock" = { - "interval" = 1; - "format" = "{:%a %b %d\n%H:%M:%S}"; - "justify" = "center"; - }; - "cpu" = { - "format" = "{usage}%\nCPU"; - "tooltip" = true; - "interval" = 5; - "justify" = "center"; - }; - "memory" = { - "format" = "{}%\nRAM"; - "tooltip" = true; - "interval" = 5; - "justify" = "center"; - }; - "temperature" = { - /* - "thermal-zone" = 2; - "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; - "format-critical" = "{temperatureC}°C {icon}"; - */ - "critical-threshold" = 80; - "format" = "{temperatureC}\n°C"; - "justify" = "center"; - }; - "backlight" = { - # "device" = "acpi_video1"; - "format" = "{percent}%\n{icon}"; - "format-icons" = [ - "" - "" - ]; - "justify" = "center"; - }; - "battery" = { - "states" = { - # "good" = 95; - "warning" = 30; - "critical" = 1; - }; - "tooltip-format" = "{timeTo}\n{power} watts\n{health}% health\n{cycles} cycles"; - "format" = "{icon}{capacity}%-\n{time}"; - "format-charging" = "{capacity}%+\n{time}"; - "format-plugged" = "{capacity}%=\n{time}"; - "format-alt" = "{capacity}%"; - "format-good" = ""; # An empty format will hide the module - "format-time" = "{H}:{m}"; - "justify" = "center"; - }; - "network" = { - "format-wifi" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; - "format-ethernet" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; - "format-linked" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; - "format-disconnected" = "No Network {icon}"; - "format-alt" = "{bandwidthUpBits} up \n{bandwidthDownBits} down"; - "interval" = 5; - "justify" = "right"; - }; - "mpris" = { - "format" = "{title}\nby {artist}"; - "title-len" = 64; - "artist-len" = 61; - "justify" = "center"; - }; - "pulseaudio" = { - /* - "scroll-step" = 1, # %, can be a floa; - "format" = "{volume}% {icon} {format_source}"; - "format-muted" = " {format_source}"; - */ - "format" = "{volume}%\n{format_source}"; - "format-muted" = "MUTE\n{format_source}"; - "format-bluetooth" = "{volume}%\n{format_source}"; - "format-bluetooth-muted" = "MUTE\n{format_source}"; - "format-source" = "MIC ON"; - "format-source-muted" = "MIC OFF"; - # TODO: toggle mute? - "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; - "justify" = "center"; - }; - }; - }; - style = - let - border-width = "0px"; - in - with style.colors.withHashPrefix; - '' - * { - border-radius: 0; - font-family: "${style.font.name}", "Symbols Nerd Font Mono", sans-serif; - font-size: 16px; - } - - window#waybar { - min-height: 32px; - background-color: ${bg}; - color: ${text}; - border-top: solid ${blue} ${border-width}; - transition: none; - } - - window#waybar.hidden { - /* opacity: 0.2; */ - } - - window#waybar.empty { - /* opacity: 0.2; */ - } - - #workspaces button { - padding: 0 0.75em; - background-color: transparent; - border-top: solid ${primary} ${border-width}; - transition: none; - color: ${fgdim}; - background-color: ${bg}; - } - - #workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - } - - #workspaces button.active { - color: ${text}; - background-color: ${bg}; - } - - #workspaces button.visible { - color: ${fgdim}; - background-color: ${bg}; - } - - /* A workspace that is persistent but has windows in it */ - #workspaces button.persistent { - color: ${fgdim}; - } - - #workspaces button.focused { - color: ${bg}; - background-color: ${primary}; - } - - #workspaces button.urgent { - background-color: ${urgent}; - color: ${bg}; - border-top: solid ${urgent} ${border-width}; - } - - #mode { - background-color: transparent; - } - - #clock, - #battery, - #cpu, - #memory, - #temperature, - #backlight, - #network, - #pulseaudio, - #custom-media, - #tray, - #mode, - #idle_inhibitor, - #mpris, - #window, - #mpd { - margin-top: 1px; - padding: 0 0.75em; - background-color: inherit; - color: ${text}; - } - - #clock {} - - #battery { - /* background-color: #ffffff; */ - /* color: #000000; */ - } - - #battery.charging { - /* color: #ffffff; */ - /* background-color: #26A65B; */ - } - - @keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } - } - - #battery.critical:not(.charging) { - background-color: ${red}; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - #bluetooth, - #bluetooth.connected-battery, - #bluetooth.connected.battery, - #bluetooth.connected { - color: ${text}; - } - - label:focus { - /* background-color: #000000; */ - } - - #cpu { - /* background-color: #2ecc71; */ - /* color: #000000; */ - } - - #memory { - /* background-color: #9b59b6; */ - } - - #backlight { - /* background-color: #90b1b1; */ - } - - #network { - /* background-color: #2980b9; */ - } - - #network.disconnected { - /* background-color: #f53c3c; */ - } - - #pulseaudio { - color: ${red}; - /* background-color: #f1c40f; */ - /* color: #000000; */ - } - - #pulseaudio.source-muted { - /* background-color: #90b1b1; */ - color: ${text}; - } - - #custom-media { - /* background-color: #66cc99; */ - /* color: #2a5c45; */ - /* min-width: 100px; */ - } - - #custom-media.custom-spotify { - /* background-color: #66cc99; */ - } - - #custom-media.custom-vlc { - /* background-color: #ffa000; */ - } - - #temperature { - /* background-color: #f0932b; */ - } - - #temperature.critical { - /* background-color: #eb4d4b; */ - } - - #tray { - /* background-color: #2980b9; */ - } - - #idle_inhibitor { - /* background-color: #2d3436; */ - } - - #idle_inhibitor.activated { - /* background-color: #ecf0f1; */ - /* color: #2d3436; */ - } - - #mpd { - /* background-color: #66cc99; */ - /* color: #2a5c45; */ - } - - #mpd.disconnected { - /* background-color: #f53c3c; */ - } - - #mpd.stopped { - /* background-color: #90b1b1; */ - } - - #mpd.paused { - /* background-color: #51a37a; */ - } - ''; - }; -} diff --git a/lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml b/lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml deleted file mode 100644 index 5ca6737..0000000 --- a/lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml +++ /dev/null @@ -1,58 +0,0 @@ -[colors] -ansi = [ - "#45475a", - "#f38ba8", - "#a6e3a1", - "#fab387", - "#74c7ec", - "#cba6f7", - "#f9e2af", - "#bac2de", -] -background = "#1e1e2e" -brights = [ - "#585b70", - "#f38ba8", - "#a6e3a1", - "#fab387", - "#74c7ec", - "#cba6f7", - "#f9e2af", - "#a6adc8", -] -compose_cursor = "#fab387" -cursor_bg = "#cdd6f4" -cursor_border = "#cdd6f4" -cursor_fg = "#1e1e2e" -foreground = "#cdd6f4" -scrollbar_thumb = "#181825" -selection_bg = "#f9e2af" -selection_fg = "#1e1e2e" -split = "#585b70" - -[colors.tab_bar] -background = "#313244" -[colors.tab_bar.active_tab] -bg_color = "#74c7ec" -fg_color = "#1e1e2e" -italic = false - -[colors.tab_bar.inactive_tab] -bg_color = "#181825" -fg_color = "#6c7086" -italic = false - -[colors.tab_bar.inactive_tab_hover] -bg_color = "#313244" -fg_color = "#74c7ec" -italic = false - -[colors.tab_bar.new_tab] -bg_color = "#181825" -fg_color = "#6c7086" -italic = false - -[colors.tab_bar.new_tab_hover] -bg_color = "#313244" -fg_color = "#74c7ec" -italic = false diff --git a/lib/modules/home/wezterm/wezterm.lua b/lib/modules/home/wezterm/wezterm.lua deleted file mode 100644 index d6296e8..0000000 --- a/lib/modules/home/wezterm/wezterm.lua +++ /dev/null @@ -1,167 +0,0 @@ -local wezterm = require 'wezterm' -local config = wezterm.config_builder() - -config.adjust_window_size_when_changing_font_size = false - -config.color_scheme = 'catppuccin-mocha-sapphire'; -config.font_size = 12.0 -config.font = wezterm.font_with_fallback { - { family = "IosevkaLyteTerm", weight = 'Medium', italic = false }, - { family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false }, - 'Noto Color Emoji', -} - -config.hide_tab_bar_if_only_one_tab = true -config.use_fancy_tab_bar = false -config.tab_bar_at_bottom = true -config.notification_handling = "SuppressFromFocusedTab" --- config.window_decorations = "RESIZE" - -local a = wezterm.action -local s = { domain = 'CurrentPaneDomain' } -local st = { domain = 'CurrentPaneDomain', args={'top'} } -local sr = { domain = 'CurrentPaneDomain', args={'right'} } -config.keys = { - { key = 'j', mods = 'CTRL|SHIFT', action = a.SplitVertical(s) }, - { key = 'k', mods = 'CTRL|SHIFT', action = a.SplitVertical(st) }, - { key = 'l', mods = 'CTRL|SHIFT', action = a.SplitHorizontal(s) }, - { key = 'h', mods = 'CTRL|SHIFT', action = a.SplitHorizontal(sr) }, - { key = 'j', mods = 'CTRL', action = a.ActivatePaneDirection'Down' }, - { key = 'k', mods = 'CTRL', action = a.ActivatePaneDirection'Up' }, - { key = 'l', mods = 'CTRL', action = a.ActivatePaneDirection'Right' }, - { key = 'h', mods = 'CTRL', action = a.ActivatePaneDirection'Left' }, - { key = 'w', mods = 'CTRL', action = a.CloseCurrentPane{confirm=true} }, -} - -return config - --- config.window_background_opacity = 1.0 --- config.enable_kitty_keyboard = true --- config.show_new_tab_button_in_tab_bar = true --- config.notification_handling = "SuppressFromFocusedTab" - --- config.front_end = "WebGpu" --- config.webgpu_power_preference = 'HighPerformance' --- config.enable_wayland = true --- config.use_ime = true - --- local function tab_title(tab_info) --- local title = tab_info.tab_title --- if title and #title > 0 then --- return title --- end --- return tab_info.active_pane.title --- end - --- wezterm.on('format-tab-title', function (tab, tabs, panes, config, hover, max_width) --- wezterm.on('format-tab-title', function(tab, _, _, _, _, max_width) --- local title = tab_title(tab) --- return ' ' .. string.sub(title, 0, max_width - 2) .. ' ' --- end) - --- see nix module which has home manager create this color scheme file - --- config.inactive_pane_hsb = { --- saturation = 0.8, --- brightness = 0.7, --- } - --- config.keys = { --- { --- key = 'Insert', --- mods = 'SHIFT', --- action = wezterm.action.PasteFrom 'Clipboard' --- }, --- { --- key = 'v', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.PasteFrom 'PrimarySelection' --- }, --- { --- key = 't', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.SpawnTab 'CurrentPaneDomain' --- }, --- { --- key = 'h', --- mods = 'CTRL', --- action = wezterm.action.ActivatePaneDirection 'Left' --- }, --- { --- key = 'l', --- mods = 'CTRL', --- action = wezterm.action.ActivatePaneDirection 'Right' --- }, --- { --- key = 'k', --- mods = 'CTRL', --- action = wezterm.action.ActivatePaneDirection 'Up' --- }, --- { --- key = 'j', --- mods = 'CTRL', --- action = wezterm.action.ActivatePaneDirection 'Down' --- }, --- { --- key = 'j', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' } --- }, --- { --- key = 'l', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' } --- }, --- { --- key = 'k', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.SplitVertical { args = { 'top' }, domain = 'CurrentPaneDomain' } --- }, --- { --- key = 'h', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.SplitHorizontal { args = { 'right' }, domain = 'CurrentPaneDomain' } --- }, --- { --- key = 'p', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.ActivateCommandPalette --- }, --- { --- key = 'w', --- mods = 'CTRL|SHIFT', --- action = wezterm.action.CloseCurrentPane { confirm = true }, --- }, --- { --- key = 'w', --- mods = 'CTRL|ALT|SHIFT', --- action = wezterm.action.CloseCurrentTab { confirm = true }, --- }, --- { --- key = 'l', --- mods = 'CTRL|SHIFT|ALT', --- action = wezterm.action.ShowDebugOverlay --- }, --- { --- key = 'r', --- mods = 'CTRL|SHIFT|ALT', --- action = wezterm.action.RotatePanes 'Clockwise' --- }, --- } - --- config.unix_domains = { --- { --- name = 'unix', --- local_echo_threshold_ms = 10, --- }, --- } - --- config.default_gui_startup_args = { 'connect', 'unix' } --- config.default_domain = 'unix' - --- config.window_padding = { --- top = '0.5cell', --- bottom = '0.5cell', --- left = '1cell', --- right = '1cell', --- } diff --git a/packages/hosts/default.nix b/packages/hosts/default.nix index f15c50d..ee7b93b 100644 --- a/packages/hosts/default.nix +++ b/packages/hosts/default.nix @@ -66,18 +66,26 @@ let }; # TODO: for each non-system user on the machine? - home-manager.users.root = { - home.stateVersion = lib.mkDefault config.system.stateVersion; - imports = with self.outputs.homeManagerModules; [ - common - ]; - }; - home-manager.users.daniel = { - home.stateVersion = lib.mkDefault config.system.stateVersion; - imports = with self.outputs.homeManagerModules; [ - daniel - common - ]; + home-manager = { + extraSpecialArgs = { + config.lyte = config.lyte; + }; + + users = { + root = { + home.stateVersion = lib.mkDefault config.system.stateVersion; + imports = with self.outputs.homeManagerModules; [ + common + ]; + }; + daniel = { + home.stateVersion = lib.mkDefault config.system.stateVersion; + imports = with self.outputs.homeManagerModules; [ + daniel + common + ]; + }; + }; }; nix = { diff --git a/packages/shells/default.nix b/packages/shells/default.nix index b99ec4a..0b19bc8 100644 --- a/packages/shells/default.nix +++ b/packages/shells/default.nix @@ -4,6 +4,9 @@ default = pkgs.mkShell { inherit (self.outputs.checks.${pkgs.system}.git-hooks) shellHook; packages = with pkgs; [ + nil + nixd + nixfmt-rfc-style lua-language-server nodePackages.bash-language-server ];