greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

feat(*): media keys with mako volume popup, dark gtk

commit4dfd04ecae86b1eb739e5494e1e292008362b7e4
parent6af5317a31cdca1aca50983f0b7e27c9c365cd62
authorlostduk <[email protected]>
date2026-10-16 00:34 +0700
home/features/cli/tmux.nix1+
home/features/misc/gtk.nix9+++++++++
home/features/wayland/dwl.nix37++++++++++++++++++++++++++++++++++++-
home/features/wayland/mako.nix5+++++
home/profiles/peony.nix1+
nixos/roles/desktop.nix2++
overlays/dwl/config.h15+++++++++++++++

7 files changed, -1/+69

home/features/cli/tmux.nix

@@ -9,6 +9,7 @@ in {     prefix = "C-x";     terminal = "tmux-256color";     keyMode = "vi";+    mouse = true;      extraConfig = ''       set -g status-style "bg=${c.bg},fg=${c.fg}"

home/features/misc/gtk.nix

@@ -0,0 +1,9 @@+{+  gtk = {+    enable = true;+    gtk3.extraConfig.gtk-application-prefer-dark-theme = true;+    gtk4.extraConfig.gtk-application-prefer-dark-theme = true;+  };++  dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";+}

home/features/wayland/dwl.nix

@@ -17,6 +17,41 @@ let       esac     '';   };++  volume = pkgs.writeShellApplication {+    name = "volume";+    runtimeInputs = with pkgs; [ wireplumber libnotify gawk coreutils ];+    text = ''+      sink=@DEFAULT_AUDIO_SINK@+      source=@DEFAULT_AUDIO_SOURCE@++      case "''${1:-}" in+        up) wpctl set-volume -l 1.0 "$sink" 5%+ ;;+        down) wpctl set-volume "$sink" 5%- ;;+        mute) wpctl set-mute "$sink" toggle ;;+        mic) wpctl set-mute "$source" toggle ;;+        *) echo "usage: volume [up|down|mute|mic]" >&2; exit 1 ;;+      esac++      if [ "$1" = mic ]; then+        target=$source+      else+        target=$sink+      fi+      state="$(wpctl get-volume "$target")"+      pct="$(awk '{ printf "%d", $2 * 100 + 0.5 }' <<< "$state")"++      if [ "$1" = mic ]; then+        case "$state" in *MUTED*) title="mic muted" ;; *) title="mic on" ;; esac+      else+        case "$state" in *MUTED*) title="muted" ;; *) title="volume $pct" ;; esac+      fi++      idfile="''${XDG_RUNTIME_DIR:-/tmp}/volume-notify-id"+      id="$(cat "$idfile" 2>/dev/null || echo 0)"+      notify-send -p -r "$id" -c volume -h "int:value:$pct" "$title" > "$idfile"+    '';+  }; in {-  home.packages = with pkgs; [ wmenu wl-clipboard xdg-utils screenshot ];+  home.packages = with pkgs; [ wmenu wl-clipboard xdg-utils playerctl screenshot volume ]; }

home/features/wayland/mako.nix

@@ -25,6 +25,11 @@ in {         text-color = c.dim;       }; +      "category=volume" = {+        default-timeout = 1500;+        progress-color = "over ${c.green}40";+      };+       "urgency=critical" = {         border-color = c.red;         default-timeout = 0;

home/profiles/peony.nix

@@ -10,6 +10,7 @@     ../features/misc/xdg.nix     ../features/misc/firefox.nix     ../features/misc/vesktop.nix+    ../features/misc/gtk.nix      ../features/wayland/dwl.nix     ../features/wayland/foot.nix

nixos/roles/desktop.nix

@@ -31,6 +31,8 @@ in {    security.pam.services.swaylock = { }; +  programs.dconf.enable = true;+   environment.loginShellInit = ''     if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" = /dev/tty1 ]; then       /etc/xdg/dwl-session

overlays/dwl/config.h

@@ -98,6 +98,13 @@ static const char *dismissallcmd[] = { "makoctl", "dismiss", "--all", NULL }; static const char *shotareacmd[] = { "screenshot", "area", NULL }; static const char *shotoutputcmd[] = { "screenshot", "output", NULL }; static const char *shotsavecmd[] = { "screenshot", "save", NULL };+static const char *volupcmd[] = { "volume", "up", NULL };+static const char *voldowncmd[] = { "volume", "down", NULL };+static const char *volmutecmd[] = { "volume", "mute", NULL };+static const char *micmutecmd[] = { "volume", "mic", NULL };+static const char *playcmd[] = { "playerctl", "play-pause", NULL };+static const char *nextcmd[] = { "playerctl", "next", NULL };+static const char *prevcmd[] = { "playerctl", "previous", NULL }; static const char *menucmd[] = { "wmenu-run", "-f", "Fantasque Sans Mono 11", 	"-N", "@bgRgb@", "-n", "@fgRgb@", "-M", "@bgRgb@", "-m", "@greenRgb@", 	"-S", "@surfaceRgb@", "-s", "@fgRgb@", NULL };@@ -127,6 +134,14 @@ static const Key keys[] = { 	{ 0, XKB_KEY_Print, spawn, {.v = shotareacmd} }, 	{ MODSHIFT, XKB_KEY_Print, spawn, {.v = shotoutputcmd} }, 	{ MODKEY, XKB_KEY_Print, spawn, {.v = shotsavecmd} },+	{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn, {.v = volupcmd} },+	{ 0, XKB_KEY_XF86AudioLowerVolume, spawn, {.v = voldowncmd} },+	{ 0, XKB_KEY_XF86AudioMute, spawn, {.v = volmutecmd} },+	{ 0, XKB_KEY_XF86AudioMicMute, spawn, {.v = micmutecmd} },+	{ 0, XKB_KEY_XF86AudioPlay, spawn, {.v = playcmd} },+	{ 0, XKB_KEY_XF86AudioPause, spawn, {.v = playcmd} },+	{ 0, XKB_KEY_XF86AudioNext, spawn, {.v = nextcmd} },+	{ 0, XKB_KEY_XF86AudioPrev, spawn, {.v = prevcmd} }, 	{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, 	{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, 	{ MODKEY|MODSHIFT, XKB_KEY_comma, tagmon, {.i = WLR_DIRECTION_LEFT} },