Modify waybar

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

View File

@ -119,7 +119,6 @@ with pkgs;
fdupes # find and delete duplicate files
digikam
dbeaver-bin
pavucontrol
sqlite
nomacs

View File

@ -31,7 +31,7 @@ in
enable = mkBoolOpt false "Enable or disable the hyprland window manager.";
};
# imports = [ (ib.mkIf inputs.hyprland.homeManagerModules.default) ];
imports = [ inputs.hyprland.homeManagerModules.default ];
config = lib.mkIf cfg.enable {
modules.desktop.addons = {
@ -98,51 +98,6 @@ in
# };
# };
# programs.waybar = {
# enable = true;
# systemd.enable = true;
# style = builtins.readFile ./style.css;
# settings.mainBar = builtins.fromJSON (builtins.readFile ./waybar-config.json);
# # settings = {
# # mainBar = {
# # layer = "top";
# # position = "bottom";
# # height = 30;
# # output = [
# # "eDP-1"
# # "HDMI-A-1"
# # ];
# # modules-left = [
# # "hyprland/workspaces"
# # "hyprland/submap"
# # ];
# # modules-center = [ "hyprland/window" ];
# # modules-right = [
# # # "mpd"
# # # "idle_inhibitor"
# # "pulseaudio"
# # # "network"
# # "power-profiles-daemon"
# # "cpu"
# # "memory"
# # # "temperature"
# # # "backlight"
# # # "keyboard-state"
# # "battery"
# # # "battery#bat2"
# # "clock"
# # "tray"
# # ];
# # # "sway/workspaces" = {
# # # disable-scroll = true;
# # # all-outputs = true;
# # # };
# # };
# # };
# };
# programs.wlogout.enable = true; # can be configured
# services.hypridle.enable = true; # can be configured
services.network-manager-applet.enable = true;

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
'';
};
};
}

View File

@ -21,6 +21,9 @@ pkgs.writeShellApplication {
pulseaudio
];
# Do not insert e.g. pipefail
bashOptions = [ ];
text = ''
HDMI_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink"
LAPTOP_SINK="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink"

View File

@ -278,6 +278,7 @@
mc
xorg.xhost
kdePackages.qtwayland
pavucontrol
frajul.pulseaudio-popup
gparted-xhost # needs to be installed as system package so it can be actually opened
];