forked from extern/nix-config
meta: Replace waybar with ironbar
Ironbar is a new GTK-based bar written in Rust. It offers substantial improvements over waybar, including a proper application launcher.
This commit is contained in:
parent
5ec4aab697
commit
f9cb5c5c56
@ -22,7 +22,6 @@
|
||||
./swaylock.nix
|
||||
./thunar.nix
|
||||
(lib.mkIf (config.programs.hyprland.enable == true) ./udiskie.nix)
|
||||
./waybar.nix
|
||||
./xcursor.nix
|
||||
./xdg-user-dirs.nix
|
||||
./xresources.nix
|
||||
|
@ -28,7 +28,7 @@ in
|
||||
|
||||
exec-once = swww init
|
||||
exec-once = wpctl set-volume @DEFAULT_AUDIO_SINK@ 20%
|
||||
exec-once = sleep 0.5 && waybar
|
||||
exec-once = sleep 0.5 && ironbar
|
||||
exec-once = fcitx5
|
||||
exec-once = mullvad-vpn
|
||||
exec-once = wl-paste -p --watch wl-copy -pc
|
||||
@ -127,7 +127,7 @@ in
|
||||
bind = $SUPER, V, centerwindow,
|
||||
bind = $SUPER, I, exec, hyprctl keyword decoration:dim_inactive $((1 - $(hyprctl getoption decoration:dim_inactive -j | jq -r ".int")))
|
||||
bind = $SUPER, U, exec, ~/.config/hypr/gaps.sh
|
||||
bind = $SUPER, O, exec, killall .waybar-wrapped || waybar
|
||||
bind = $SUPER, O, exec, killall .ironbar-wrapper || ironbar
|
||||
bind = $SUPER, X, pin
|
||||
bind = $SUPER, F, fullscreen
|
||||
bind = $SUPER, S, togglespecialworkspace
|
||||
@ -172,7 +172,7 @@ in
|
||||
bind = $SUPER_SHIFT, 9, movetoworkspace, 9
|
||||
bind = $SUPER_SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
layerrule = blur,waybar
|
||||
layerrule = blur,ironbar
|
||||
layerrule = blur,rofi
|
||||
layerrule = blur,notifications
|
||||
|
||||
|
190
home/waybar.nix
190
home/waybar.nix
@ -1,190 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
opacity = lib.strings.floatToString config.stylix.opacity.terminal;
|
||||
icons = false;
|
||||
position = "right";
|
||||
opposite = builtins.replaceStrings [ "left" "right" "top" "bottom" ] [ "right" "left" "bottom" "top" ] position;
|
||||
isVertical = position == "left" || position == "right";
|
||||
modules = {
|
||||
tray = {
|
||||
icon-size = if isVertical then 24 else 13;
|
||||
spacing = 8;
|
||||
};
|
||||
|
||||
"wlr/taskbar" = {
|
||||
icon-size = if isVertical then 32 else 16;
|
||||
on-click = "activate";
|
||||
on-click-middle = "activate";
|
||||
on-click-right = "activate";
|
||||
};
|
||||
|
||||
"hyprland/window" = {
|
||||
rotate = if isVertical then 90 else 0;
|
||||
};
|
||||
|
||||
"wlr/workspaces" = {
|
||||
on-click = "activate";
|
||||
sort-by-number = true;
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "一";
|
||||
"2" = "二";
|
||||
"3" = "三";
|
||||
"4" = "四";
|
||||
"5" = "五";
|
||||
"6" = "六";
|
||||
"7" = "七";
|
||||
"8" = "八";
|
||||
"9" = "九";
|
||||
"10" = "十";
|
||||
};
|
||||
};
|
||||
|
||||
wireplumber = {
|
||||
format = "{icon}";
|
||||
tooltip-format = "{volume}% {node_name}";
|
||||
format-muted = "";
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
|
||||
battery = {
|
||||
format = "{icon}";
|
||||
tooltip-format = "{capacity}% {timeTo}";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
|
||||
clock = {
|
||||
format = if isVertical then "{:%H\n%M}" else "{:%H:%M}";
|
||||
tooltip-format = "<tt>{calendar}</tt>";
|
||||
calendar = {
|
||||
mode = "month";
|
||||
weeks-pos = "right";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span size='14pt' color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span size='18pt' color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b>{}</b></span>";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
backlight = {
|
||||
format = "{icon}";
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
|
||||
"custom/new-workspace" = {
|
||||
format = "+";
|
||||
on-click = "hyprctl dispatch workspace empty && sleep 0.1 && rofi -show drun";
|
||||
on-click-right = "sleep 0.1 && rofi -show drun";
|
||||
on-click-middle = "hyprctl dispatch workspace empty";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"custom/wallpaper" = {
|
||||
format = if isVertical then "壁\n紙" else "壁紙";
|
||||
on-click = "bash -c ~/wallhaven/timer.sh";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
"custom/gaps" = {
|
||||
format = if isVertical then "空\nき" else "空き";
|
||||
on-click = "bash -c ~/.config/hypr/gaps.sh";
|
||||
tooltip = false;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
mainBar = modules // {
|
||||
layer = "top";
|
||||
position = position;
|
||||
width = if isVertical then 45 else null;
|
||||
height = if isVertical then null else 30;
|
||||
spacing = 8;
|
||||
|
||||
modules-left = if icons then [ "wlr/taskbar" ] else [ "wlr/workspaces" ];
|
||||
modules-center = [ "custom/wallpaper" "custom/gaps" ];
|
||||
modules-right = [ "wireplumber" "backlight" "battery" "clock" ];
|
||||
};
|
||||
};
|
||||
|
||||
style = with config.lib.stylix.colors; lib.mkForce /* css */ ''
|
||||
* {
|
||||
color: #${base05};
|
||||
font-size: ${if isVertical then "16px" else "13px"};
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: alpha(#${base00}, ${opacity});
|
||||
border-${opposite}: 1px solid alpha(#${base02}, 0.67);
|
||||
}
|
||||
|
||||
window#waybar.fullscreen #workspaces button.active {
|
||||
background: alpha(#${base09}, 0.5);
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: ${if isVertical then "12px 0" else "0 12px"};
|
||||
border-radius: 0;
|
||||
border-bottom: 1px solid alpha(#${base02}, 0.5);
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
background: alpha(#${base02}, 0.5);
|
||||
}
|
||||
|
||||
#window {
|
||||
padding-${if isVertical then "top" else "left"}: 8px;
|
||||
padding-${if isVertical then "bottom" else "right"}: 12px;
|
||||
}
|
||||
|
||||
tooltip, #tray menu {
|
||||
background: #${base00};
|
||||
border: 1px solid alpha(#${base09}, 0.93);
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#backlight, #battery, #wireplumber {
|
||||
font-family: "Font Awesome 6 Free Solid";
|
||||
font-size: ${if isVertical then "24px" else "13px"};
|
||||
}
|
||||
|
||||
#custom-new-workspace {
|
||||
font-family: "Font Awesome 6 Free Solid";
|
||||
padding-${if isVertical then "top" else "left"}: 8px;
|
||||
padding-${if isVertical then "bottom" else "right"}: 8px;
|
||||
color: alpha(#${base0A}, 0.67);
|
||||
}
|
||||
|
||||
#custom-wallpaper {
|
||||
border-top: 1px solid alpha(#${base02}, 0.5);
|
||||
}
|
||||
|
||||
#custom-wallpaper, #custom-gaps {
|
||||
font-weight: bold;
|
||||
padding: ${if isVertical then "12px 0" else "0 12px"};
|
||||
border-bottom: 1px solid alpha(#${base02}, 0.5);
|
||||
}
|
||||
|
||||
#custom-wallpaper label:hover {
|
||||
background: alpha(#${base02}, 0.5);
|
||||
}
|
||||
|
||||
#clock {
|
||||
font-size: ${if isVertical then "18px" else "13px"};
|
||||
font-weight: bold;
|
||||
padding-${if isVertical then "bottom" else "right"}: 8px;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
@ -86,6 +86,7 @@
|
||||
go-thumbnailer
|
||||
pipe-rename
|
||||
cmus
|
||||
ironbar
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
|
@ -4,6 +4,5 @@
|
||||
./joshuto.nix
|
||||
./kitty.nix
|
||||
./rofi.nix
|
||||
./waybar.nix
|
||||
];
|
||||
}
|
||||
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
waybar = prev.waybar.overrideAttrs (old: rec {
|
||||
version = "635e06209dcf14612549864f461847f94b86406b";
|
||||
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "varbhat";
|
||||
repo = "Waybar";
|
||||
rev = version;
|
||||
sha256 = "sha256-9D+OTPVvjnjCl3OW/YUoFmDi8IJLs/8QTi5JUorLmL8=";
|
||||
};
|
||||
|
||||
postPatch = /* bash */ ''
|
||||
sed -i 's/zext_workspace_handle_v1_activate(workspace_handle_);/const std::string command = "hyprctl dispatch workspace " + name_;\n\tsystem(command.c_str());/g' src/modules/wlr/workspace_manager.cpp
|
||||
'';
|
||||
|
||||
mesonFlags = old.mesonFlags ++ [ "-Dexperimental=true" ];
|
||||
});
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue
Block a user