Swayosd: Difference between revisions

Phobos (talk | contribs)
Created a page for swayosd
 
Phobos (talk | contribs)
m Added note and config for keybinds using swayosd
 
(One intermediate revision by the same user not shown)
Line 12: Line 12:
   enable = true;
   enable = true;
   # OSD Margin from the top edge, 0.5 would be the screen center. May be from 0.0 - 1.0.
   # OSD Margin from the top edge, 0.5 would be the screen center. May be from 0.0 - 1.0.
   topMargin = 1;
   topMargin = 0.9;
   # 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}}