From cacfc5b2d3fc3fe827257f4c064b33674805e00f Mon Sep 17 00:00:00 2001 From: Jacob Bachmann Date: Mon, 22 Apr 2024 17:12:06 +0200 Subject: [PATCH] feat: revert back to sway --- flake.nix | 3 +- hosts/IROH/hardware.nix | 2 - hosts/T430/default.nix | 5 +- hosts/T430/hardware.nix | 3 - modules/packages.nix | 2 + users/gandalf/modules/gui/sway/default.nix | 10 +- users/gandalf/modules/gui/waybar.nix | 246 ++++++++++----------- 7 files changed, 121 insertions(+), 150 deletions(-) diff --git a/flake.nix b/flake.nix index a57794e..cfa12f9 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,6 @@ hyprland = { url = "github:hyprwm/Hyprland?ref=v0.39.0"; - inputs.hyprland.follows = "nixpkgs"; }; hy3 = { url = "github:outfoxxed/hy3"; @@ -54,7 +53,7 @@ ./modules ./hosts/T430 - # nixos-hardware.nixosModules.lenovo-thinkpad-t430 + nixos-hardware.nixosModules.lenovo-thinkpad-t430 inputs.home-manager.nixosModules.home-manager diff --git a/hosts/IROH/hardware.nix b/hosts/IROH/hardware.nix index 59a6482..a7e3963 100644 --- a/hosts/IROH/hardware.nix +++ b/hosts/IROH/hardware.nix @@ -4,9 +4,7 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; - boot.extraModulePackages = [ ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/T430/default.nix b/hosts/T430/default.nix index 7baf1ab..06ade74 100755 --- a/hosts/T430/default.nix +++ b/hosts/T430/default.nix @@ -1,6 +1,5 @@ { ... }: { - imports = [ ./hardware.nix ]; networking.hostName = "T430"; @@ -9,8 +8,8 @@ gui = { enable = true; - greeter.enable = true; - flavour = [ "Hyprland" "sway" ]; + greeter.enable = false; + flavour = [ "sway" ]; }; nvidia.enable = false; audio.enable = true; diff --git a/hosts/T430/hardware.nix b/hosts/T430/hardware.nix index b7847c4..f90bcb7 100644 --- a/hosts/T430/hardware.nix +++ b/hosts/T430/hardware.nix @@ -4,9 +4,6 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/modules/packages.nix b/modules/packages.nix index e8169bc..a25959b 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -38,6 +38,8 @@ nodePackages.yarn nodePackages.pnpm mongodb-compass + ghidra-bin + hexedit ] ++ lib.optionals (gui.enable) [ libnotify # a library that sends desktop notifications to a notification daemon xdg-utils # a set of command line tools that assist applications with a variety of desktop integration tasks diff --git a/users/gandalf/modules/gui/sway/default.nix b/users/gandalf/modules/gui/sway/default.nix index 9046b8a..0e284c6 100644 --- a/users/gandalf/modules/gui/sway/default.nix +++ b/users/gandalf/modules/gui/sway/default.nix @@ -79,6 +79,8 @@ in modifier = "Mod4"; terminal = "${pkgs.alacritty}/bin/alacritty"; menu = "${pkgs.wofi}/bin/wofi"; + # TODO for some reason bar only works when used with exec + bars = []; startup = with pkgs; [ # TODO activate with systemd prbly requires a graphical.target? # { command = "${nixosConfig.systemd.package}/bin/systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"; } @@ -86,6 +88,7 @@ in # { command = "${nixosConfig.systemd.package}/bin/systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr"; } # { command = "${nixosConfig.systemd.package}/bin/systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr"; } # { command = "${dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } + { command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css"; } { command = "${dbus}/bin/dbus-update-activation-environment --all"; } { command = "${kanshi}/bin/kanshi"; } { command = "${networkmanagerapplet}/bin/nm-applet"; } @@ -226,7 +229,7 @@ in }; seat = { "*" = { - xcursor_theme = common.gtk; + xcursor_theme = "macOS-Monterey 32"; }; }; window = { @@ -273,11 +276,6 @@ in childBorder = common.colorschemes.default.active; }; }; - bars = [ - { - command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css"; - } - ]; }; extraConfig = '' for_window [title="Firefox — Sharing Indicator"] { diff --git a/users/gandalf/modules/gui/waybar.nix b/users/gandalf/modules/gui/waybar.nix index 65819eb..0c3bb9e 100644 --- a/users/gandalf/modules/gui/waybar.nix +++ b/users/gandalf/modules/gui/waybar.nix @@ -66,10 +66,7 @@ in } }, "clock": { - "actions": { - "on-click": "tz_up" - }, - "format": "{:%a, %d %b, %H:%M}", + "format": "{:%a %b %d %H:%M}", "timezones": [ "Europe/Berlin" ], @@ -81,10 +78,30 @@ in "interval": 3, "tooltip": false }, + "sway/mode": { + "format": "{}" + }, + "sway/window": { + "format": "{title}", + }, + "sway/workspaces": { + "disable-scroll": true, + "persistent-workspaces": { + "1": [], + "2": [], + "3": [], + "4": [], + "5": [], + "6": [], + "7": [], + "8": [], + "9": [], + "10": [], + } + }, "layer": "top", "margin": "5 5 5 5", "modules-center": [ - "clock" ], "modules-left": [ "sway/workspaces", @@ -98,7 +115,8 @@ in "custom/mem", "temperature", "backlight", - "battery" + "battery", + "clock" ], "name": "swaybar", "network": { @@ -136,22 +154,6 @@ in "on-click": "${pkgs.pavucontrol}/bin/pavucontrol", "reverse-scrolling": 1 }, - "sway/mode": { - "format": "{}" - }, - "sway/window": { - "format": "{title}", - "max-length": 43 - }, - "sway/workspaces": { - "disable-scroll": true, - "persistent-workspaces": { - "1": [], - "2": [], - "3": [], - "4": [] - } - }, "temperature": { "critical-threshold": 80, "format": "{temperatureC}°C {icon}", @@ -166,141 +168,127 @@ in }, "tray": { "icon-size": 16, - "spacing": 0 + "show-passive-items": true, + "spacing": 4 } } ] ''; "waybar/swaybar.css".text = '' - @define-color bg-color #212529; - window.swaybar, window.swaybar * { - border: none; - border-radius: 0; - font-family: DejaVuSansM Nerd Font; - min-height: 20px; + border: none; + border-radius: 10px; + font-family: DejaVuSansM Nerd Font; + min-height: 20px; } window.swaybar#waybar { - background: transparent; + background: #ffffff; } window.swaybar#waybar.hidden { - opacity: 0.2; + opacity: 0.2; } window.swaybar #workspaces { - padding-left: 8px; - padding-right: 8px; - margin-right: 8px; - border-radius: 10px; - transition: none; - background: @bg-color; + padding-left: 8px; + padding-right: 8px; + margin-right: 8px; + transition: none; } window.swaybar #workspaces button { - transition: none; - color: #7c818c; - background: transparent; - padding: 5px; - font-size: 18px; + transition: none; + color: black; + background: transparent; + padding: 5px; + font-size: 18px; + border-radius: 0px; + } + + window.swaybar #workspaces button.empty { + color: #7c818c; } window.swaybar #workspaces button.persistent { - color: #7c818c; - font-size: 12px; - } - - window.swaybar #workspaces button:hover { - transition: none; - box-shadow: inherit; - text-shadow: inherit; - border-radius: inherit; - color: @bg-color; - background: #7c818c; - } - - window.swaybar #workspaces button.focused { - color: white; + font-size: 12px; } window.swaybar #workspaces button.visible { - color: white; + color: black; + font-size: 18px; + } + + window.swaybar #workspaces button.focused { + background: lightgray; + } + + window.swaybar #workspaces button:hover { + color: white; + background: black; } window.swaybar #window { - padding-left: 16px; - padding-right: 16px; - margin-right: 8px; - border-radius: 10px 10px 10px 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 16px; + padding-right: 16px; + transition: none; + color: black; + background: transparent; } window.swaybar #mode { - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 16px; + padding-right: 16px; + transition: none; + color: black; + background: transparent; } - window.swaybar #clock { - padding-left: 16px; - padding-right: 16px; - border-radius: 10px 10px 10px 10px; - transition: none; - color: #ffffff; - background: @bg-color; + window.swaybar #tray { + margin-right: 10px; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: white; + background: rgb(66, 118, 185); } window.swaybar #network { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #pulseaudio { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; + color: gray; } window.swaybar #custom-mem { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #temperature { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #temperature.critical { @@ -308,22 +296,19 @@ in } window.swaybar #backlight { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #battery { - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + padding-left: 10px; + padding-right: 10px; + transition: none; + color: black; + background: transparent; } window.swaybar #battery.charging { @@ -346,14 +331,12 @@ in animation-direction: alternate; } - window.swaybar #tray { - margin-right: 8px; - padding-left: 16px; - padding-right: 16px; - border-radius: 10px; - transition: none; - color: #ffffff; - background: @bg-color; + window.swaybar #clock { + padding-left: 10px; + padding-right: 16px; + transition: none; + color: black; + background: transparent; } @keyframes blink { @@ -587,7 +570,6 @@ in } window.hyprbar #network { - /* margin-right: 4px; */ padding-left: 10px; padding-right: 10px; transition: none; @@ -596,7 +578,6 @@ in } window.hyprbar #pulseaudio { - /* margin-right: 4px; */ padding-left: 10px; padding-right: 10px; transition: none; @@ -609,7 +590,6 @@ in } window.hyprbar #custom-mem { - /* margin-right: 8px; */ padding-left: 10px; padding-right: 10px; transition: none; @@ -618,7 +598,6 @@ in } window.hyprbar #temperature { - /* margin-right: 8px; */ padding-left: 10px; padding-right: 10px; transition: none; @@ -631,7 +610,6 @@ in } window.hyprbar #backlight { - /* margin-right: 8px; */ padding-left: 10px; padding-right: 10px; transition: none;