From 75bae99f015a000ad7d92b84748e6512a128a81f Mon Sep 17 00:00:00 2001 From: cydiralis Date: Wed, 25 Jun 2025 18:01:15 +0100 Subject: [PATCH] this commit implements the setting of the gb layout on alyxs machines that have british keyboards whilst leaving mayas devices on us / alyx's that have us keyboards. it also implements the way to set display configurations per user, allowing alyx to have her display configuration and maya to have her own without conflict! as well as this, waybar configurations for each user are properly put in, terminal and terminal.css being alyx's and modern and modern.css being mayas. these are placeholder names, as i am not exactly sure what to name them --- home/default.nix | 30 +---- home/niri.nix | 60 ++++++---- home/waybar/modern | 146 ++++++++++++++++++++++++ home/waybar/modern.css | 114 ++++++++++++++++++ home/waybar/{config => terminal} | 0 home/waybar/{style.css => terminal.css} | 0 6 files changed, 300 insertions(+), 50 deletions(-) create mode 100644 home/waybar/modern create mode 100644 home/waybar/modern.css rename home/waybar/{config => terminal} (100%) rename home/waybar/{style.css => terminal.css} (100%) diff --git a/home/default.nix b/home/default.nix index 460fc99..a8e0918 100644 --- a/home/default.nix +++ b/home/default.nix @@ -18,9 +18,8 @@ homeDirectory = "/home/${username}"; #change this if you use a non-standard home dir stateVersion = "23.11"; file = { - ".config/waybar/config".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/config"; - ".config/waybar/style.css".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/style.css"; -# ".config/hypr/hyprlock.conf".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/locking/hyprlock.conf"; + ".config/waybar/config".source = (if vars.user == "alyx" then config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/terminal" else config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/modern"); + ".config/waybar/style.css".source = (if vars.user == "alyx" then config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/terminal.css" else config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/modern.css"); }; }; programs.home-manager.enable = (!vars.isNixOS); #value is set in flake.nix @@ -66,33 +65,11 @@ }; }; - xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json"; - - xdg.configFile."openvr/openvrpaths.vrpath".text = '' - { - "config" : - [ - "${config.xdg.dataHome}/Steam/config" - ], - "external_drivers" : null, - "jsonid" : "vrpathreg", - "log" : - [ - "${config.xdg.dataHome}/Steam/logs" - ], - "runtime" : - [ - "${pkgs.opencomposite}/lib/opencomposite" - ], - "version" : 1 - } - ''; - programs.irssi = { enable = true; networks = { classicconnect = { - nick = "alyx"; + nick = vars.user; server = { address = "irc.classicconnect.net"; port = 6677; @@ -114,3 +91,4 @@ ]; }; } + diff --git a/home/niri.nix b/home/niri.nix index 1defea5..a343202 100644 --- a/home/niri.nix +++ b/home/niri.nix @@ -2,10 +2,6 @@ xdg.portal = { enable = true; config.niri = { - default = [ "gnome" "gtk" ]; - "org.freedesktop.impl.portal.Access" = [ "gtk" ]; - "org.freedesktop.impl.portal.Notification" = [ "gtk" ]; - "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; }; extraPortals = with pkgs; [ @@ -26,7 +22,7 @@ accel-profile = "flat"; }; prefer-no-csd = true; - input.keyboard.xkb.layout = "gb"; + input.keyboard.xkb.layout = (if vars.user == "alyx" && !vars.isTough then "gb" else "us"); input.focus-follows-mouse.enable = true; binds = with config.lib.niri.actions; lib.mkDefault { "Mod+Return".action = spawn "foot"; @@ -245,33 +241,49 @@ # moving the mouse or pressing any other key. "Mod+Shift+P".action.power-off-monitors = {}; }; - outputs.DP-1 = { - mode = { - height = 1080; - refresh = 239.76; - width = 1920; + outputs = (if vars.user == "alyx" then { + DP-1 = { + mode = { + height = 1080; + refresh = 239.76; + width = 1920; + }; + position = { + x = 2560; + y = 0; + }; }; - position = { - x = 2560; - y = 0; + DP-4 = { + mode = { + height = 1080; + refresh = 75.0; + width = 2560; + }; + position = { + x = 0; + y = 0; + }; }; - }; - outputs.DP-4 = { - mode = { - height = 1080; - refresh = 75.0; - width = 2560; + } + else { + DP-1 = { + mode = { + height = 1080; + refresh = 239.76; + width = 1920; + }; + position = { + x = 2560; + y = 0; + }; }; - position = { - x = 0; - y = 0; - }; - }; + }); spawn-at-startup = [ {command = ["waybar"];} {command = ["xwayland-satellite"];} {command = if !vars.isTough then ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"] else ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"];} {command = ["udiskie" "--appindicator"];} + {command = [ "systemctl" "--user" "restart" "xdg-desktop-portal-gnome.service"];} ]; environment = { DISPLAY = ":0"; diff --git a/home/waybar/modern b/home/waybar/modern new file mode 100644 index 0000000..899b734 --- /dev/null +++ b/home/waybar/modern @@ -0,0 +1,146 @@ +[ + { + "layer": "top", + "margin-top": 10, + "margin-left": 12, + "margin-right": 12, + "height": 35, + "spacing": 5, + "position": "top", + "modules-center": ["group/mpdg"], + "modules-left": ["group/dtray", "battery", "battery#bat1", "battery#bat2"], + "modules-right": ["clock", "group/audio", "disk", "memory", "cpu"], + "memory": { + "format": " {avail} +  {swapAvail} GiB", + }, + + "cava": { + "method": "pipewire", + "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], + "bar_delimiter": 0, + "bars": 12, + "stereo": false, + "hide_on_silence": true, + "input_delay": 1, + "autosens": 0, + "noise_reduction": 0.5, + "sensitivity": 13, + }, + + "disk": { + "format": " {free} {path}", + }, + + "cpu": { + "format": " {usage}% {max_frequency}GHz", + "states": { "highcpu": 85 }, + }, + + "group/dtray": { + "orientation": "inherit", + "drawer": { + "transition-duration": 500, + "transition-left-to-right": true + }, + "modules": ["custom/arrow", "tray"] + }, + + "group/audio": { + "orientation": "inherit", + "modules": ["wireplumber", ], + "on-click": "pavucontrol", + }, + + "group/mpdg": { + "orientation": "inherit", + "drawer": { + "transition-duration": 500, + "children-class": "mpdcontrol", + "transition-left-to-right": true + }, + "modules": ["mpd", "custom/playpause", "custom/prev", "custom/next"] + }, + + "custom/playpause": { + "format": "󰐎", + "on-click": "mpc toggle" + }, + + "custom/prev": { + "format": "󰒮", + "on-click": "mpc prev" + }, + + "custom/next": { + "format": "󰒭", + "on-click": "mpc next" + }, + + "custom/arrow": { + "format": " ", + "tooltip": false, + "on-click": "swaync-client -t", + }, + + "tray": { + "spacing": 5 + }, + + "clock": { + "format": "{:%I:%M %p}", + }, + + "wireplumber": { + "on-click": "pavucontrol", + "format": "󰓃 {volume}%", + "format-muted": "󰓄 {volume}%", + }, + + "mpd": { + "on-click": "mpc toggle", + "format-disconnected": "MPD seems to be down", + "format-stopped": "Nothing playing!", + "format": "{title} - {album} - {artist}", + "format-paused": "{title} - {album} - {artist}", + }, + + "battery": { + "bat": "BAT0", + "interval": 5, + "format-icons": [" ", " ", " ", " ", " "], + "states": { + "warning": 30, + "critical": 15, + "dead": 5 + }, + "format": "{icon} {capacity}%", + "tooltip-format": "BAT0, {power}W" + }, + + "battery#bat1": { + "bat": "BAT1", + "interval": 5, + "format-icons": [" ", " ", " ", " ", " "], + "states": { + "warning": 30, + "critical": 15, + "dead": 5 + }, + "format": "{icon} {capacity}%", + "tooltip-format": "BAT1, {power}W" + }, + + "battery#bat2": { + "bat": "BAT2", + "interval": 5, + "format-icons": [" ", " ", " ", " ", " "], + "states": { + "warning": 30, + "critical": 15, + "dead": 5 + }, + "format": "{icon} {capacity}%", + "tooltip-format": "BAT2, {power}W" + }, + } +] diff --git a/home/waybar/modern.css b/home/waybar/modern.css new file mode 100644 index 0000000..9063802 --- /dev/null +++ b/home/waybar/modern.css @@ -0,0 +1,114 @@ +@define-color rosewater #f5e0dc; +@define-color flamingo #f2cdcd; +@define-color pink #f5c2e7; +@define-color mauve #cba6f7; +@define-color red #f38ba8; +@define-color maroon #eba0ac; +@define-color peach #fab387; +@define-color yellow #f9e2af; +@define-color green #a6e3a1; +@define-color teal #94e2d5; +@define-color sky #89dceb; +@define-color sapphire #74c7ec; +@define-color blue #89b4fa; +@define-color lavender #b4befe; +@define-color text #cdd6f4; +@define-color subtext1 #bac2de; +@define-color subtext0 #a6adc8; +@define-color overlay2 #9399b2; +@define-color overlay1 #7f849c; +@define-color overlay0 #6c7086; +@define-color surface2 #585b70; +@define-color surface1 #45475a; +@define-color surface0 #313244; +@define-color base #1e1e2e; +@define-color mantle #181825; +@define-color crust #11111b; +/* forgive me, above is the contents of catppuccin mocha's waybar css file */ +* { + font-family: Iosevka NF; +} +window#waybar { + background-color: rgba(49, 50, 68, 0.999); +/* padding: 0px 5px; + margin: 5px 10px 5px; */ + border-radius: 10px; +} +#clock, +#audio, +#mpd, +#battery, +#cpu, +#disk, +#memory { + padding: 5px; + border-radius: 10px; + border: 0.2em solid #cba6f7; + background: @surface2; + min-height: 0; + margin: 0.2em; +} +#battery.warning { + border: 0.2em solid @yellow; +} +#battery.critical { + border: 0.2em solid @red; +} +#battery.dead { + background: @surface0; + color: @surface2; + border: 0.2em solid @overlay1; +} +#dtray { + margin: 0px 10px 0px; + padding: 0px 10px 0px; +} +#wireplumber.muted { + border: 0; + color: #888888; +} +#mpd.stopped { + background-color: @surface0; + border: 0 +} +#mpd.playing { + background: @mauve; +} +.mpdcontrol { + background-color: @surface0; +/* border-radius: 10px; */ + font-size: 1.2em; +} + +#custom-playpause { + background-color: #e5a6f7; + padding-right: 10px; + padding-left: 5px; +} +#custom-prev { + background-color: #F7A6E8; + padding-right: 7px; + padding-left: 6px; +} +#custom-next { + background-color: #FAA5B7; + padding-right: 8px; + padding-left: 6px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; +} +#mpdg:hover { + border-bottom-left-radius: 10px; + border-top-left-radius: 10px; + background: #e5a6f7; +} +#battery.charging { + background: @mauve; +} +#cava { + margin-left: 0.2em; + color: @mauve; +} +#cpu.highcpu { + background: @mauve; +} diff --git a/home/waybar/config b/home/waybar/terminal similarity index 100% rename from home/waybar/config rename to home/waybar/terminal diff --git a/home/waybar/style.css b/home/waybar/terminal.css similarity index 100% rename from home/waybar/style.css rename to home/waybar/terminal.css