From 1996eeb77769a1e0db94c2fc67c8d9266c1f0325 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 17 May 2026 22:34:30 +0200 Subject: [PATCH] audio: script added shortcut --- README.md | 18 +++++++++--------- modules/home-manager/hyprland.nix | 6 ++++-- modules/scripts/changeAudioOutput.nix | 9 +++++---- ...ramework_laptop_16_rgb_macropad.layout.json | 14 +++++++------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index e0e4ca7..92bedb4 100644 --- a/README.md +++ b/README.md @@ -164,15 +164,15 @@ If you **don’t have the physical macropad**, the table below shows which keybi | Macropad Key | Linked Action (Hyprland keybinding) | | ------------ | -------------------------------------------- | | Row 1, Col 1 | Kill all apps except focused (`Ctrl+$mod+6`) | -| Row 2, Col 1 | Performance mode (`Ctrl+Alt+7`) | -| Row 3, Col 1 | Do not disturb (`Ctrl+$mod+4` | -| Row 4, Col 1 | Notification center (`Ctrl+Alt+1`) | -| Row 3, Col 2 | Special characters (`Ctrl+$mod+3`) | -| Row 3, Col 3 | Color picker (`Ctrl+Alt+8`) | -| Row 4, Col 1 | Notification center toggle (`Ctrl+Alt+1`) | -| Row 4, Col 2 | System monitor (`Ctrl+Alt+2`) | -| Row 4, Col 3 | Pomodoro timer (`Ctrl+Alt+0`) | -| Row 4, Col 6 | Launch Anki (`Ctrl+Alt+9`) | +| Row 1, Col 2 | Performance mode (`Ctrl+Alt+7`) | +| Row 1, Col 3 | Do not disturb (`Ctrl+$mod+4` | +| Row 1, Col 4 | Notification center (`Ctrl+Alt+1`) | +| Row 2, Col 1 | Pulseaudio control (`Ctrl+$mod+3`) | +| Row 2, Col 2 | Change audio output (`Ctrl+Alt+Shift+0`) | +| Row 2, Col 3 | Special characters (`Ctrl+$mod+3`) | +| Row 2, Col 4 | Color picker (`Ctrl+Alt+8`) | +| Row 3, Col 1 | Pomodoro timer (`Ctrl+Alt+0`) | +| Row 4, Col 1 | Launch Anki (`Ctrl+Alt+9`) | > Positions are labeled as `[row, column]` starting from top-left `[1,1]`. > Each macro calls a script or application from this configuration. diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index d01b7d2..02d1466 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -161,8 +161,9 @@ in { "Ctrl+Alt, 1, exec, caelestia shell drawers toggle sidebar" "Ctrl+$mod, 4, exec, caelestia shell notifs toggleDnd" "Ctrl+$mod, 3, exec, pavucontrol" # pos 1 2 audiocontrol - "Ctrl+$mod, 5, exec, gnome-characters" # pos 2 2 special chars - "Ctrl+Alt, 8, exec, hyprpicker | tee >(wl-copy) | cliphist store" # pos 3 2 colorpicker + "Ctrl+Shift+Alt, 0, exec, kitty --hold --class \"custom-changeAudioOutput\" --name \"Select audio output\" zsh -c \"custom-changeAudioOutput\"" # pos 2 2 change audio output fzf + "Ctrl+$mod, 5, exec, gnome-characters" # pos 3 2 special chars + "Ctrl+Alt, 8, exec, hyprpicker | tee >(wl-copy) | cliphist store" # pos 4 2 colorpicker "Ctrl+Alt, 0, exec, custom-tomato" # pos 1 3 pomodoro app "Ctrl+Alt, 2, exec, custom-bottom" # pos 2 3 btm (like htop but cleaner) "Ctrl+Alt, 9, exec, anki" @@ -433,6 +434,7 @@ in { "float on, match:class ^(vlc)$" "float on, match:class ^(eog)$" "float on, size 400 175, match:class ^(custom-librewolfprofiles)$" + "float on, size 1050 200, match:class ^(custom-changeAudioOutput)$" "float on, size 400 175, match:class ^(custom-obsidianvaults)$" "float on, size 600 600, match:initial_class ^(custom-pomodoro)$" "float on, size 1500 800, match:initial_class ^(custom-bottom)$" diff --git a/modules/scripts/changeAudioOutput.nix b/modules/scripts/changeAudioOutput.nix index 2b58146..3fda8cc 100644 --- a/modules/scripts/changeAudioOutput.nix +++ b/modules/scripts/changeAudioOutput.nix @@ -1,7 +1,7 @@ { writeShellApplication, fzf, - pactl, + pulseaudio, jq, ... }: @@ -9,13 +9,14 @@ writeShellApplication { name = "custom-changeAudioOutput"; runtimeInputs = [ fzf - pactl + pulseaudio jq ]; text = '' - $select=pactl -f json list sinks | jq -r '.[].name' | fzf + select=$(pactl -f json list sinks | jq -r '.[].name' | fzf) if [[ -n "$select" ]]; then - pactl set-default-sink $select + pactl set-default-sink "$select" + fi ''; } diff --git a/other/kblayouts/framework_laptop_16_rgb_macropad.layout.json b/other/kblayouts/framework_laptop_16_rgb_macropad.layout.json index dced4ef..e8350ee 100644 --- a/other/kblayouts/framework_laptop_16_rgb_macropad.layout.json +++ b/other/kblayouts/framework_laptop_16_rgb_macropad.layout.json @@ -12,7 +12,7 @@ "{+KC_LCTL}{+KC_LALT}7{-KC_LALT}{-KC_LCTL}", "{+KC_LCTL}{+KC_LALT}8{-KC_LALT}{-KC_LCTL}", "{+KC_LCTL}{+KC_LALT}9{-KC_LALT}{-KC_LCTL}", - "", + "{+KC_LCTL}{+KC_LSFT}{+KC_LALT}0{-KC_LALT}{-KC_LSFT}{-KC_LCTL}", "", "", "", @@ -25,19 +25,19 @@ "MACRO(0)", "MACRO(9)", "KC_NO", - "MACRO(5)", + "MACRO(10)", "MACRO(1)", "KC_NO", "KC_NO", "KC_NO", + "MACRO(5)", + "KC_NO", + "KC_NO", + "KC_NO", + "KC_NO", "MACRO(8)", "KC_NO", "KC_NO", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_NO", - "KC_NO", "MACRO(6)", "MACRO(7)", "KC_NO",