miku: Theme waybar

This commit is contained in:
PapaTutuWawa 2021-10-26 17:30:05 +02:00
parent ba9d0768ee
commit b851d85fda
5 changed files with 185 additions and 29 deletions

View File

@ -10,7 +10,7 @@ in mkHost config {
hardwareImports = [ "amdgpu" "amd" ]; hardwareImports = [ "amdgpu" "amd" ];
programImports = [ programImports = [
"zsh" "git" "mpv" "tmux" "emacs" "firefox" "i18n" "gamemode" "gnome" #"gnome-terminal" "zsh" "git" "mpv" "tmux" "emacs" "firefox" "i18n" "gamemode" "gnome" #"gnome-terminal"
"alacritty" "sway" "waybar" "kanshi" "alacritty" "sway" "waybar" "swaync" "kanshi"
"distributed-build/builder.nix" "distributed-build/builder.nix"
"music" "music"
]; ];
@ -31,7 +31,7 @@ in mkHost config {
}; };
extraPackages = pkgs: with pkgs; [ extraPackages = pkgs: with pkgs; [
emacsPgtkGcc emacsPgtkGcc
gajim gajim-mainwindow
virt-manager unstable.qemu scream virt-manager unstable.qemu scream
#gamemode # Custom package #gamemode # Custom package
key-mapper # Custom package key-mapper # Custom package

View File

@ -133,6 +133,8 @@ let
source-han-sans source-han-serif source-han-sans source-han-serif
# Coding fonts # Coding fonts
source-code-pro source-code-pro
# Icon fonts
nerdfonts
]; ];
# We don't tolerate non-free software, except for Steam and Linux firmware # We don't tolerate non-free software, except for Steam and Linux firmware

View File

