From efe626c41fb56c8f20a42dc0f20b981865f068a2 Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 2 Apr 2024 18:14:56 +0200 Subject: [PATCH] sway,nix: enable avizo --- .config/sway/config | 25 +++++++++++++++++++------ nix/systemd.nix | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index eaa5fff..e3b0d87 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -639,18 +639,31 @@ bindsym XF86Sleep exec "systemctl suspend -i" # bindsym { - --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% - --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% - --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle;exec notify-send -t3600 'audio muted' - --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle;exec notify-send -t 3600 'mic mute toggle' - --locked XF86MonBrightnessUp exec light -A 5 - --locked XF86MonBrightnessDown exec light -U 5 + # depends on avizo-service + --locked XF86AudioRaiseVolume exec volumectl -u up + --locked XF86AudioLowerVolume exec volumectl -u down + --locked XF86AudioMute exec volumectl toggle-mute + --locked XF86AudioMicMute exec volumectl -m toggle-mute + --locked XF86MonBrightnessUp exec lightctl up + --locked XF86MonBrightnessDown exec lightctl down + --locked $mod+Ctrl+p exec playerctl play-pause --locked $mod+Ctrl+n exec playerctl next --locked $mod+Ctrl+Shift+n exec playerctl previous --locked XF86AudioPlay exec playerctl play-pause --locked XF86AudioNext exec playerctl next --locked XF86AudioPrev exec playerctl previous + + ### --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% + ### --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% + ### --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle;exec notify-send -t3600 'audio muted' + ### # --locked XF86AudioMute exec amixer set Master toggle + ### # --locked XF86AudioMicMute exec amixer set Capture toggle;exec notify-send -t 3600 'mic mute toggle' + ### # --locked XF86AudioMicMute exec ydotool key 248:1 248:0;exec notify-send -t 3600 'mic mute toggle' + ### --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle;exec notify-send -t 3600 'mic mute toggle' + ### --locked XF86MonBrightnessUp exec light -A 5 + ### --locked XF86MonBrightnessDown exec light -U 5 + } diff --git a/nix/systemd.nix b/nix/systemd.nix index fcc17fb..9325877 100644 --- a/nix/systemd.nix +++ b/nix/systemd.nix @@ -105,7 +105,39 @@ in { Install = {WantedBy = [swayTgt];}; }; - gopls = { + avizo = { + Unit = { + # Description = "brightness/volume OSD"; + # Documentation = "https://github.com/misterdanb/avizo"; + BindsTo = swayTgt; + }; + + Service = { + # Type = "simple"; + # ExecStart = "${pkgs.avizo}/bin/avizo-service"; + Restart = "always"; + RestartSec = "5s"; + PrivateTmp = "yes"; + # DevicePolicy = "closed"; + # NoNewPrivileges = true; + # LockPersonality = true; + InaccessiblePaths = [ + "-/lost+found" + "/dev/shm" + "-%h/.ssh" + "-%h/.gnupg" + ]; + # KeyringMode = "private"; + # SystemCallFilter = "~memfd_create @reboot"; + TimeoutStopFailureMode = "abort"; + }; + + Install = {WantedBy = [swayTgt];}; + }; + + gopls = let + sock = "/tmp/.gopls-daemon.sock"; + in { Unit = { Description = "Go language server"; };