diff --git a/common/desktop_environment/hyprland/default.nix b/common/desktop_environment/hyprland/default.nix index 9726da5..9b627e0 100644 --- a/common/desktop_environment/hyprland/default.nix +++ b/common/desktop_environment/hyprland/default.nix @@ -69,6 +69,8 @@ with lib; wireplumber # media session manager libgtop # system monitor library bluez # Bluetooth support + bluez-tools # Bluetooth tools + blueman # Bluetooth manager power-profiles-daemon # power profiles grimblast # screenshot tool wf-recorder # screen recording tool diff --git a/common/desktop_environment/hyprland/home_manager/default.nix b/common/desktop_environment/hyprland/home_manager/default.nix index 1dbebcb..4c2e83a 100644 --- a/common/desktop_environment/hyprland/home_manager/default.nix +++ b/common/desktop_environment/hyprland/home_manager/default.nix @@ -7,7 +7,6 @@ ./hyprpolkitagent.nix ./wofi.nix ./swaync.nix - ./scripts.nix ./swaylock.nix ]; } diff --git a/common/desktop_environment/hyprland/home_manager/hyprland.nix b/common/desktop_environment/hyprland/home_manager/hyprland.nix index 4f3de04..8560f4c 100644 --- a/common/desktop_environment/hyprland/home_manager/hyprland.nix +++ b/common/desktop_environment/hyprland/home_manager/hyprland.nix @@ -32,14 +32,11 @@ in # Default monitor configuration monitor = "monitor = , preferred, auto, 1"; - windowrulev2 = [ - "float, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$" - "center, class:^(?i)chrome-nngceckbapebfimnlniiiahkandclblb-Default$, initialtitle:^_crx_nngceckbapebfimnlniiiahkandclblb$" - "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.*" - ]; + windowrulev2 = [ + "float, class:.*blueman-manager.*" + "size 700 500, class:.*blueman-manager.*" + "center, class:.*blueman-manager.*" + ]; # Input configuration input = { diff --git a/common/desktop_environment/hyprland/home_manager/scripts.nix b/common/desktop_environment/hyprland/home_manager/scripts.nix deleted file mode 100644 index 6c3d1c5..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ 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)) - ]; -} diff --git a/common/desktop_environment/hyprland/home_manager/scripts/confirm-action.sh b/common/desktop_environment/hyprland/home_manager/scripts/confirm-action.sh deleted file mode 100755 index 5c30d11..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts/confirm-action.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 diff --git a/common/desktop_environment/hyprland/home_manager/scripts/toggle-airplane-mode.sh b/common/desktop_environment/hyprland/home_manager/scripts/toggle-airplane-mode.sh deleted file mode 100755 index 7a6636a..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts/toggle-airplane-mode.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -if [ "$(nmcli radio all)" = "enabled" ]; then - nmcli radio all off -else - nmcli radio all on -fi diff --git a/common/desktop_environment/hyprland/home_manager/scripts/toggle-power-profile.sh b/common/desktop_environment/hyprland/home_manager/scripts/toggle-power-profile.sh deleted file mode 100755 index 1d14395..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts/toggle-power-profile.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -if [ "$(powerprofilesctl get)" = "performance" ]; then - powerprofilesctl set balanced -else - powerprofilesctl set performance -fi diff --git a/common/desktop_environment/hyprland/home_manager/scripts/wofi-bluetooth-menu.sh b/common/desktop_environment/hyprland/home_manager/scripts/wofi-bluetooth-menu.sh deleted file mode 100755 index b7a05dc..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts/wofi-bluetooth-menu.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/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 diff --git a/common/desktop_environment/hyprland/home_manager/scripts/wofi-wifi-menu.sh b/common/desktop_environment/hyprland/home_manager/scripts/wofi-wifi-menu.sh deleted file mode 100755 index 6e4dbbe..0000000 --- a/common/desktop_environment/hyprland/home_manager/scripts/wofi-wifi-menu.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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 diff --git a/common/desktop_environment/hyprland/home_manager/swaync.nix b/common/desktop_environment/hyprland/home_manager/swaync.nix index ce33576..e3e7168 100644 --- a/common/desktop_environment/hyprland/home_manager/swaync.nix +++ b/common/desktop_environment/hyprland/home_manager/swaync.nix @@ -9,7 +9,7 @@ "com.spotify.Client" ]; - positionX = "right"; + positionX = "center"; positionY = "top"; layer = "overlay"; control-center-layer = "top"; @@ -86,17 +86,17 @@ { label = "󰐥"; tooltip = "Shutdown"; - command = "confirm-action 'systemctl poweroff' 'Shutdown?'"; + command = "systemctl poweroff"; } { label = "󰜉"; tooltip = "Reboot"; - command = "confirm-action 'systemctl reboot' 'Reboot?'"; + command = "systemctl reboot"; } { label = "󰍃"; tooltip = "Logout"; - command = "confirm-action 'hyprctl dispatch exit' 'Logout?'"; + command = "hyprctl dispatch exit"; } { label = "󰤄"; @@ -113,7 +113,7 @@ { label = "󰖩"; tooltip = "Wi‑Fi Settings"; - command = "wofi-wifi-menu"; + command = "nm-connection-editor"; } # Bluetooth (requires bluez/bluetoothctl, blueman optional) @@ -125,26 +125,7 @@ { label = "󰂯"; tooltip = "Bluetooth Settings"; - 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"; + command = "blueman-manager"; } ]; }; diff --git a/common/desktop_environment/hyprland/home_manager/waybar.nix b/common/desktop_environment/hyprland/home_manager/waybar.nix index c67d449..f80e490 100644 --- a/common/desktop_environment/hyprland/home_manager/waybar.nix +++ b/common/desktop_environment/hyprland/home_manager/waybar.nix @@ -23,6 +23,7 @@ modules-center = [ "clock" "temperature" + "custom/notifications" "cpu" "memory" "disk" @@ -32,8 +33,8 @@ "pulseaudio" "network" "bluetooth" - "custom/notifications" "hyprland/language" + "custom/power" ]; # Workspaces configuration @@ -84,9 +85,6 @@ "󰕾" ]; }; - scroll-step = 5; - on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - on-click-right = "swaync-client -t -sw"; }; "custom/notifications" = { @@ -111,9 +109,7 @@ }; # Clock - clock = { - format = "{:%b %d, %H:%M}"; - }; + clock.format = "{:%Y-%m-%d} {:%H:%M}"; temperature = { thermal-zone = 2; @@ -147,8 +143,7 @@ tooltip-format = "{ifname} via {gwaddr} "; format-linked = "󰈀 {ifname} (No IP)"; format-disconnected = "󰖪 Disconnected"; - on-click = "wofi-wifi-menu"; - on-click-right = "nmcli radio wifi toggle"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; }; bluetooth = { @@ -159,8 +154,7 @@ 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-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%"; - on-click = "wofi-bluetooth-menu"; - on-click-right = "bluetoothctl power toggle"; + on-click = "blueman-manager"; }; # Keyboard input (language) @@ -169,6 +163,12 @@ format-en = "EN"; format-ja = "JP"; }; + + "custom/power" = { + format = "⏻"; + tooltip = false; + on-click = "wlogout"; + }; }; }; @@ -227,7 +227,8 @@ #disk, #network, #bluetooth, - #language { + #language, + #custom-power { padding: 0 8px; color: #c0caf5; margin: 2px; @@ -237,6 +238,16 @@ color: #f7768e; } + #custom-power { + color: #f7768e; + padding: 0 10px; + } + + #custom-power:hover { + background: rgba(247, 118, 142, 0.2); + border-radius: 5px; + } + #network.disconnected { color: #f7768e; }