feat: various wayland tweaks
This commit is contained in:
parent
9db1f2758b
commit
19cf4d851f
6 changed files with 118 additions and 2 deletions
|
@ -62,7 +62,10 @@
|
|||
|
||||
({config, ...}: {
|
||||
config = {
|
||||
nixpkgs.overlays = [overlays];
|
||||
nixpkgs.overlays = [
|
||||
overlays
|
||||
hyprland.outputs.overlays.default
|
||||
];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
proselint
|
||||
rustc
|
||||
rustfmt
|
||||
shellcheck
|
||||
shfmt
|
||||
tree-sitter
|
||||
alejandra
|
||||
|
|
51
home/apps/waybar/config
Normal file
51
home/apps/waybar/config
Normal file
|
@ -0,0 +1,51 @@
|
|||
// vim:ft=jsonc
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"height": 32,
|
||||
"spacing": 4,
|
||||
"modules-left": ["wlr/workspaces"],
|
||||
"modules-center": [
|
||||
"hyprland/window"
|
||||
],
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"idle_inhibitor",
|
||||
"pulseaudio",
|
||||
"clock"
|
||||
],
|
||||
"wlr/workspaces": {
|
||||
"format": "{icon}",
|
||||
"on-click": "activate",
|
||||
"format-icons": {
|
||||
"1": "Ⅰ",
|
||||
"2": "Ⅱ",
|
||||
"3": "Ⅲ",
|
||||
"4": "Ⅳ",
|
||||
"5": "Ⅴ",
|
||||
"6": "Ⅵ",
|
||||
"7": "Ⅶ",
|
||||
"8": "Ⅷ",
|
||||
"9": "Ⅸ",
|
||||
"10": "Ⅹ"
|
||||
},
|
||||
"sort-by-number": true
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": "鈴"
|
||||
}
|
||||
},
|
||||
"tray": {
|
||||
"spacing": 10
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}%",
|
||||
"format-icons": {
|
||||
"default": ["", "", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
}
|
||||
}
|
36
home/apps/waybar/style.css
Normal file
36
home/apps/waybar/style.css
Normal file
|
@ -0,0 +1,36 @@
|
|||
* {
|
||||
font-family: Symbols Nerd Font, Berkeley Mono;
|
||||
font-size: 16px;
|
||||
color: #cdd6f4;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: #313244;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #f5c2e7;
|
||||
background: #585b70;
|
||||
box-shadow: inset 0 -3px #f5c2e7;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #f38ba8;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#tray,
|
||||
#idle_inhibitor {
|
||||
padding: 0 10px;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
config,
|
||||
flakePath,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
|
@ -8,11 +9,29 @@
|
|||
inherit (pkgs.stdenv.hostPlatform) isLinux;
|
||||
nvidiaPrefix = "GDM_BACKEND=nvidia-drm LIBVA_DRIVER_NAME=nvidia __GLX_VENDOR_LIBRARY_NAME=nvidia WLR_NO_HARDWARE_CURSORS=1";
|
||||
waylandPrefix = "XDG_SESSION_TYPE=wayland NIXOS_OZONE_WL=1";
|
||||
waybarLauncher = pkgs.writeShellScriptBin "waybar-launcher" (let
|
||||
killall = lib.getExe pkgs.killall;
|
||||
inotifywait = pkgs.inotify-tools + "/bin/inotifywait";
|
||||
in ''
|
||||
#!/bin/sh
|
||||
trap "${killall} .waybar-wrapped" EXIT
|
||||
while true; do
|
||||
waybar &
|
||||
${inotifywait} -e create,modify "$HOME/.config/waybar/config" "$HOME/.config/waybar/style.css"
|
||||
${killall} .waybar-wrapped
|
||||
done
|
||||
'');
|
||||
in {
|
||||
home.shellAliases = lib.mkIf isLinux {
|
||||
"Hyprland" = "${nvidiaPrefix} ${waylandPrefix} Hyprland";
|
||||
"sway" = "${nvidiaPrefix} ${waylandPrefix} sway";
|
||||
};
|
||||
|
||||
programs.waybar = lib.mkIf isLinux {
|
||||
enable = true;
|
||||
package = pkgs.waybar-hyprland;
|
||||
};
|
||||
|
||||
wayland = lib.mkIf isLinux {
|
||||
windowManager = {
|
||||
sway = {
|
||||
|
@ -41,6 +60,11 @@ in {
|
|||
};
|
||||
};
|
||||
xdg = lib.mkIf isLinux {
|
||||
configFile."waybar" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/waybar";
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
configFile."hypr/hyprland.conf".text = let
|
||||
playerctl = lib.getExe pkgs.playerctl;
|
||||
wpctl = pkgs.wireplumber + "/bin/wpctl";
|
||||
|
@ -119,6 +143,7 @@ in {
|
|||
bind = ,XF86AudioNext,exec,${playerctl} next
|
||||
bind = ,XF86AudioPrev,exec,${playerctl} previous
|
||||
bind = ,XF86AudioPause,exec,${playerctl} play-pause
|
||||
exec-once = ${waybarLauncher}/bin/waybar-launcher
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ in {
|
|||
|
||||
nur.repos.nekowinston.org-stats
|
||||
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||
wezterm
|
||||
unstable.wezterm
|
||||
]
|
||||
++ lib.optionals isLinux [
|
||||
_1password-gui
|
||||
|
|
Loading…
Reference in a new issue