Modify waybar

This commit is contained in:
2024-06-15 13:54:37 +02:00
parent baf240c27d
commit 83385a638f
7 changed files with 112 additions and 142 deletions

View File

@ -0,0 +1,97 @@
{
"layer": "top",
"position": "bottom",
"mode": "dock",
"exclusive": true,
"passtrough": false,
"height": 32,
"modules-left": [
"hyprland/workspaces"
],
"modules-center": [],
"modules-right": ["idle_inhibitor", "disk", "cpu", "memory", "pulseaudio", "battery", "clock", "tray"],
"hyprland/window": {
"format": "{}"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"disk": {
"interval": 30,
"format": "Free: {percentage_free}% ({free})",
"path": "/",
"unit": "GB"
},
"hyprland/workspaces": {
"on-scroll-up": "hyprctl dispatch workspace m+1",
"on-scroll-down": "hyprctl dispatch workspace m-1",
"all-outputs": false,
"on-click": "activate",
"format": "{icon}",
"format-icons": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
"10": "10"
}
},
"cpu": {
"format": " {usage}%"
},
"memory": {
"format": " {}%"
},
"tray": {
"icon-size": 16,
"tooltip": false,
"spacing": 10
},
"clock": {
"tooltip-format": "{calendar}",
"format": "{:%a %d.%m %H:%M:%S}",
"interval": 1
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-muted": "<big>󰝟</big>",
"format-icons": {
"headphone": "",
"default": ["", "", ""]
},
"scroll-step": 5.0,
"max-volume": 200,
"on-click": "pulseaudio-popup",
"on-click-right": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
},
"battery": {
"states": {
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}% ({time})",
"format-charging": " {capacity}% ({time})",
"format-plugged": " {capacity}% ({time})",
"format-full": "{icon} ",
"format-icons": ["", "", "", "", ""]
}
}

View File

@ -1,80 +0,0 @@
{
"layer": "top",
"position": "top",
"mod": "dock",
"exclusive": true,
"passtrough": false,
"gtk-layer-shell": true,
"height": 32,
"modules-left": [
"hyprland/workspaces"
],
"modules-center": [],
"modules-right": [
"tray",
"network",
"battery",
"clock"
],
"hyprland/window": {
"format": "{}"
},
"hyprland/workspaces": {
"on-scroll-up": "hyprctl dispatch workspace e+1",
"on-scroll-down": "hyprctl dispatch workspace e-1",
"all-outputs": true,
"on-click": "activate",
"format": "{icon}",
"format-icons": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
"10": "10"
}
},
"tray": {
"icon-size": 12,
"tooltip": false,
"spacing": 10
},
"clock": {
"format": "{:%H:%M}",
},
"pulseaudio": {
"format": " {volume}%",
"tooltip": false,
"format-muted": " N/A",
"on-click": "pavucontrol &",
"scroll-step": 5
},
"network": {
"format-wifi": " {essid} {signalStrength}%",
"format-ethernet": "󰈀",
"format-disconnected": "󰈂"
},
"battery": {
"states": {
"warning": 20,
"critical": 15
},
"format": "󰁹 {capacity}%",
"format-charging": "󰂄 {capacity}%",
"format-plugged": "󰂄 {capacity}%"
}
}

View File

@ -23,20 +23,12 @@ in
programs.waybar = {
enable = true;
systemd.enable = true;
};
xdg.configFile."waybar/config.jsonc" = {
source = ./config.jsonc;
onChange = ''
${pkgs.busybox}/bin/pkill -SIGUSR2 waybar
'';
};
xdg.configFile."waybar/style.css" = {
text = ''
settings.mainBar = builtins.fromJSON (builtins.readFile ./config.json);
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: JetBrainsMono Nerd Font;
font-size: 13px;
font-size: 14px;
border-radius: 17px;
}
@ -53,6 +45,8 @@ in
#custom-spotify,
#pulseaudio,
#window,
#idle_inhibitor,
#cpu,
#tray {
padding: 5 15px;
border-radius: 12px;
@ -188,7 +182,11 @@ in
#tray menu {
background-color: #${palette.base00};
opacity: 0.8;
opacity: 1.0;
}
#battery.warning {
color: #${palette.base08};
}
#pulseaudio.muted {
@ -220,9 +218,6 @@ in
border-radius: 17px;
}
'';
onChange = ''
${pkgs.busybox}/bin/pkill -SIGUSR2 waybar
'';
};
};
}