aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2025-10-04 17:20:24 +0200
committerAdrian Kummerlaender2025-10-04 17:20:24 +0200
commit9d7ed3ab3ec213b85c387a7f0a142e86635b573e (patch)
treeeda888fc25ce6c5368815a65258e12d51873f14d
parent54a7c1dce536da7a327cde740e36455b20911dc9 (diff)
downloadnixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar.gz
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar.bz2
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar.lz
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar.xz
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.tar.zst
nixos_home-9d7ed3ab3ec213b85c387a7f0a142e86635b573e.zip
niri: Style bar, autohide, tweak looks
-rw-r--r--gui/conf/niri.kdl13
-rw-r--r--gui/conf/waybar.css20
-rw-r--r--gui/dunst.nix2
-rw-r--r--gui/niri.nix100
-rw-r--r--home.nix2
5 files changed, 121 insertions, 16 deletions
diff --git a/gui/conf/niri.kdl b/gui/conf/niri.kdl
index c473dc5..4ab71e9 100644
--- a/gui/conf/niri.kdl
+++ b/gui/conf/niri.kdl
@@ -1,4 +1,5 @@
spawn-at-startup "xwayland-satellite"
+spawn-at-startup "niri-event-handler-waybar-toggle"
environment {
QT_QPA_PLATFORM "wayland"
@@ -26,22 +27,12 @@ input {
// drag false
// drag-lock
natural-scroll
- // accel-speed 0.2
+ accel-speed 1.0
// accel-profile "flat"
// scroll-method "two-finger"
// disabled-on-external-mouse
}
- trackpoint {
- // off
- // natural-scroll
- accel-speed 1.0
- // accel-profile "flat"
- // scroll-method "on-button-down"
- // scroll-button 273
- // middle-emulation
- }
-
focus-follows-mouse max-scroll-amount="0%"
}
diff --git a/gui/conf/waybar.css b/gui/conf/waybar.css
new file mode 100644
index 0000000..3fdd79a
--- /dev/null
+++ b/gui/conf/waybar.css
@@ -0,0 +1,20 @@
+* {
+ border: none;
+ border-radius: 0;
+}
+window#waybar {
+ background-color: transparent;
+}
+#battery, #backlight, #pulseaudio, #clock {
+ margin: 0 5px;
+ padding: 0 10px;
+ background-color: alpha(#161616, 0.7);
+ color: #909636;
+ border-radius: 10px;
+}
+#tray {
+ background-color: alpha(#161616, 0.7);
+ border-radius: 10px;
+ margin: 0 5px;
+ padding: 0 10px;
+}
diff --git a/gui/dunst.nix b/gui/dunst.nix
index 79e5061..3607f43 100644
--- a/gui/dunst.nix
+++ b/gui/dunst.nix
@@ -13,7 +13,7 @@
notification_limit = 5;
width = "(0, 800)";
height = 40;
- offset = "6x6";
+ offset = "30x30";
origin = "bottom-right";
transparency = 10;
frame_color = "#909737";
diff --git a/gui/niri.nix b/gui/niri.nix
index 06802b8..7d348c7 100644
--- a/gui/niri.nix
+++ b/gui/niri.nix
@@ -13,15 +13,107 @@
size = 16;
};
- #home.file.".config/niri/config.kdl".source = config.lib.file.mkOutOfStoreSymlink ./conf/niri.kdl;
+ home.file.".config/niri/config.kdl".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dotfiles/home/gui/conf/niri.kdl";
- services.screen-locker = {
- enable = true;
- lockCmd = "${pkgs.swaylock}/bin/swaylock -c #000000";
+ services.screen-locker.enable = false;
+ services.swayidle = {
+ enable = true;
+ timeouts = [
+ {
+ timeout = 300;
+ command = "${pkgs.swaylock}/bin/swaylock -c 000000";
+ }
+ {
+ timeout = 300;
+ command = "${pkgs.niri}/bin/niri-msg 'output * --dpms off'";
+ resumeCommand = "${pkgs.niri}/bin/niri-msg 'output * --dpms on'";
+ }
+ ];
+ events = [
+ {
+ event = "before-sleep";
+ command = "${pkgs.swaylock}/bin/swaylock -c 000000";
+ }
+ ];
};
+ programs.waybar = {
+ enable = true;
+ systemd.enable = true;
+ settings = {
+ top = {
+ start_hidden = true;
+ on-sigusr1 = "show";
+ on-sigusr2 = "hide";
+
+ layer = "top";
+ exclusive = false;
+ passthrough = false;
+ gtk-layer-shell = true;
+ position = "top";
+
+ margin = "30 30 0 30";
+ height = 48;
+
+ modules-left = [
+ "tray"
+ ];
+ modules-right = [
+ "battery"
+ "pulseaudio"
+ "backlight"
+ "clock"
+ ];
+
+ "tray" = {
+ icon-size = 32;
+ spacing = 5;
+ };
+ "battery" = {
+ format = "🔋 {capacity}%";
+ };
+ "pulseaudio" = {
+ format = "🔈 {volume}%";
+ format-muted = "🔇 {volume}%";
+ on-click = "pactl set-sink-mute @DEFAULT_SINK@ toggle";
+ };
+ "backlight" = {
+ format = "💡 {percent}%";
+ };
+ "clock" = {
+ format = "{:%Y-%m-%d %H:%M}";
+ tooltip-format = "<tt>{calendar}</tt>";
+ calendar = {
+ mode = "year";
+ mode-mon-col = 3;
+ weeks-pos = "left";
+ };
+ };
+ };
+ };
+ };
+ home.file.".config/waybar/style.css".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dotfiles/home/gui/conf/waybar.css";
+
home.packages = with pkgs; [
wdisplays
wayvnc
+
+ (pkgs.writeShellScriptBin "niri-event-handler-waybar-toggle" ''
+ #!/bin/sh
+ ${pkgs.niri}/bin/niri msg --json event-stream | while read -r event; do
+ event_type=$(echo "$event" | ${pkgs.jq}/bin/jq -r 'keys[0]')
+ if [[ "$event_type" == "OverviewOpenedOrClosed" ]]; then
+ is_open=$(echo "$event" | ${pkgs.jq}/bin/jq -r '.OverviewOpenedOrClosed.is_open')
+ case "$is_open" in
+ "true")
+ pkill -SIGUSR1 waybar
+ ;;
+ "false")
+ pkill -SIGUSR2 waybar
+ ;;
+ esac
+ fi
+ done
+ '')
];
}
diff --git a/home.nix b/home.nix
index 1b4cbac..2e068c4 100644
--- a/home.nix
+++ b/home.nix
@@ -70,6 +70,8 @@
maxCacheTtl = 43200;
defaultCacheTtlSsh = 43200;
maxCacheTtlSsh = 43200;
+
+ pinentry.package = pkgs.pinentry-gnome3;
};
programs.fish = {