From 164c0a9ec9c0c684544f35b67cb68f66dfa6f9a8 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 28 Mar 2024 06:33:58 +0300 Subject: [PATCH] Sway : Add brightness and volume controls. --- module/Sway.nix | 11 +++++++++-- module/sway/module/10-Brightness | 3 +++ module/sway/module/10-Volume | 4 ++++ user/Dasha.nix | 12 +++++++----- user/Voronind.nix | 12 +++++++----- 5 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 module/sway/module/10-Brightness create mode 100644 module/sway/module/10-Volume diff --git a/module/Sway.nix b/module/Sway.nix index 3ead977..f621057 100644 --- a/module/Sway.nix +++ b/module/Sway.nix @@ -10,7 +10,7 @@ xdg.mime.defaultApplications = { # Use `file -i file.txt` to find file mime type. # Use `xdg-mime query default "text/plain"` to find default app. - "application/pdf" = "org.gnome.Evince.desktop"; + "application/pdf" = "org.gnome.Evince.desktop"; # TODO: Different apps? "application/vnd.openxmlformats-officedocument.*" = "onlyoffice-desktopeditors.desktop"; "audio/*" = "mpv.desktop"; "image/*" = "org.gnome.Loupe.desktop"; @@ -21,7 +21,10 @@ # Extra apps. services.gnome.gnome-keyring.enable = lib.mkForce false; environment.systemPackages = with pkgs; [ - wl-clipboard + grim # Screenshot. + mako # Notification system. + slurp # Screenshot. + wl-clipboard # Clipboard. ]; # Sound. @@ -47,6 +50,10 @@ ]; }; + # Brightness control. + programs.light.enable = true; + + # Configs. environment.variables = { FOOT_CONFIG = ./foot/Foot.ini; SWAY_CONFIG = ./sway/module; diff --git a/module/sway/module/10-Brightness b/module/sway/module/10-Brightness new file mode 100644 index 0000000..d27717e --- /dev/null +++ b/module/sway/module/10-Brightness @@ -0,0 +1,3 @@ +# Brightness +bindsym XF86MonBrightnessDown exec light -U 10 +bindsym XF86MonBrightnessUp exec light -A 10 diff --git a/module/sway/module/10-Volume b/module/sway/module/10-Volume new file mode 100644 index 0000000..641f3fe --- /dev/null +++ b/module/sway/module/10-Volume @@ -0,0 +1,4 @@ +# Volume +bindsym XF86AudioRaiseVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%' +bindsym XF86AudioLowerVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%' +bindsym XF86AudioMute exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle' diff --git a/user/Dasha.nix b/user/Dasha.nix index 3d2f65b..bf77ab5 100644 --- a/user/Dasha.nix +++ b/user/Dasha.nix @@ -3,12 +3,14 @@ ./home/Dasha.nix ]; users.users.dasha = { - hashedPassword = "$y$j9T$WGMPv/bRhGBUidcZLZ7CE/$raZhwFFdI/XvegVZVHLILJLMiBkOxSErc6gao/Cxt33"; # Use `mkpasswd`. - uid = 1001; createHome = true; - isNormalUser = true; description = "Daria Dranchak"; - extraGroups = [ "networkmanager" ]; - packages = with pkgs; [ ]; + hashedPassword = "$y$j9T$WGMPv/bRhGBUidcZLZ7CE/$raZhwFFdI/XvegVZVHLILJLMiBkOxSErc6gao/Cxt33"; + isNormalUser = true; + uid = 1001; + extraGroups = [ + "networkmanager" + "video" + ]; }; } diff --git a/user/Voronind.nix b/user/Voronind.nix index 7f08f34..ea85401 100644 --- a/user/Voronind.nix +++ b/user/Voronind.nix @@ -3,12 +3,14 @@ ./home/Voronind.nix ]; users.users.voronind = { - hashedPassword = const.hashedPassword; - uid = 1000; createHome = true; - isNormalUser = true; description = "Dmitry Voronin"; - extraGroups = [ "networkmanager" ]; - packages = with pkgs; [ ]; + hashedPassword = const.hashedPassword; + isNormalUser = true; + uid = 1000; + extraGroups = [ + "networkmanager" + "video" + ]; }; }