wip waybar and swaync updates
This commit is contained in:
parent
d1053b6282
commit
69de4ca87b
11 changed files with 124 additions and 15 deletions
|
|
@ -69,8 +69,6 @@ with lib;
|
||||||
wireplumber # media session manager
|
wireplumber # media session manager
|
||||||
libgtop # system monitor library
|
libgtop # system monitor library
|
||||||
bluez # Bluetooth support
|
bluez # Bluetooth support
|
||||||
bluez-tools # Bluetooth tools
|
|
||||||
blueman # Bluetooth manager
|
|
||||||
power-profiles-daemon # power profiles
|
power-profiles-daemon # power profiles
|
||||||
grimblast # screenshot tool
|
grimblast # screenshot tool
|
||||||
wf-recorder # screen recording tool
|
wf-recorder # screen recording tool
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
./hyprpolkitagent.nix
|
./hyprpolkitagent.nix
|
||||||
./wofi.nix
|
./wofi.nix
|
||||||
./swaync.nix
|
./swaync.nix
|
||||||
|
./scripts.nix
|
||||||
./swaylock.nix
|
./swaylock.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,14 @@ in
|
||||||
# Default monitor configuration
|
# Default monitor configuration
|
||||||
monitor = "monitor = , preferred, auto, 1";
|
monitor = "monitor = , preferred, auto, 1";
|
||||||
|
|
||||||
windowrulev2 = [
|
windowrulev2 = [
|
||||||
"float, class:.*blueman-manager.*"
|
"float, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$"
|
||||||
"size 700 500, class:.*blueman-manager.*"
|
"center, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$"
|
||||||
"center, class:.*blueman-manager.*"
|
"size 720 600, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$"
|
||||||
];
|
"float, class:.*blueman-manager.*"
|
||||||
|
"size 700 500, class:.*blueman-manager.*"
|
||||||
|
"center, class:.*blueman-manager.*"
|
||||||
|
];
|
||||||
|
|
||||||
# Input configuration
|
# Input configuration
|
||||||
input = {
|
input = {
|
||||||
|
|
|
||||||
10
common/desktop_environment/hyprland/home_manager/scripts.nix
Normal file
10
common/desktop_environment/hyprland/home_manager/scripts.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
(writeShellScriptBin "toggle-airplane-mode" (builtins.readFile ./scripts/toggle-airplane-mode.sh))
|
||||||
|
(writeShellScriptBin "toggle-power-profile" (builtins.readFile ./scripts/toggle-power-profile.sh))
|
||||||
|
(writeShellScriptBin "wofi-wifi-menu" (builtins.readFile ./scripts/wofi-wifi-menu.sh))
|
||||||
|
(writeShellScriptBin "wofi-bluetooth-menu" (builtins.readFile ./scripts/wofi-bluetooth-menu.sh))
|
||||||
|
(writeShellScriptBin "confirm-action" (builtins.readFile ./scripts/confirm-action.sh))
|
||||||
|
];
|
||||||
|
}
|
||||||
14
common/desktop_environment/hyprland/home_manager/scripts/confirm-action.sh
Executable file
14
common/desktop_environment/hyprland/home_manager/scripts/confirm-action.sh
Executable file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
COMMAND_TO_RUN="$1"
|
||||||
|
PROMPT_MESSAGE="$2"
|
||||||
|
|
||||||
|
if [ -z "$PROMPT_MESSAGE" ]; then
|
||||||
|
PROMPT_MESSAGE="Are you sure?"
|
||||||
|
fi
|
||||||
|
|
||||||
|
choice=$(echo -e "No\nYes" | wofi --dmenu --location center -p "$PROMPT_MESSAGE")
|
||||||
|
|
||||||
|
if [ "$choice" == "Yes" ]; then
|
||||||
|
eval "$COMMAND_TO_RUN"
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ "$(nmcli radio all)" = "enabled" ]; then
|
||||||
|
nmcli radio all off
|
||||||
|
else
|
||||||
|
nmcli radio all on
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ "$(powerprofilesctl get)" = "performance" ]; then
|
||||||
|
powerprofilesctl set balanced
|
||||||
|
else
|
||||||
|
powerprofilesctl set performance
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
devices=$(bluetoothctl devices | awk '{print $2, $3}')
|
||||||
|
|
||||||
|
if [ -z "$devices" ]; then
|
||||||
|
options=" Power On\n Scan for devices"
|
||||||
|
else
|
||||||
|
options="$devices\n Power Off\n Scan for devices"
|
||||||
|
fi
|
||||||
|
|
||||||
|
chosen=$(echo -e "$options" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Bluetooth")
|
||||||
|
|
||||||
|
case "$chosen" in
|
||||||
|
" Power On") bluetoothctl power on;;
|
||||||
|
" Power Off") bluetoothctl power off;;
|
||||||
|
" Scan for devices") bluetoothctl scan on;;
|
||||||
|
*)
|
||||||
|
mac=$(echo "$chosen" | awk '{print $1}')
|
||||||
|
bluetoothctl connect "$mac"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
24
common/desktop_environment/hyprland/home_manager/scripts/wofi-wifi-menu.sh
Executable file
24
common/desktop_environment/hyprland/home_manager/scripts/wofi-wifi-menu.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Get a list of available Wi-Fi networks
|
||||||
|
nets=$(nmcli --terse --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 's/\\:/__/g')
|
||||||
|
|
||||||
|
# Get the current connection status
|
||||||
|
connected_ssid=$(nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d: -f2)
|
||||||
|
|
||||||
|
if [[ ! -z "$connected_ssid" ]]; then
|
||||||
|
toggle=" Toggle Wi-Fi Off"
|
||||||
|
else
|
||||||
|
toggle=" Toggle Wi-Fi On"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Present the menu to the user
|
||||||
|
chosen_network=$(echo -e "$toggle\n$nets" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Wi-Fi Networks")
|
||||||
|
|
||||||
|
# Perform an action based on the user's choice
|
||||||
|
if [ "$chosen_network" = "$toggle" ]; then
|
||||||
|
nmcli radio wifi $([ "$connected_ssid" = "" ] && echo "on" || echo "off")
|
||||||
|
elif [ ! -z "$chosen_network" ]; then
|
||||||
|
ssid=$(echo "$chosen_network" | sed 's/__/\\:/g' | awk -F' ' '{print $1}')
|
||||||
|
nmcli device wifi connect "$ssid"
|
||||||
|
fi
|
||||||
|
|
@ -86,17 +86,17 @@
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
tooltip = "Shutdown";
|
tooltip = "Shutdown";
|
||||||
command = "systemctl poweroff";
|
command = "confirm-action 'systemctl poweroff' 'Shutdown?'";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
tooltip = "Reboot";
|
tooltip = "Reboot";
|
||||||
command = "systemctl reboot";
|
command = "confirm-action 'systemctl reboot' 'Reboot?'";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
tooltip = "Logout";
|
tooltip = "Logout";
|
||||||
command = "hyprctl dispatch exit";
|
command = "confirm-action 'hyprctl dispatch exit' 'Logout?'";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
tooltip = "Wi‑Fi Settings";
|
tooltip = "Wi‑Fi Settings";
|
||||||
command = "nm-connection-editor";
|
command = "wofi-wifi-menu";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Bluetooth (requires bluez/bluetoothctl, blueman optional)
|
# Bluetooth (requires bluez/bluetoothctl, blueman optional)
|
||||||
|
|
@ -125,7 +125,26 @@
|
||||||
{
|
{
|
||||||
label = "";
|
label = "";
|
||||||
tooltip = "Bluetooth Settings";
|
tooltip = "Bluetooth Settings";
|
||||||
command = "blueman-manager";
|
command = "wofi-bluetooth-menu";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Media
|
||||||
|
{
|
||||||
|
label = "";
|
||||||
|
tooltip = "Toggle Mic Mute";
|
||||||
|
command = "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Toggles
|
||||||
|
{
|
||||||
|
label = "";
|
||||||
|
tooltip = "Toggle Airplane Mode";
|
||||||
|
command = "toggle-airplane-mode";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
label = "";
|
||||||
|
tooltip = "Toggle Power Profile";
|
||||||
|
command = "toggle-power-profile";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,9 @@
|
||||||
""
|
""
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
scroll-step = 5;
|
||||||
|
on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
|
on-click-right = "swaync-client -t -sw";
|
||||||
};
|
};
|
||||||
|
|
||||||
"custom/notifications" = {
|
"custom/notifications" = {
|
||||||
|
|
@ -108,7 +111,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Clock
|
# Clock
|
||||||
clock.format = "{:%Y-%m-%d} {:%H:%M}";
|
clock = {
|
||||||
|
format = "{:%b %d, %H:%M}";
|
||||||
|
};
|
||||||
|
|
||||||
temperature = {
|
temperature = {
|
||||||
thermal-zone = 2;
|
thermal-zone = 2;
|
||||||
|
|
@ -142,7 +147,8 @@
|
||||||
tooltip-format = "{ifname} via {gwaddr} ";
|
tooltip-format = "{ifname} via {gwaddr} ";
|
||||||
format-linked = " {ifname} (No IP)";
|
format-linked = " {ifname} (No IP)";
|
||||||
format-disconnected = " Disconnected";
|
format-disconnected = " Disconnected";
|
||||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
on-click = "wofi-wifi-menu";
|
||||||
|
on-click-right = "nmcli radio wifi toggle";
|
||||||
};
|
};
|
||||||
|
|
||||||
bluetooth = {
|
bluetooth = {
|
||||||
|
|
@ -153,7 +159,8 @@
|
||||||
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
|
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
|
||||||
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
||||||
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
|
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
|
||||||
on-click = "blueman-manager";
|
on-click = "wofi-bluetooth-menu";
|
||||||
|
on-click-right = "bluetoothctl power toggle";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Keyboard input (language)
|
# Keyboard input (language)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue