From 2f610c6fc2d3cb64851952af53fc1ad521018ccf Mon Sep 17 00:00:00 2001 From: kiana-S Date: Tue, 1 Mar 2022 18:40:48 -0500 Subject: [PATCH] Miscellaneous config changes - Updated flake inputs - Fixed alacritty config - Added sway exit keybind - Added brightness control - Created second wob bar for brightness - Added networkmanager to laptop --- common/config/packages.nix | 1 + common/home-manager/shell/alacritty.nix | 2 +- common/home-manager/wayland/sway.nix | 39 +++++++++++++++---------- flake.lock | 12 ++++---- laptop/config/default.nix | 5 ++++ 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/common/config/packages.nix b/common/config/packages.nix index 7852615..6310331 100644 --- a/common/config/packages.nix +++ b/common/config/packages.nix @@ -14,6 +14,7 @@ in { tldr pandoc pamixer + brightnessctl playerctl screenfetch diff --git a/common/home-manager/shell/alacritty.nix b/common/home-manager/shell/alacritty.nix index 4fa08a0..c80b039 100644 --- a/common/home-manager/shell/alacritty.nix +++ b/common/home-manager/shell/alacritty.nix @@ -3,7 +3,7 @@ programs.alacritty = { enable = true; settings = { - background_opacity = 0.9; + window.opacity = 0.9; # Based on the GNOME Dark theme colors.primary = { diff --git a/common/home-manager/wayland/sway.nix b/common/home-manager/wayland/sway.nix index 22dc093..e1dcbc3 100644 --- a/common/home-manager/wayland/sway.nix +++ b/common/home-manager/wayland/sway.nix @@ -60,8 +60,10 @@ in { startup = map (x: { command = x; }) [ ''~/.azotebg'' - # Make wob channel - ''mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob'' + # Make wob channels + ''mkfifo $SWAYSOCK.volume.wob && tail -f $SWAYSOCK.volume.wob | wob'' + ''mkfifo $SWAYSOCK.brightness.wob && tail -f $SWAYSOCK.brightness.wob | wob \ + --border-color "#FFFF00FF" --bar-color "#FFFF00FF"'' ''swayidle timeout 120 'swaylock -f --grace=180' \ timeout 600 'systemctl suspend' \ before-sleep 'swaylock -f' '' @@ -70,10 +72,13 @@ in { ]; keybindings = let - # Display volume using wob - audio-disp = ''pamixer --get-volume > $SWAYSOCK.wob''; + # Volume using pamixer and wob + audio-disp = ''pamixer --get-volume > $SWAYSOCK.volume.wob''; audio = cmd: "exec pamixer ${cmd} && ${audio-disp}"; - brightness-set = x: "exec brightnessctl set ${x}"; + # Brightness using brightnessctl and wob + brightness-disp = ''brightnessctl get > $SWAYSOCK.brightness.wob''; + brightness = x: "exec brightnessctl set ${x} && ${brightness-disp}"; + # Play controls using playerctl playerctl = cmd: "exec playerctl ${cmd}"; in pkgs.lib.mkOptionDefault { "${modifier}+Shift+d" = ''exec wofi --show run''; @@ -85,15 +90,20 @@ in { "${modifier}+Print" = ''grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')" -o $(date +%Y-%m-%d_%H-%m-%s)''; # Special XF86 key bindings - "XF86AudioRaiseVolume" = audio "-ui 2"; - "XF86AudioLowerVolume" = audio "-ud 2"; - "XF86AudioMute" = ''exec pamixer --toggle-mute''; - "XF86AudioMicMute" = ''exec pactl set-source-mute @DEFAULT_SOURCE@ toggle''; - "XF86MonBrightnessDown" = brightness-set "5%-"; - "XF86MonBrightnessUp" = brightness-set "+5%"; - "XF86AudioPlay" = playerctl "play-pause"; - "XF86AudioNext" = playerctl "next"; - "XF86AudioPrev" = playerctl "previous"; + "XF86AudioRaiseVolume" = audio "-ui 2"; + "XF86AudioLowerVolume" = audio "-ud 2"; + "Shift+XF86AudioRaiseVolume" = audio "-ui 2 --allow-boost"; + "Shift+XF86AudioLowerVolume" = audio "-ud 2 --allow-boost"; + "XF86AudioMute" = ''exec pamixer --toggle-mute''; + "XF86AudioMicMute" = ''exec pactl set-source-mute @DEFAULT_SOURCE@ toggle''; + "XF86MonBrightnessDown" = brightness "5-"; + "XF86MonBrightnessUp" = brightness "+5"; + "XF86AudioPlay" = playerctl "play-pause"; + "XF86AudioNext" = playerctl "next"; + "XF86AudioPrev" = playerctl "previous"; + + # Exit + "${modifier}+Shift+e" = ''exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' ''; }; output."*" = { @@ -102,4 +112,3 @@ in { }; }; } -# bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' diff --git a/flake.lock b/flake.lock index 5e774d1..f68857c 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1645748302, - "narHash": "sha256-uUzNyT0XSkwh4Vsrn4M/+i3j89y4FFxEiLww+qXxeJU=", + "lastModified": 1646173104, + "narHash": "sha256-ajtk7Buvg2v3QRBMQ+cYLia67QFax0XI0ZItTl8eHPw=", "owner": "kiana-S", "repo": "nixos-hardware", - "rev": "75df50946ad6bc126e2773ed6aae323ebb0e3078", + "rev": "8530cfe9a9d41323fb760977538011e930c0343d", "type": "github" }, "original": { @@ -53,11 +53,11 @@ }, "nur": { "locked": { - "lastModified": 1646092373, - "narHash": "sha256-sKyF5z6FPC3G12AvSz/xoV0z48J1N1m82GriyQiPcQA=", + "lastModified": 1646158169, + "narHash": "sha256-MCZe/mDI9CWbLwS/CwK33Gr1m/5JTI3Qo182Y70ZBUc=", "owner": "nix-community", "repo": "NUR", - "rev": "15e0e6b4cf7e33f44da1ae2f55bb2f2a9205cc0c", + "rev": "a987395f66b630dff8cc616818dacfff6dc2dfb1", "type": "github" }, "original": { diff --git a/laptop/config/default.nix b/laptop/config/default.nix index 4cf6037..1c50923 100644 --- a/laptop/config/default.nix +++ b/laptop/config/default.nix @@ -14,4 +14,9 @@ in { # Passwords users.users.kiana = { inherit hashedPassword; }; users.users.root = { inherit hashedPassword; }; + + # Networking + networking.wireless.enable = false; + networking.networkmanager.enable = true; + users.users.kiana.extraGroups = [ "networkmanager" ]; }