Signed-off-by: Hadi <hadi@example.com>
This commit is contained in:
Hadi
2026-07-29 13:14:27 +02:00
parent 835114e5c9
commit 0d901aa10c
70 changed files with 206 additions and 374 deletions
+10
View File
@@ -403,4 +403,14 @@ in {
};
stylix.targets.swaync.enable = false;
# GTK 4.22 defaults to the Vulkan renderer, which compiles its graphics
# pipelines lazily on the first frame. The control center has many distinct
# visual elements, so the first open triggers a big burst of pipeline
# compilation (a multi-second stall on a cold boot) while later opens reuse
# the in-process cache. The GL (ngl) renderer avoids this: it stays
# GPU-accelerated and benefits from Mesa's on-disk shader cache, so the
# first open is as fast as the rest. Scoped to swaync so other GTK4 apps
# keep the Vulkan renderer.
systemd.user.services.swaync.Service.Environment = ["GSK_RENDERER=ngl"];
}
+9 -11
View File
@@ -32,8 +32,8 @@
fi
'';
# Résout $src : source par défaut, sinon première source disponible.
# Certaines machines n'ont pas de source audio par défaut (@DEFAULT_AUDIO_SOURCE@ non résolu).
# Resolve $src: the default source, otherwise the first available source.
# Some machines have no default audio source (@DEFAULT_AUDIO_SOURCE@ unresolved).
micSource = ''
src=$(${pkgs.wireplumber}/bin/wpctl inspect @DEFAULT_AUDIO_SOURCE@ 2>/dev/null | sed -n 's/^id \([0-9]*\),.*/\1/p')
if [ -z "$src" ]; then
@@ -42,8 +42,8 @@
fi
'';
# tofi en mode dmenu vertical : la config globale est un lanceur horizontal de
# 36px de haut, inutilisable pour une liste. On surcharge la géométrie.
# tofi in vertical dmenu mode: the global config is a 36px-tall horizontal
# launcher, unusable for a list, so override the geometry here.
tofiMenu = "${pkgs.tofi}/bin/tofi --horizontal false --anchor center --width 700 --height 500 --margin-top 0 --margin-left 0 --margin-right 0 --num-results 10";
in {
bluetoothScript = pkgs.writeShellScript "waybar-bluetooth" ''
@@ -264,7 +264,7 @@ in {
jq=${pkgs.jq}/bin/jq
pwdump=${pkgs.pipewire}/bin/pw-dump
# IDs des sinks dans l'ordre de pw-dump.
# Sink IDs in pw-dump order.
ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Sink") | .id'))
n=''${#ids[@]}
[ "$n" -eq 0 ] && exit 0
@@ -291,7 +291,7 @@ in {
jq=${pkgs.jq}/bin/jq
pwdump=${pkgs.pipewire}/bin/pw-dump
# IDs des sources dans l'ordre de pw-dump.
# Source IDs in pw-dump order.
ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Source") | .id'))
n=''${#ids[@]}
[ "$n" -eq 0 ] && exit 0
@@ -314,7 +314,7 @@ in {
'';
color-pick = pkgs.writeShellScriptBin "color-pick" ''
# hyprpicker -a copie déjà la couleur dans le presse-papier.
# hyprpicker -a already copies the color to the clipboard.
color=$(${pkgs.hyprpicker}/bin/hyprpicker -a 2>/dev/null)
if [ -n "$color" ]; then
OSD_TEXT="󰈊 $color"
@@ -359,7 +359,7 @@ in {
'';
airplane-toggle = pkgs.writeShellScriptBin "airplane-toggle" ''
# Réutilise nmcli + bluetoothctl (sans privilège) plutôt que rfkill.
# Reuse nmcli + bluetoothctl (unprivileged) instead of rfkill.
on=false
nmcli radio wifi 2>/dev/null | grep -q enabled && on=true
bluetoothctl show 2>/dev/null | grep -q "Powered: yes" && on=true
@@ -390,7 +390,7 @@ in {
'';
caffeine-toggle = pkgs.writeShellScriptBin "caffeine-toggle" ''
# Met hypridle en pause (reste éveillé) ou le réactive.
# Pause hypridle (stay awake) or resume it.
if systemctl --user is-active --quiet hypridle; then
systemctl --user stop hypridle
OSD_TEXT="󰅶 Keep Awake On"
@@ -400,6 +400,4 @@ in {
fi
${updateOsd}
'';
# TODO: Run in background
}
+5 -1
View File
@@ -1,5 +1,6 @@
{
config,
lib,
pkgs,
networkScript,
bluetoothScript,
@@ -7,6 +8,7 @@
}: let
gaps-out = config.theme.gaps-out;
c = config.lib.stylix.colors;
hasBattery = config.var.hasBattery or false;
in {
programs.waybar.settings = [
{
@@ -14,7 +16,9 @@ in {
position = "top";
height = config.theme.bar-height;
margin = "${toString gaps-out} ${toString gaps-out} 0";
modules-center = ["custom/osd" "custom/osd-sep" "clock" "tray" "hyprland/workspaces" "custom/network" "custom/bluetooth" "battery"];
modules-center =
["custom/osd" "custom/osd-sep" "clock" "tray" "hyprland/workspaces" "custom/network" "custom/bluetooth"]
++ lib.optional hasBattery "battery";
# ── Modules ─────────────────────────────────────────────────────────