@ -24,9 +24,10 @@ let
${binary} ${args} ${binary} ${args}
''; '';
makoWrapper = mkWrapperScript "${pkgs.mako}/bin/mako" "--default-timeout=3000"; swayncWrapper = mkWrapperScript "${pkgs.swaync}/bin/swaync" "";
waybarWrapper = mkWrapperScript "${pkgs.waybar}/bin/waybar" ""; waybarWrapper = mkWrapperScript "${pkgs.waybar}/bin/waybar" "";
kanshiWrapper = mkWrapperScript "${pkgs.kanshi}/bin/kanshi" ""; kanshiWrapper = mkWrapperScript "${pkgs.kanshi}/bin/kanshi" "";
nwggridWrapper = mkWrapperScript "${pkgs.nwg-launchers}/bin/nwggrid-server" "";
# TODO: Fuse this with kanshi # TODO: Fuse this with kanshi
swayIdleWrapper = mkWrapperScript "${pkgs.swayidle}/bin/swayidle" "-w before-sleep '${pkgs.swaylock}/bin/swaylock -f --image $(find ~/Data/Wallpaper/horizontal/ -maxdepth 1 -type f | shuf -n 1)'"; swayIdleWrapper = mkWrapperScript "${pkgs.swayidle}/bin/swayidle" "-w before-sleep '${pkgs.swaylock}/bin/swaylock -f --image $(find ~/Data/Wallpaper/horizontal/ -maxdepth 1 -type f | shuf -n 1)'";
in { in {
@ -36,7 +37,8 @@ in {
config = { config = {
bars = [ ]; bars = [ ];
startup = [ startup = [
{ command = "${makoWrapper}"; always = true; } { command = "${nwggridWrapper}"; always = true; }
{ command = "${swayncWrapper}"; always = true; }
{ command = "${waybarWrapper}"; always = true; } { command = "${waybarWrapper}"; always = true; }
{ command = "${kanshiWrapper}"; always = true; } { command = "${kanshiWrapper}"; always = true; }
{ command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; always = true; } { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; always = true; }

View File

@ -1,33 +1,52 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
home-manager.users."${config.system.singleUser}".programs.waybar = { home-manager.users."${config.system.singleUser}" = {
xdg.configFile."waybar/style.css".source = ./style.css;
programs.waybar = {
enable = true; enable = true;
style = builtins.readFile ./style.css;
settings = [ settings = [
{ {
output = [ "DP-2" ];
layer = "bottom"; layer = "bottom";
position = "top"; position = "left";
gtk-layer-shell = true; gtk-layer-shell = true;
modules-left = [ "custom/grid" "sway/workspaces" "sway/mode" ]; modules-left = [ "custom/applauncher" "sway/workspaces" "sway/mode" ];
modules-center = [ "clock" ]; modules-center = [ "clock" ];
modules-right = [ "tray" "idle_inhibitor" "pulseaudio" "custom/menu" ]; modules-right = [ "tray" "idle_inhibitor" "pulseaudio" "custom/notifications" "custom/menu" ];
modules = { modules = {
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
"sway/workspaces" = { "sway/workspaces" = {
disable-scroll = true; disable-scroll = true;
all-outputs = true; all-outputs = true;
}; };
"custom/grid" = { "custom/applauncher" = {
format = "Start"; format = " ";
on-click = "${pkgs.nwg-launchers}/bin/nwggrid"; on-click = "${pkgs.nwg-launchers}/bin/nwggrid -client";
tooltip = "false";
};
"custom/notifications" = {
format = " ";
on-click = "${pkgs.swaync}/bin/swaync-client --toggle-panel";
tooltip = "false";
}; };
"custom/menu" = { "custom/menu" = {
format = "Menu"; format = " ";
on-click = "${pkgs.nwg-menu}/bin/nwg-menu -ha right -va top -d -fm ${pkgs.gnome.nautilus}"; on-click = "${pkgs.wlogout}/bin/wlogout";
tooltip = "false";
}; };
}; };
} }
]; ];
}; };
};
} }

View File

@ -0,0 +1,133 @@
/*
Based on https://github.com/indicozy/wmtm/blob/main/configs/Flower/config/waybar/style.css
*/
@define-color background #323732;
@define-color foreground #deddda;
@define-color selection #44475a;
@define-color unfocused #6272a4;
@define-color cyan #5d7380;
@define-color green #fff6f6;
@define-color orange #d65d0e;
@define-color pink #ff5370;
@define-color purple #b16286;
@define-color red #bf6374;
@define-color yellow #d79921;
@define-color fore #d1c29d;
* {
font-size: 14px;
font-family: "Hack";
padding: 0px;
margin: 0px;
/* text-shadow:1px 1px 2px rgba(0,0,0,.6); */
}
window#waybar {
color: @foreground;
border-radius: 0;
}
window#waybar.left {
background: rgba(43, 48, 59, .85);
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-top: none;
margin: 0;
}
window#waybar.bottom {
padding-top: 0px;
background: @green;
border-bottom-left-radius: 0px;
margin: 0;
}
.modules-left,
.modules-center,
.modules-right {
margin: 0;
padding: 0;
}
/* Base styling for modules */
#workspaces,
#mode,
#window,
#idle_inhibitor,
#pulseaudio,
#taskbar,
#tray,
#custom-menu {
padding: 1px 0px 1px 0px;
margin: 0px;
}
#pulseaudio, #idle_inhibitor {
font-size: 30px;
margin: 0px 2px;
}
#pulseaudio {
font-size: 16px;
}
#taskbar,
#tray,
#window {
padding: 0;
margin: 0 0px 0 0px;
}
#taskbar {
margin-top: 0px;
}
#taskbar button {
color: @foreground;
border-radius: 0px;
padding: 3px 0px 3px 0px;
}
#taskbar button.active {
icon-shadow: 0px 0px 3px alpha(#111131, .9);
border-style: dashed;
border-width: 0 0 0 0;
border-color: @foreground;
border-radius: 0;
}
#tray {
color: black;
icon-shadow: 0px 1px 2px alpha(#020000, .9);
padding: 2px 0px 2px 0px;
}
#custom-menu,
#custom-applauncher,
#custom-notifications {
font-size: 30px;
}
#clock {
font-size: 16px;
margin-left: 2px;
margin-right: 2px;
}
#workspaces {
padding: 0px 0px 0px 0px;
margin-left: 0px;
}
#workspaces button {
margin: 0;
padding: 0px 0px 0px 0px;
border-radius: 0px;
color: @foreground;
}
#workspaces button.focused {
color: @foreground;
background-color: @purple;
border-style: solid;
border-width: 0 0 0 0;
border-color: @foreground;
border-radius: 0;
}