Swayosd: Difference between revisions

Phobos (talk | contribs)
m Fixed code
Phobos (talk | contribs)
m Added note and config for keybinds using swayosd
 
Line 15: Line 15:
   # For a custom stylesheet file.
   # For a custom stylesheet file.
   #stylePath = "/etc/xdg/swayosd/style.css";
   #stylePath = "/etc/xdg/swayosd/style.css";
};|name=/etc/nixos/home.nix|lang=nix}}You will need to bind the keys to use swayosd to perform actions. For more specific configuration options check the [https://github.com/ErikReider/SwayOSD swayosd github page]. The following configuration will set up the Volume Controls, Microphone Controls, Caps Lock, Brightness, and Media Controls through swayosd.
{{File|3=wayland.windowManager.sway = {
  enable = true;
  config = {
    keybindings = {
      # Audio Volume Controls (Sink - Output)
      "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
      "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
      "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
       
      # Microphone Volume Control (Source - Input)
      "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
       
      # Caps Lock
      "--release Caps_Lock" = "exec swayosd-client --caps-lock";
       
      # Brightness Controls
      "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
      "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
       
      # Media Player Controls
      "XF86AudioPlay" = "exec swayosd-client --playerctl play-pause";
      "XF86AudioNext" = "exec swayosd-client --playerctl next";
    };
  };
};|name=/etc/nixos/home.nix|lang=nix}}
};|name=/etc/nixos/home.nix|lang=nix}}