mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-07-07 00:22:33 +02:00
@@ -133,6 +133,7 @@ in {
|
||||
"$mod,Q, killactive," # Close window
|
||||
"$mod,F, fullscreen" # Toggle Fullscreen
|
||||
"$shiftMod,F, togglefloating," # Toggle Floating
|
||||
"$shiftMod, SPACE, exec, focus-toggle" # Toggle focus mode
|
||||
|
||||
# Focus Windows
|
||||
"$mod,H, movefocus, l" # Move focus left
|
||||
|
||||
@@ -79,7 +79,6 @@ in {
|
||||
|
||||
cursor = {
|
||||
no_hardware_cursors = true;
|
||||
default_monitor = "eDP-2";
|
||||
};
|
||||
|
||||
general = {
|
||||
@@ -117,6 +116,10 @@ in {
|
||||
|
||||
gesture = "3, horizontal, workspace";
|
||||
|
||||
layerrule = [
|
||||
"match:namespace launcher, animation popin 70%"
|
||||
];
|
||||
|
||||
windowrule = [
|
||||
"match:class .*, suppress_event maximize"
|
||||
"match:class helium, suppress_event fullscreen"
|
||||
|
||||
@@ -19,10 +19,12 @@ in {
|
||||
settings = {
|
||||
positionX = "right";
|
||||
positionY = "top";
|
||||
layer = "overlay";
|
||||
"control-center-layer" = "overlay";
|
||||
cssPriority = "user";
|
||||
"control-center-width" = 450;
|
||||
"control-center-margin-top" = 0;
|
||||
"control-center-margin-bottom" = 0;
|
||||
"control-center-margin-top" = config.theme.gaps-out * 2;
|
||||
"control-center-margin-bottom" = config.theme.gaps-out * 2;
|
||||
"control-center-margin-right" = 0;
|
||||
"fit-to-screen" = true;
|
||||
"notification-window-width" = 400;
|
||||
@@ -40,9 +42,17 @@ in {
|
||||
"hide-on-clear" = false;
|
||||
"hide-on-action" = false;
|
||||
"script-fail-notify" = true;
|
||||
widgets = ["mpris" "dnd" "buttons-grid" "notifications"];
|
||||
widgets = ["mpris" "volume" "backlight" "dnd" "buttons-grid" "notifications"];
|
||||
"widget-config" = {
|
||||
dnd.text = "Do not disturb";
|
||||
volume = {
|
||||
label = "";
|
||||
"show-per-app" = false;
|
||||
};
|
||||
backlight = {
|
||||
label = "";
|
||||
"min" = 0;
|
||||
};
|
||||
mpris = {
|
||||
"image-size" = 100;
|
||||
"image-radius" = 10;
|
||||
@@ -83,7 +93,7 @@ in {
|
||||
};
|
||||
|
||||
style = ''
|
||||
@define-color center-bg #${c.base00}${alphaHex};
|
||||
@define-color center-bg #${c.base01}${alphaHex};
|
||||
@define-color notification-bg #${c.base00}${alphaHex};
|
||||
@define-color center-notification-bg #${c.base01};
|
||||
@define-color background #${c.base00}${alphaHex};
|
||||
@@ -192,7 +202,7 @@ in {
|
||||
|
||||
.control-center {
|
||||
background: @center-bg;
|
||||
border-radius: 0 0 0 var(--border-radius);
|
||||
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
||||
border-left: ${toString border-size}px solid @selected;
|
||||
margin: 0;
|
||||
padding: 5px 5px 0 5px;
|
||||
@@ -287,6 +297,48 @@ in {
|
||||
background: @hover;
|
||||
}
|
||||
|
||||
.widget-volume,
|
||||
.widget-backlight {
|
||||
border-radius: var(--border-radius);
|
||||
padding: 10px 15px;
|
||||
background: @background-alt;
|
||||
box-shadow: var(--shadow);
|
||||
color: @text;
|
||||
}
|
||||
|
||||
.widget-volume > box,
|
||||
.widget-backlight > box {
|
||||
color: @text;
|
||||
}
|
||||
|
||||
.widget-volume label,
|
||||
.widget-backlight label {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
min-width: 1.2rem;
|
||||
}
|
||||
|
||||
.widget-volume slider,
|
||||
.widget-backlight slider {
|
||||
background: @text;
|
||||
border-radius: var(--border-radius-s);
|
||||
min-height: 12px;
|
||||
min-width: 12px;
|
||||
}
|
||||
|
||||
.widget-volume trough,
|
||||
.widget-backlight trough {
|
||||
background: @hover;
|
||||
border-radius: var(--border-radius-s);
|
||||
min-height: 4px;
|
||||
}
|
||||
|
||||
.widget-volume highlight,
|
||||
.widget-backlight highlight {
|
||||
background: @text;
|
||||
border-radius: var(--border-radius-s);
|
||||
}
|
||||
|
||||
.widget-dnd {
|
||||
padding: 10px 15px;
|
||||
border-radius: var(--border-radius);
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
c = config.lib.stylix.colors;
|
||||
rounding = config.theme.rounding;
|
||||
border-size = config.theme.border-size;
|
||||
gaps-in = config.theme.gaps-in;
|
||||
opacityToHex = opacity: let
|
||||
val = builtins.floor (opacity * 255);
|
||||
high = val / 16;
|
||||
low = val - high * 16;
|
||||
digits = "0123456789abcdef";
|
||||
in "${builtins.substring high 1 digits}${builtins.substring low 1 digits}";
|
||||
alphaHex = opacityToHex config.theme.inactive-opacity;
|
||||
|
||||
style = pkgs.writeText "swayosd-style.css" ''
|
||||
window#osd {
|
||||
background: #${c.base00}${alphaHex};
|
||||
border-radius: ${toString rounding}px;
|
||||
border: ${toString border-size}px solid #${c.base03}66;
|
||||
}
|
||||
|
||||
window#osd #container {
|
||||
margin: ${toString gaps-in}px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
window#osd image,
|
||||
window#osd label {
|
||||
color: #${c.base05};
|
||||
}
|
||||
|
||||
window#osd progressbar,
|
||||
window#osd segmentedprogress {
|
||||
min-height: 6px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
window#osd trough,
|
||||
window#osd segment {
|
||||
min-height: inherit;
|
||||
border-radius: inherit;
|
||||
border: none;
|
||||
background: #${c.base03}66;
|
||||
}
|
||||
|
||||
window#osd progress,
|
||||
window#osd segment.active {
|
||||
min-height: inherit;
|
||||
border-radius: inherit;
|
||||
border: none;
|
||||
background: #${c.base0D};
|
||||
}
|
||||
|
||||
window#osd segment { margin-left: 4px; }
|
||||
window#osd segment:first-child { margin-left: 0; }
|
||||
'';
|
||||
in {
|
||||
services.swayosd = {
|
||||
enable = false;
|
||||
stylePath = style;
|
||||
topMargin = 0.06;
|
||||
};
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
then barHeight / 2
|
||||
else config.theme.rounding;
|
||||
in {
|
||||
imports = [./desktop-actions.nix];
|
||||
programs.tofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
@@ -31,6 +32,7 @@ in {
|
||||
|
||||
font = lib.mkForce font;
|
||||
prompt-color = lib.mkForce "#${c.base0D}ff";
|
||||
selection-color = lib.mkForce "#${c.base0D}ff";
|
||||
|
||||
outline-width = 0;
|
||||
border-width = 0;
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
{...}: {
|
||||
xdg.desktopEntries = {
|
||||
focus-toggle = {
|
||||
name = "Focus Mode";
|
||||
exec = "focus-toggle";
|
||||
icon = "do-not-disturb-symbolic";
|
||||
comment = "Toggle focus mode";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
nightshift-toggle = {
|
||||
name = "Night Shift";
|
||||
exec = "nightshift-toggle";
|
||||
icon = "night-light-symbolic";
|
||||
comment = "Toggle night shift";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
mic-mute = {
|
||||
name = "Mute Microphone";
|
||||
exec = "mic-mute";
|
||||
icon = "microphone-sensitivity-muted-symbolic";
|
||||
comment = "Toggle microphone mute";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
lock = {
|
||||
name = "Lock";
|
||||
exec = "hyprlock";
|
||||
icon = "system-lock-screen-symbolic";
|
||||
comment = "Lock the screen";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
reboot = {
|
||||
name = "Reboot";
|
||||
exec = "systemctl reboot";
|
||||
icon = "system-restart-symbolic";
|
||||
comment = "Restart the system";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
shutdown = {
|
||||
name = "Shutdown";
|
||||
exec = "systemctl poweroff";
|
||||
icon = "system-shutdown-symbolic";
|
||||
comment = "Power off the system";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
hibernate = {
|
||||
name = "Hibernate";
|
||||
exec = "systemctl hibernate";
|
||||
icon = "drive-harddisk-symbolic";
|
||||
comment = "Hibernate the system";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
waybar-toggle = {
|
||||
name = "Toggle Waybar";
|
||||
exec = "waybar-toggle";
|
||||
icon = "panel-applets-symbolic";
|
||||
comment = "Show or hide the status bar";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
wifi-toggle = {
|
||||
name = "Toggle Wi-Fi";
|
||||
exec = "wifi-toggle";
|
||||
icon = "network-wireless-symbolic";
|
||||
comment = "Enable or disable Wi-Fi";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
bluetooth-toggle = {
|
||||
name = "Toggle Bluetooth";
|
||||
exec = "bluetooth-toggle";
|
||||
icon = "bluetooth-symbolic";
|
||||
comment = "Enable or disable Bluetooth";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
logout = {
|
||||
name = "Logout";
|
||||
exec = "hyprctl dispatch exit";
|
||||
icon = "system-log-out-symbolic";
|
||||
comment = "End the current session";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
spotatui = {
|
||||
name = "Spotify";
|
||||
exec = "ghostty -e spotatui";
|
||||
icon = "spotify";
|
||||
comment = "Control Spotify from the terminal";
|
||||
categories = ["Audio" "Music"];
|
||||
terminal = false;
|
||||
settings.Keywords = "spotify;spotatui;music;";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,110 +1,26 @@
|
||||
{pkgs, ...}: let
|
||||
networkScript = pkgs.writeShellScript "waybar-network" ''
|
||||
for iface in $(${pkgs.iproute2}/bin/ip -br link show | awk '$2 == "UP" {print $1}' | grep -vE '^(lo|tun|proton|wg[0-9]|ppp|vpn|docker|br-|veth|virbr)'); do
|
||||
ip=$(${pkgs.iproute2}/bin/ip addr show "$iface" 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | head -1)
|
||||
if [ -n "$ip" ]; then
|
||||
if [[ "$iface" == wl* ]]; then
|
||||
ssid=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep SSID | sed 's/.*SSID: //')
|
||||
signal=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep signal | awk '{print $2}')
|
||||
printf '{"text": "", "class": "wifi", "tooltip": " %s\\n %s dBm"}\n' "$ssid" "$signal"
|
||||
else
|
||||
printf '{"text": "", "class": "ethernet", "tooltip": " %s\\n %s"}\n' "$iface" "$ip"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
printf '{"text": "", "class": "disconnected", "tooltip": "Disconnected"}\n'
|
||||
'';
|
||||
|
||||
updateOsd = ''
|
||||
[ -f /tmp/waybar-osd-pid ] && kill "$(cat /tmp/waybar-osd-pid)" 2>/dev/null
|
||||
printf '%s' "$OSD_TEXT" > /tmp/waybar-osd
|
||||
pkill -RTMIN+8 waybar 2>/dev/null
|
||||
( sleep 2.5; rm -f /tmp/waybar-osd /tmp/waybar-osd-pid; pkill -RTMIN+8 waybar 2>/dev/null ) &
|
||||
printf '%s' "$!" > /tmp/waybar-osd-pid
|
||||
'';
|
||||
|
||||
volGetText = ''
|
||||
VOL_RAW=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SINK@)
|
||||
VOL=$(printf '%s' "$VOL_RAW" | awk '{printf "%d", $2*100}')
|
||||
if printf '%s' "$VOL_RAW" | grep -q MUTED; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
elif [ "$VOL" -lt 33 ]; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
elif [ "$VOL" -lt 66 ]; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
else
|
||||
OSD_TEXT=" $VOL%"
|
||||
fi
|
||||
'';
|
||||
|
||||
brightGetText = ''
|
||||
BRIGHT=$(${pkgs.brightnessctl}/bin/brightnessctl -m | awk -F, '{print int($5)}')
|
||||
if [ "$BRIGHT" -lt 33 ]; then
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
elif [ "$BRIGHT" -lt 66 ]; then
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
else
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
fi
|
||||
'';
|
||||
|
||||
vol-up = pkgs.writeShellScriptBin "vol-up" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%+ --limit 1.0
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
vol-down = pkgs.writeShellScriptBin "vol-down" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
vol-mute = pkgs.writeShellScriptBin "vol-mute" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SINK@ toggle
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
mic-mute = pkgs.writeShellScriptBin "mic-mute" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SOURCE@ toggle
|
||||
if ${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SOURCE@ | grep -q MUTED; then
|
||||
OSD_TEXT=" Muted"
|
||||
else
|
||||
OSD_TEXT=" Live"
|
||||
fi
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
bright-up = pkgs.writeShellScriptBin "bright-up" ''
|
||||
${pkgs.brightnessctl}/bin/brightnessctl set 5%+
|
||||
${brightGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
bright-down = pkgs.writeShellScriptBin "bright-down" ''
|
||||
${pkgs.brightnessctl}/bin/brightnessctl set 5%-
|
||||
${brightGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
scripts = import ./scripts.nix {inherit pkgs;};
|
||||
in {
|
||||
imports = [
|
||||
./settings.nix
|
||||
./style.nix
|
||||
];
|
||||
|
||||
_module.args.networkScript = networkScript;
|
||||
_module.args.networkScript = scripts.networkScript;
|
||||
_module.args.bluetoothScript = scripts.bluetoothScript;
|
||||
|
||||
programs.waybar.enable = true;
|
||||
stylix.targets.waybar.enable = false;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
playerctl
|
||||
pavucontrol
|
||||
blueman
|
||||
iw
|
||||
] ++ [vol-up vol-down vol-mute mic-mute bright-up bright-down];
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
playerctl
|
||||
pavucontrol
|
||||
blueman
|
||||
iw
|
||||
hyprsunset
|
||||
]
|
||||
++ (with scripts; [vol-up vol-down vol-mute mic-mute bright-up bright-down nightshift-toggle focus-toggle waybar-toggle wifi-toggle bluetooth-toggle]);
|
||||
|
||||
wayland.windowManager.hyprland.settings.exec-once = [
|
||||
"waybar"
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
{pkgs}: let
|
||||
updateOsd = ''
|
||||
[ -f /tmp/waybar-osd-pid ] && kill "$(cat /tmp/waybar-osd-pid)" 2>/dev/null
|
||||
printf '%s' "$OSD_TEXT" > /tmp/waybar-osd
|
||||
pkill -RTMIN+8 waybar 2>/dev/null
|
||||
( sleep 2.5; rm -f /tmp/waybar-osd /tmp/waybar-osd-pid; pkill -RTMIN+8 waybar 2>/dev/null ) &
|
||||
printf '%s' "$!" > /tmp/waybar-osd-pid
|
||||
'';
|
||||
|
||||
volGetText = ''
|
||||
VOL_RAW=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SINK@)
|
||||
VOL=$(printf '%s' "$VOL_RAW" | awk '{printf "%d", $2*100}')
|
||||
if printf '%s' "$VOL_RAW" | grep -q MUTED; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
elif [ "$VOL" -lt 33 ]; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
elif [ "$VOL" -lt 66 ]; then
|
||||
OSD_TEXT=" $VOL%"
|
||||
else
|
||||
OSD_TEXT=" $VOL%"
|
||||
fi
|
||||
'';
|
||||
|
||||
brightGetText = ''
|
||||
BRIGHT=$(${pkgs.brightnessctl}/bin/brightnessctl -m | awk -F, '{print int($5)}')
|
||||
if [ "$BRIGHT" -lt 33 ]; then
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
elif [ "$BRIGHT" -lt 66 ]; then
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
else
|
||||
OSD_TEXT=" $BRIGHT%"
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
bluetoothScript = pkgs.writeShellScript "waybar-bluetooth" ''
|
||||
if bluetoothctl show 2>/dev/null | grep -q "Powered: yes"; then
|
||||
device=$(bluetoothctl devices Connected 2>/dev/null | head -1 | cut -d' ' -f3-)
|
||||
if [ -n "$device" ]; then
|
||||
printf '{"text": "%s", "class": "connected", "tooltip": "Bluetooth\\n %s"}\n' "$device" "$device"
|
||||
else
|
||||
printf '{"text": "", "class": "on", "tooltip": "Bluetooth on"}\n'
|
||||
fi
|
||||
else
|
||||
printf '{"text": "", "class": "off", "tooltip": "Bluetooth off"}\n'
|
||||
fi
|
||||
'';
|
||||
|
||||
networkScript = pkgs.writeShellScript "waybar-network" ''
|
||||
for iface in $(${pkgs.iproute2}/bin/ip -br link show | awk '$2 == "UP" {print $1}' | grep -vE '^(lo|tun|proton|wg[0-9]|ppp|vpn|docker|br-|veth|virbr)'); do
|
||||
ip=$(${pkgs.iproute2}/bin/ip addr show "$iface" 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | head -1)
|
||||
if [ -n "$ip" ]; then
|
||||
if [[ "$iface" == wl* ]]; then
|
||||
ssid=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep SSID | sed 's/.*SSID: //')
|
||||
signal=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep signal | awk '{print $2}')
|
||||
printf '{"text": "", "class": "wifi", "tooltip": " %s\\n %s dBm"}\n' "$ssid" "$signal"
|
||||
else
|
||||
printf '{"text": "", "class": "ethernet", "tooltip": " %s\\n %s"}\n' "$iface" "$ip"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
printf '{"text": "", "class": "disconnected", "tooltip": "Disconnected"}\n'
|
||||
'';
|
||||
|
||||
vol-up = pkgs.writeShellScriptBin "vol-up" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%+ --limit 1.0
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
vol-down = pkgs.writeShellScriptBin "vol-down" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
vol-mute = pkgs.writeShellScriptBin "vol-mute" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SINK@ toggle
|
||||
${volGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
mic-mute = pkgs.writeShellScriptBin "mic-mute" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SOURCE@ toggle
|
||||
if ${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SOURCE@ | grep -q MUTED; then
|
||||
OSD_TEXT=" Muted"
|
||||
else
|
||||
OSD_TEXT=" Live"
|
||||
fi
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
bright-up = pkgs.writeShellScriptBin "bright-up" ''
|
||||
${pkgs.brightnessctl}/bin/brightnessctl set 5%+
|
||||
${brightGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
bright-down = pkgs.writeShellScriptBin "bright-down" ''
|
||||
${pkgs.brightnessctl}/bin/brightnessctl set 5%-
|
||||
${brightGetText}
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
wifi-toggle = pkgs.writeShellScriptBin "wifi-toggle" ''
|
||||
if nmcli radio wifi | grep -q enabled; then
|
||||
nmcli radio wifi off
|
||||
else
|
||||
nmcli radio wifi on
|
||||
fi
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
bluetooth-toggle = pkgs.writeShellScriptBin "bluetooth-toggle" ''
|
||||
if bluetoothctl show | grep -q "Powered: yes"; then
|
||||
bluetoothctl power off
|
||||
else
|
||||
bluetoothctl power on
|
||||
fi
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
waybar-toggle = pkgs.writeShellScriptBin "waybar-toggle" ''
|
||||
if pidof waybar > /dev/null; then
|
||||
pkill waybar
|
||||
else
|
||||
hyprctl dispatch exec waybar
|
||||
fi
|
||||
'';
|
||||
|
||||
nightshift-toggle = pkgs.writeShellScriptBin "nightshift-toggle" ''
|
||||
if pidof "hyprsunset" > /dev/null; then
|
||||
pkill hyprsunset
|
||||
OSD_TEXT=" Night Shift Off"
|
||||
else
|
||||
${pkgs.hyprsunset}/bin/hyprsunset -t 4500 &
|
||||
OSD_TEXT=" Night Shift On"
|
||||
fi
|
||||
${updateOsd}
|
||||
'';
|
||||
|
||||
focus-toggle = pkgs.writeShellScriptBin "focus-toggle" ''
|
||||
if test -f /tmp/hypr-focus-mode; then
|
||||
rm /tmp/hypr-focus-mode
|
||||
OSD_TEXT=" Focus Off"
|
||||
${updateOsd}
|
||||
hyprctl reload
|
||||
hyprctl dispatch exec waybar
|
||||
else
|
||||
touch /tmp/hypr-focus-mode
|
||||
OSD_TEXT=" Focus On"
|
||||
${updateOsd}
|
||||
pkill waybar || true
|
||||
hyprctl keyword animations:enabled false
|
||||
hyprctl keyword general:gaps_in 0
|
||||
hyprctl keyword general:gaps_out 0
|
||||
hyprctl keyword decoration:active_opacity 1
|
||||
hyprctl keyword decoration:inactive_opacity 1
|
||||
hyprctl keyword decoration:rounding 0
|
||||
fi
|
||||
'';
|
||||
|
||||
# TODO: Run in background
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
{config, networkScript, ...}: let
|
||||
{
|
||||
config,
|
||||
networkScript,
|
||||
bluetoothScript,
|
||||
...
|
||||
}: let
|
||||
gaps-out = config.theme.gaps-out;
|
||||
c = config.lib.stylix.colors;
|
||||
in {
|
||||
@@ -8,48 +13,21 @@ in {
|
||||
position = "top";
|
||||
height = config.theme.bar-height;
|
||||
margin = "${toString gaps-out} ${toString gaps-out} 0";
|
||||
modules-center = ["custom/osd" "clock" "tray" "hyprland/workspaces" "custom/network" "bluetooth" "battery" "group/right-hidden"];
|
||||
|
||||
"group/right-hidden" = {
|
||||
orientation = "horizontal";
|
||||
drawer = {
|
||||
transition-duration = 500;
|
||||
transition-left-to-right = false;
|
||||
click-to-reveal = true;
|
||||
};
|
||||
modules = ["custom/arrow-right" "power-profiles-daemon" "mpris" "group/group-volume"];
|
||||
};
|
||||
|
||||
"group/group-volume" = {
|
||||
orientation = "horizontal";
|
||||
drawer = {
|
||||
transition-duration = 600;
|
||||
transition-left-to-right = true;
|
||||
reveal-delay = 450;
|
||||
};
|
||||
modules = ["pulseaudio" "pulseaudio/slider"];
|
||||
};
|
||||
modules-center = ["custom/osd" "custom/osd-sep" "clock" "tray" "hyprland/workspaces" "custom/network" "custom/bluetooth" "battery"];
|
||||
|
||||
# ── Modules ─────────────────────────────────────────────────────────
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{id}";
|
||||
all-outputs = true;
|
||||
move-to-monitor = true;
|
||||
ignore-workspaces = ["[5-9]" "[1-9][0-9]+"];
|
||||
on-scroll-down = "hyprctl dispatch workspace e+1";
|
||||
on-scroll-up = "hyprctl dispatch workspace e-1";
|
||||
persistent-workspaces."*" = 4;
|
||||
persistent-workspaces."*" = [1 2 3 4];
|
||||
cursor = true;
|
||||
};
|
||||
|
||||
mpris = {
|
||||
format = "";
|
||||
format-paused = "";
|
||||
tooltip-format = "{title}";
|
||||
tooltip-format-paused = "{title}";
|
||||
on-click = "playerctl play-pause";
|
||||
on-scroll-up = "playerctl previous";
|
||||
on-scroll-down = "playerctl next";
|
||||
};
|
||||
|
||||
battery = {
|
||||
bat = "BAT1";
|
||||
interval = 20;
|
||||
@@ -68,28 +46,13 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
"power-profiles-daemon" = {
|
||||
format = "{icon}";
|
||||
tooltip-format = "Power profile: {profile}";
|
||||
format-icons = {
|
||||
performance = "";
|
||||
balanced = "";
|
||||
power-saver = "";
|
||||
};
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
format = "{}";
|
||||
format-on = "";
|
||||
format-off = "";
|
||||
format-disabled = "";
|
||||
format-connected = "{device_alias}";
|
||||
format-connected-battery = "{device_alias}";
|
||||
tooltip-format = "Bluetooth {status}";
|
||||
tooltip-format-connected = "Bluetooth {status}\n{device_enumerate}";
|
||||
tooltip-format-enumerate-connected = " {device_alias}";
|
||||
tooltip-format-enumerate-connected-battery = " {device_alias} {device_battery_percentage}%";
|
||||
"custom/bluetooth" = {
|
||||
exec = "${bluetoothScript}";
|
||||
exec-if = "bluetoothctl show 2>/dev/null | grep -q Controller";
|
||||
return-type = "json";
|
||||
interval = 5;
|
||||
on-click-right = "blueman-manager &";
|
||||
on-click = "bluetooth-toggle";
|
||||
};
|
||||
|
||||
"custom/osd" = {
|
||||
@@ -100,6 +63,15 @@ in {
|
||||
format = "{}";
|
||||
};
|
||||
|
||||
"custom/osd-sep" = {
|
||||
exec = "echo '|'";
|
||||
exec-if = "test -f /tmp/waybar-osd";
|
||||
signal = 8;
|
||||
interval = "once";
|
||||
format = "{}";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "{icon}";
|
||||
format-bluetooth = "{icon}";
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
green = "#${c.base0B}";
|
||||
blue = "#${c.base0D}";
|
||||
cyan = "#${c.base0C}";
|
||||
mauve = "#${c.base0E}";
|
||||
inactive = "#${c.base03}";
|
||||
highlight = "#${c.base02}";
|
||||
font-size = "${toString config.stylix.fonts.sizes.applications}px";
|
||||
font-size-clock = "${toString (config.stylix.fonts.sizes.applications + 2)}px";
|
||||
module-padding = "14px";
|
||||
in {
|
||||
programs.waybar.style = ''
|
||||
* {
|
||||
@@ -40,36 +40,30 @@ in {
|
||||
}
|
||||
|
||||
#clock,
|
||||
#tray,
|
||||
#custom-network,
|
||||
#bluetooth,
|
||||
#battery,
|
||||
#mpris {
|
||||
padding: 1px 14px;
|
||||
#tray,
|
||||
#workspaces,
|
||||
#custom-osd,
|
||||
#custom-network,
|
||||
#custom-bluetooth {
|
||||
padding: 1px ${module-padding};
|
||||
}
|
||||
|
||||
#custom-osd-sep {
|
||||
padding: 0;
|
||||
color: ${inactive};
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-size: ${font-size-clock};
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding: 1px 8px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
padding: 1px 8px 1px 6px;
|
||||
}
|
||||
|
||||
#pulseaudio-slider {
|
||||
padding: 0 8px 0 2px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: ${fg};
|
||||
font-size: ${font-size};
|
||||
border-radius: 100px;
|
||||
padding: 0 5px;
|
||||
margin: 0 1px;
|
||||
padding: 0 3px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#workspaces button.empty {
|
||||
@@ -85,28 +79,8 @@ in {
|
||||
color: ${module-bg};
|
||||
background: ${blue};
|
||||
border-radius: 60px;
|
||||
padding: 0 12px;
|
||||
margin: 0 1px;
|
||||
}
|
||||
|
||||
#right-hidden {
|
||||
padding: 0 6px;
|
||||
}
|
||||
|
||||
#custom-arrow-right {
|
||||
padding: 0 5px;
|
||||
font-size: ${toString (config.stylix.fonts.sizes.applications + 2)}px;
|
||||
}
|
||||
|
||||
#power-profiles-daemon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#network.disabled,
|
||||
#bluetooth.disabled {
|
||||
padding: 0;
|
||||
padding: 0 8px;
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#battery {
|
||||
@@ -118,20 +92,8 @@ in {
|
||||
color: ${green};
|
||||
}
|
||||
|
||||
#network.ethernet,
|
||||
#network.wifi {
|
||||
color: ${cyan};
|
||||
}
|
||||
|
||||
#bluetooth.on,
|
||||
#bluetooth.connected,
|
||||
#bluetooth {
|
||||
color: ${blue};
|
||||
}
|
||||
|
||||
#battery.critical,
|
||||
#network.disconnected,
|
||||
#power-profiles-daemon.performance {
|
||||
#custom-network.disconnected {
|
||||
color: ${red};
|
||||
}
|
||||
|
||||
@@ -139,18 +101,24 @@ in {
|
||||
color: ${yellow};
|
||||
}
|
||||
|
||||
#power-profiles-daemon.power-saver {
|
||||
color: ${green};
|
||||
#custom-network.ethernet,
|
||||
#custom-network.wifi {
|
||||
color: ${cyan};
|
||||
}
|
||||
|
||||
#mpris {
|
||||
color: ${mauve};
|
||||
#custom-bluetooth {
|
||||
color: ${blue};
|
||||
}
|
||||
|
||||
#mpris.paused {
|
||||
#custom-bluetooth.off {
|
||||
color: ${inactive};
|
||||
}
|
||||
|
||||
#custom-osd {
|
||||
font-weight: 700;
|
||||
color: ${fg};
|
||||
}
|
||||
|
||||
tooltip {
|
||||
border-radius: 15px;
|
||||
background: ${tooltip-bg};
|
||||
@@ -183,29 +151,5 @@ in {
|
||||
border-radius: 10px;
|
||||
background-color: ${highlight};
|
||||
}
|
||||
|
||||
slider {
|
||||
opacity: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
trough {
|
||||
min-width: 50px;
|
||||
min-height: 5px;
|
||||
border-radius: 8px;
|
||||
background: ${inactive};
|
||||
}
|
||||
|
||||
trough highlight {
|
||||
border-radius: 8px;
|
||||
background-color: ${fg};
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#custom-osd {
|
||||
padding: 1px 14px;
|
||||
font-weight: 700;
|
||||
color: ${fg};
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user