mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-07-06 16:12:33 +02:00
there is now osd in waybar
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -126,7 +126,7 @@ in {
|
|||||||
# Quick launch
|
# Quick launch
|
||||||
"$mod,RETURN, exec, uwsm app -- ${pkgs.ghostty}/bin/ghostty" # Ghostty (terminal)
|
"$mod,RETURN, exec, uwsm app -- ${pkgs.ghostty}/bin/ghostty" # Ghostty (terminal)
|
||||||
"$mod,E, exec, uwsm app -- ${pkgs-stable.thunar}/bin/thunar" # Thunar
|
"$mod,E, exec, uwsm app -- ${pkgs-stable.thunar}/bin/thunar" # Thunar
|
||||||
"$mod, SPACE, exec, rofi -show drun" # Launcher
|
"$mod, SPACE, exec, tofi-drun" # Launcher
|
||||||
"$mod, N, exec, swaync-client -t" # Notification center
|
"$mod, N, exec, swaync-client -t" # Notification center
|
||||||
|
|
||||||
# Windows
|
# Windows
|
||||||
@@ -168,8 +168,8 @@ in {
|
|||||||
|
|
||||||
bindl = [
|
bindl = [
|
||||||
# Brightness
|
# Brightness
|
||||||
", XF86MonBrightnessUp, exec, swayosd-client --brightness raise"
|
", XF86MonBrightnessUp, exec, bright-up"
|
||||||
", XF86MonBrightnessDown, exec, swayosd-client --brightness lower"
|
", XF86MonBrightnessDown, exec, bright-down"
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
", XF86AudioPlay, exec, playerctl play-pause"
|
", XF86AudioPlay, exec, playerctl play-pause"
|
||||||
@@ -179,10 +179,10 @@ in {
|
|||||||
", XF86AudioStop, exec, playerctl stop"
|
", XF86AudioStop, exec, playerctl stop"
|
||||||
|
|
||||||
# Sound
|
# Sound
|
||||||
", XF86AudioMute, exec, swayosd-client --output-volume mute-toggle"
|
", XF86AudioMute, exec, vol-mute"
|
||||||
", XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise"
|
", XF86AudioRaiseVolume, exec, vol-up"
|
||||||
", XF86AudioLowerVolume, exec, swayosd-client --output-volume lower"
|
", XF86AudioLowerVolume, exec, vol-down"
|
||||||
", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
|
", XF86AudioMicMute, exec, mic-mute"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
{ config, pkgs, ... }: let
|
|
||||||
c = config.lib.stylix.colors;
|
|
||||||
font = config.stylix.fonts.sansSerif.name;
|
|
||||||
fontSize = toString config.stylix.fonts.sizes.applications;
|
|
||||||
gaps = toString config.theme.gaps-out;
|
|
||||||
theme = pkgs.writeText "launcher.rasi" ''
|
|
||||||
configuration {
|
|
||||||
modi: "drun,run";
|
|
||||||
case-sensitive: false;
|
|
||||||
cycle: true;
|
|
||||||
normalize-match: true;
|
|
||||||
show-icons: false;
|
|
||||||
matching: "normal";
|
|
||||||
tokenize: true;
|
|
||||||
kb-cancel: "Escape,MousePrimary";
|
|
||||||
drun-match-fields: "name,exec,generic,comment";
|
|
||||||
drun-display-format: "{name}";
|
|
||||||
drun-url-launcher: "xdg-open";
|
|
||||||
drun-show-actions: false;
|
|
||||||
disable-history: false;
|
|
||||||
sorting-method: "normal";
|
|
||||||
terminal: "ghostty";
|
|
||||||
hover-select: true;
|
|
||||||
me-select-entry: "";
|
|
||||||
me-accept-entry: [ "MousePrimary" ];
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
background: transparent;
|
|
||||||
background-alt: #${c.base01}ff;
|
|
||||||
foreground: #${c.base05}ff;
|
|
||||||
active: #${c.base0D}ff;
|
|
||||||
inactive: #${c.base03}ff;
|
|
||||||
selected-fg: #${c.base00}ff;
|
|
||||||
font: "${font}, Bold ${fontSize}";
|
|
||||||
}
|
|
||||||
|
|
||||||
window {
|
|
||||||
transparency: "real";
|
|
||||||
location: north;
|
|
||||||
anchor: north;
|
|
||||||
padding: ${gaps}px ${gaps}px 0;
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
mainbox {
|
|
||||||
orientation: horizontal;
|
|
||||||
spacing: 0;
|
|
||||||
padding: 6px 14px;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: @background-alt;
|
|
||||||
children: [ "inputbar", "listview" ];
|
|
||||||
}
|
|
||||||
|
|
||||||
inputbar {
|
|
||||||
expand: false;
|
|
||||||
spacing: 8px;
|
|
||||||
padding: 0;
|
|
||||||
background-color: transparent;
|
|
||||||
color: @foreground;
|
|
||||||
children: [ "prompt", "entry" ];
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt {
|
|
||||||
background-color: transparent;
|
|
||||||
color: @active;
|
|
||||||
padding: 0 2px 0 0;
|
|
||||||
vertical-align: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
entry {
|
|
||||||
background-color: transparent;
|
|
||||||
color: inherit;
|
|
||||||
placeholder-color: @inactive;
|
|
||||||
placeholder: "Search...";
|
|
||||||
vertical-align: 0.5;
|
|
||||||
width: 180px;
|
|
||||||
}
|
|
||||||
|
|
||||||
listview {
|
|
||||||
layout: horizontal;
|
|
||||||
lines: 1;
|
|
||||||
dynamic: true;
|
|
||||||
scrollbar: false;
|
|
||||||
spacing: 0;
|
|
||||||
padding: 0 0 0 14px;
|
|
||||||
background-color: transparent;
|
|
||||||
color: @foreground;
|
|
||||||
}
|
|
||||||
|
|
||||||
element {
|
|
||||||
enabled: true;
|
|
||||||
spacing: 0;
|
|
||||||
padding: 2px 10px;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: transparent;
|
|
||||||
color: @foreground;
|
|
||||||
cursor: pointer;
|
|
||||||
children: [ "element-text" ];
|
|
||||||
}
|
|
||||||
|
|
||||||
element selected.normal {
|
|
||||||
background-color: @active;
|
|
||||||
color: @selected-fg;
|
|
||||||
}
|
|
||||||
|
|
||||||
element-text {
|
|
||||||
background-color: transparent;
|
|
||||||
color: inherit;
|
|
||||||
vertical-align: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message {
|
|
||||||
padding: 0;
|
|
||||||
background-color: transparent;
|
|
||||||
color: @foreground;
|
|
||||||
}
|
|
||||||
|
|
||||||
error-message {
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 100px;
|
|
||||||
background-color: @background-alt;
|
|
||||||
color: @foreground;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
stylix.targets.rofi.enable = false;
|
|
||||||
|
|
||||||
programs.rofi = {
|
|
||||||
enable = true;
|
|
||||||
theme = "${theme}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -21,6 +21,9 @@ in {
|
|||||||
positionY = "top";
|
positionY = "top";
|
||||||
cssPriority = "user";
|
cssPriority = "user";
|
||||||
"control-center-width" = 450;
|
"control-center-width" = 450;
|
||||||
|
"control-center-margin-top" = 0;
|
||||||
|
"control-center-margin-bottom" = 0;
|
||||||
|
"control-center-margin-right" = 0;
|
||||||
"fit-to-screen" = true;
|
"fit-to-screen" = true;
|
||||||
"notification-window-width" = 400;
|
"notification-window-width" = 400;
|
||||||
"notification-icon-size" = 40;
|
"notification-icon-size" = 40;
|
||||||
@@ -189,9 +192,9 @@ in {
|
|||||||
|
|
||||||
.control-center {
|
.control-center {
|
||||||
background: @center-bg;
|
background: @center-bg;
|
||||||
border-radius: var(--border-radius);
|
border-radius: 0 0 0 var(--border-radius);
|
||||||
border: ${toString border-size}px solid @selected;
|
border-left: ${toString border-size}px solid @selected;
|
||||||
margin: 5px;
|
margin: 0;
|
||||||
padding: 5px 5px 0 5px;
|
padding: 5px 5px 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@
|
|||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
services.swayosd = {
|
services.swayosd = {
|
||||||
enable = true;
|
enable = false;
|
||||||
stylePath = style;
|
stylePath = style;
|
||||||
topMargin = 0.5;
|
topMargin = 0.06;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
c = config.lib.stylix.colors;
|
||||||
|
font = config.stylix.fonts.serif.name;
|
||||||
|
gaps = config.theme.gaps-out;
|
||||||
|
barHeight = config.theme.bar-height;
|
||||||
|
rounding =
|
||||||
|
if config.theme.rounding > barHeight / 2
|
||||||
|
then barHeight / 2
|
||||||
|
else config.theme.rounding;
|
||||||
|
in {
|
||||||
|
programs.tofi = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
anchor = "top";
|
||||||
|
height = barHeight;
|
||||||
|
margin-top = gaps;
|
||||||
|
margin-left = 350;
|
||||||
|
margin-right = 350;
|
||||||
|
|
||||||
|
horizontal = true;
|
||||||
|
num-results = 8;
|
||||||
|
result-spacing = 20;
|
||||||
|
padding-top = 2;
|
||||||
|
padding-bottom = 2;
|
||||||
|
padding-left = 14;
|
||||||
|
padding-right = 14;
|
||||||
|
|
||||||
|
font = lib.mkForce font;
|
||||||
|
prompt-color = lib.mkForce "#${c.base0D}ff";
|
||||||
|
|
||||||
|
outline-width = 0;
|
||||||
|
border-width = 0;
|
||||||
|
corner-radius = rounding;
|
||||||
|
|
||||||
|
prompt-text = " ";
|
||||||
|
placeholder-text = "Search...";
|
||||||
|
|
||||||
|
drun-launch = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,6 +15,79 @@
|
|||||||
done
|
done
|
||||||
printf '{"text": "", "class": "disconnected", "tooltip": "Disconnected"}\n'
|
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}
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./settings.nix
|
./settings.nix
|
||||||
@@ -31,7 +104,7 @@ in {
|
|||||||
pavucontrol
|
pavucontrol
|
||||||
blueman
|
blueman
|
||||||
iw
|
iw
|
||||||
];
|
] ++ [vol-up vol-down vol-mute mic-mute bright-up bright-down];
|
||||||
|
|
||||||
wayland.windowManager.hyprland.settings.exec-once = [
|
wayland.windowManager.hyprland.settings.exec-once = [
|
||||||
"waybar"
|
"waybar"
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ in {
|
|||||||
{
|
{
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 25;
|
height = config.theme.bar-height;
|
||||||
margin = "${toString gaps-out} ${toString gaps-out} 0";
|
margin = "${toString gaps-out} ${toString gaps-out} 0";
|
||||||
modules-center = ["clock" "tray" "hyprland/workspaces" "custom/network" "bluetooth" "battery" "group/right-hidden"];
|
modules-center = ["custom/osd" "clock" "tray" "hyprland/workspaces" "custom/network" "bluetooth" "battery" "group/right-hidden"];
|
||||||
|
|
||||||
"group/right-hidden" = {
|
"group/right-hidden" = {
|
||||||
orientation = "horizontal";
|
orientation = "horizontal";
|
||||||
@@ -92,13 +92,21 @@ in {
|
|||||||
on-click-right = "blueman-manager &";
|
on-click-right = "blueman-manager &";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"custom/osd" = {
|
||||||
|
exec = "cat /tmp/waybar-osd";
|
||||||
|
exec-if = "test -f /tmp/waybar-osd";
|
||||||
|
signal = 8;
|
||||||
|
interval = "once";
|
||||||
|
format = "{}";
|
||||||
|
};
|
||||||
|
|
||||||
pulseaudio = {
|
pulseaudio = {
|
||||||
format = "{icon}";
|
format = "{icon}";
|
||||||
format-bluetooth = "{icon}";
|
format-bluetooth = "{icon}";
|
||||||
tooltip-format = "{volume}%";
|
tooltip-format = "{volume}%";
|
||||||
format-muted = "<span size='12pt'></span>";
|
format-muted = "<span size='12pt'></span>";
|
||||||
scroll-step = 2;
|
scroll-step = 2;
|
||||||
on-click = "swayosd-client --output-volume mute-toggle";
|
on-click = "vol-mute";
|
||||||
on-click-right = "pavucontrol -t 4 &";
|
on-click-right = "pavucontrol -t 4 &";
|
||||||
format-icons = {
|
format-icons = {
|
||||||
headphone = "";
|
headphone = "";
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ in {
|
|||||||
background: ${module-bg};
|
background: ${module-bg};
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
padding: 6px 14px;
|
padding: 6px 14px;
|
||||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock,
|
#clock,
|
||||||
@@ -201,5 +201,11 @@ in {
|
|||||||
background-color: ${fg};
|
background-color: ${fg};
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-osd {
|
||||||
|
padding: 1px 14px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: ${fg};
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
../../home/system/waybar
|
../../home/system/waybar
|
||||||
../../home/system/swaync
|
../../home/system/swaync
|
||||||
../../home/system/swayosd
|
../../home/system/swayosd
|
||||||
../../home/system/rofi
|
../../home/system/tofi
|
||||||
../../home/system/mime
|
../../home/system/mime
|
||||||
../../home/system/udiskie
|
../../home/system/udiskie
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
default = {
|
default = {
|
||||||
rounding = 20;
|
rounding = 20;
|
||||||
|
bar-height = 36;
|
||||||
bar-rounding = 20 + 10;
|
bar-rounding = 20 + 10;
|
||||||
bar-thickness = 0;
|
bar-thickness = 0;
|
||||||
gaps-in = 8;
|
gaps-in = 8;
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
- [ ] Configuration sway-nc
|
- [ ] Configuration sway-nc
|
||||||
- [ ] Configuration sway-osd
|
- [ ] Configuration sway-osd
|
||||||
- [ ] Configuration hyprlock
|
- [ ] Configuration hyprlock
|
||||||
- [ ] Gaming/Focus mode
|
- [x] Gaming/Focus mode
|
||||||
- [ ] Configuration Rofi/Drun
|
- [ ] Configuration Rofi/Drun
|
||||||
- [ ] Helium plus rapide ? service/deamon ?
|
- [ ] Helium plus rapide ? service/deamon ?
|
||||||
- [ ] Ghostty service/deamon ?
|
- [ ] Ghostty service/deamon ?
|
||||||
|
- [ ] Tofi service/deamon ?
|
||||||
- [ ] Clean files
|
- [ ] Clean files
|
||||||
- [ ] Check claude: Sécu, mots en français, faute, ...
|
- [ ] Check claude: Sécu, mots en français, faute, ...
|
||||||
|
|||||||
Reference in New Issue
Block a user