Natural progress. Finished status notification and added some temporary programs (vms)
This commit is contained in:
parent
e706230566
commit
f2222f56d8
15 changed files with 910 additions and 341 deletions
|
|
@ -3,7 +3,7 @@
|
|||
./fuzzel.nix
|
||||
./hyprlock.nix
|
||||
./hyprland
|
||||
./waybar.nix
|
||||
./waybar
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) getExe;
|
||||
inherit (config.lib.stylix.colors) base0D;
|
||||
|
||||
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
|
|
@ -72,6 +73,9 @@ in {
|
|||
"$mod, A, exec, ${pulsemixer}"
|
||||
"$mod, B, exec, ${bluetui}"
|
||||
"$mod, N, exec, ${nmtui}"
|
||||
''
|
||||
$mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./status.nix {inherit pkgs;}).script})"'
|
||||
''
|
||||
|
||||
"$mod, h, movefocus, l"
|
||||
"$mod, l, movefocus, r"
|
||||
|
|
|
|||
13
home/wayland/hyprland/status.nix
Normal file
13
home/wayland/hyprland/status.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
script = pkgs.writeShellScriptBin "statusnotify" ''
|
||||
DATE=$(date +%R)
|
||||
|
||||
upower -e | grep 'BAT' 2>&1 > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
BAT=$(upower -i $(upower -e | grep 'BAT') | sed -n -e 's/.*time [a-z \s]*: *\([0-9.]* \w*\).*/\1/p' -e 's/.*per\w*: *\([0-9]*%\).*/\1/p' | sed 'N;s/\n/ - /')
|
||||
echo "$DATE - $BAT"
|
||||
else
|
||||
echo $DATE
|
||||
fi
|
||||
'';
|
||||
}
|
||||
257
home/wayland/ironbar.nix
Normal file
257
home/wayland/ironbar.nix
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "left";
|
||||
# monitor configuration, kind of dirty since it assumes DP-1 is my main monitor
|
||||
# output = primaryMonitor osConfig; #builtins.elemAt monitors 0;
|
||||
width = 55;
|
||||
spacing = 6;
|
||||
margin-left = null;
|
||||
margin-top = 6;
|
||||
margin-bottom = 6;
|
||||
margin-right = null;
|
||||
fixed-center = true;
|
||||
exclusive = true;
|
||||
modules-left = [
|
||||
"custom/search"
|
||||
"group/info"
|
||||
];
|
||||
modules-center = ["river/tags"];
|
||||
modules-right = [
|
||||
"group/info-right"
|
||||
"battery"
|
||||
"group/network"
|
||||
"clock"
|
||||
"custom/lock"
|
||||
];
|
||||
|
||||
##### LEFT MODULES #####
|
||||
"custom/search" = {
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
on-click = "${lib.getExe pkgs.killall} rofi || run-as-service $(rofi -show drun)";
|
||||
};
|
||||
|
||||
#### INFO MODULE - START ####
|
||||
"group/info" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = false;
|
||||
};
|
||||
modules = [
|
||||
"custom/dmark"
|
||||
"group/gcpu"
|
||||
"memory"
|
||||
"disk"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/dmark" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
#### CPU MODULE - START ####
|
||||
"group/gcpu" = {
|
||||
orientation = "inherit";
|
||||
modules = [
|
||||
"custom/cpu-icon"
|
||||
"cpu"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/cpu-icon" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
cpu = {
|
||||
format = "<b>{usage}</b>";
|
||||
"on-click" = "foot btop";
|
||||
};
|
||||
##### CPU MODULE - END #####
|
||||
|
||||
memory = {
|
||||
format = "<b> \n{:2}</b>";
|
||||
};
|
||||
|
||||
disk = {
|
||||
interval = 600;
|
||||
format = "<b> \n{percentage_used}</b>";
|
||||
path = "/";
|
||||
};
|
||||
#### INFO MODULE - END ####
|
||||
|
||||
##### CENTER MODULES #####
|
||||
"river/tags" = {
|
||||
num-tags = 9;
|
||||
tag-labels = ["一" "二" "三" "四" "五" "六" "七" "八" "九" "十"];
|
||||
};
|
||||
|
||||
##### RIGHT MODULES #####
|
||||
##### RIGHT INFO MODULE - START ####
|
||||
"group/info-right" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = false;
|
||||
};
|
||||
modules = [
|
||||
"custom/dmark-up"
|
||||
"pulseaudio"
|
||||
"backlight"
|
||||
"bluetooth"
|
||||
"tray"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/dmark-up" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
scroll-step = 5;
|
||||
tooltip = true;
|
||||
tooltip-format = "{volume}";
|
||||
on-click = "${pkgs.killall}/bin/killall pavucontrol || ${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
format = "{icon}";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
default = ["" "" ""];
|
||||
};
|
||||
};
|
||||
|
||||
backlight = let
|
||||
brightnessctl = lib.getExe pkgs.brightnessctl;
|
||||
in {
|
||||
format = "{icon}";
|
||||
format-icons = ["" "" "" "" "" "" ""];
|
||||
on-scroll-up = "${brightnessctl} s 5%-";
|
||||
on-scroll-down = "${brightnessctl} s +5%";
|
||||
tooltip = true;
|
||||
tooltip-format = "Brightness: {percent}% ";
|
||||
smooth-scrolling-threshold = 1;
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
# controller = "controller1", // specify the alias of the controller if there are more than 1 on the system
|
||||
format = "";
|
||||
format-disabled = ""; # an empty format will hide the module
|
||||
format-connected = "";
|
||||
tooltip-format = "{controller_alias}\t{controller_address}";
|
||||
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{device_enumerate}";
|
||||
tooltip-format-disabled = "";
|
||||
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
||||
};
|
||||
|
||||
"tray" = {
|
||||
spacing = 10;
|
||||
};
|
||||
|
||||
##### RIGHT INFO MODULE - END ####
|
||||
|
||||
battery = {
|
||||
rotate = 270;
|
||||
states = {
|
||||
good = 80;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "<b>{icon} </b>";
|
||||
format-full = "<span color='#82A55F'><b>{icon}</b></span>";
|
||||
format-plugged = "";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" "" "" ""];
|
||||
tooltip-format = "{timeTo} {capacity} % | {power} W";
|
||||
};
|
||||
|
||||
#### NETWORK MODULE - START ####
|
||||
"group/network" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = true;
|
||||
};
|
||||
modules = [
|
||||
"network"
|
||||
"network#speed"
|
||||
];
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = "";
|
||||
format-ethernet = "";
|
||||
format-alt = "";
|
||||
format-disconnected = "";
|
||||
};
|
||||
|
||||
"network#speed" = let
|
||||
nm-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
|
||||
in {
|
||||
format = " {bandwidthDownBits} ";
|
||||
rotate = 90;
|
||||
interval = 5;
|
||||
tooltip-format = "{ipaddr}";
|
||||
tooltip-format-wifi = "{essid} ({signalStrength}%) \n{ipaddr} | {frequency} MHz{icon} ";
|
||||
tooltip-format-ethernet = "{ifname} \n{ipaddr} | {frequency} MHz{icon} ";
|
||||
tooltip-format-disconnected = "Not Connected to any type of Network";
|
||||
tooltip = true;
|
||||
on-click = "${nm-editor}";
|
||||
};
|
||||
|
||||
#### NETWORK MODULE - END ####
|
||||
|
||||
clock = {
|
||||
format = ''
|
||||
{:%H
|
||||
%M}'';
|
||||
tooltip-format = ''
|
||||
<big>{:%Y %B}</big>
|
||||
<tt><small>{calendar}</small></tt>
|
||||
'';
|
||||
};
|
||||
|
||||
"custom/lock" = {
|
||||
tooltip = false;
|
||||
on-click = "${pkgs.bash}/bin/bash -c '(sleep 0.5s; ${lib.getExe pkgs.swaylock-effects} --grace 0)' & disown";
|
||||
format = "";
|
||||
};
|
||||
|
||||
"custom/power" = {
|
||||
tooltip = false;
|
||||
on-click = let
|
||||
sudo = pkgs.sudo + "/bin/sudo";
|
||||
rofi = config.programs.rofi.package + "/bin/rofi";
|
||||
poweroff = pkgs.systemd + "/bin/poweroff";
|
||||
reboot = pkgs.systemd + "/bin/reboot";
|
||||
in
|
||||
pkgs.writeShellScript "shutdown-waybar" ''
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
off=" Shutdown"
|
||||
reboot=" Reboot"
|
||||
cancel=" Cancel"
|
||||
|
||||
sure="$(printf '%s\n%s\n%s' "$off" "$reboot" "$cancel" |
|
||||
${rofi} -dmenu -p ' Are you sure?')"
|
||||
|
||||
if [ "$sure" = "$off" ]; then
|
||||
${sudo} ${poweroff}
|
||||
elif [ "$sure" = "$reboot" ]; then
|
||||
${sudo} ${reboot}
|
||||
fi
|
||||
'';
|
||||
format = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,328 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe;
|
||||
|
||||
#TODO: UWSM library mentioned in binds.nix.
|
||||
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
|
||||
fuzzel = getExe pkgs.fuzzel;
|
||||
kitty = getExe pkgs.kitty;
|
||||
|
||||
pulsemixer = "${kitty} ${getExe pkgs.pulsemixer}";
|
||||
nmtui = "${kitty} ${pkgs.networkmanager}/bin/nmtui";
|
||||
in {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "bottom";
|
||||
position = "bottom";
|
||||
mod = "dock";
|
||||
exclusive = true;
|
||||
gtk-layer-shell = true;
|
||||
margin-bottom = -1;
|
||||
passthrough = false;
|
||||
height = 41;
|
||||
modules-left = [
|
||||
"custom/os_button"
|
||||
"hyprland/workspaces"
|
||||
"wlr/taskbar"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right = [
|
||||
"cpu"
|
||||
"memory"
|
||||
"disk"
|
||||
"tray"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"battery"
|
||||
"clock"
|
||||
];
|
||||
"hyprland/language" = {
|
||||
format = "{}";
|
||||
format-en = "ENG";
|
||||
format-ru = "РУС";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
icon-size = 32;
|
||||
spacing = 14;
|
||||
align = "center";
|
||||
justify = "center";
|
||||
on-scroll-up = "${hyprctl} dispatch workspace r+1";
|
||||
on-scroll-down = "${hyprctl} dispatch workspace r-1";
|
||||
};
|
||||
"custom/os_button" = {
|
||||
format = "";
|
||||
on-click = fuzzel;
|
||||
tooltip = false;
|
||||
};
|
||||
cpu = {
|
||||
interval = 5;
|
||||
format = " {usage}%";
|
||||
max-length = 10;
|
||||
};
|
||||
disk = {
|
||||
interval = 30;
|
||||
format = " {percentage_used}%";
|
||||
path = "/";
|
||||
tooltip = true;
|
||||
unit = "GB";
|
||||
tooltip-format = "Available {free} of {total}";
|
||||
};
|
||||
memory = {
|
||||
interval = 10;
|
||||
format = " {percentage}%";
|
||||
max-length = 10;
|
||||
tooltip = true;
|
||||
tooltip-format = "RAM - {used:0.1f}GiB used";
|
||||
};
|
||||
"wlr/taskbar" = {
|
||||
format = "{icon} {title:.17}";
|
||||
icon-size = 28;
|
||||
spacing = 3;
|
||||
on-click-middle = "close";
|
||||
tooltip-format = "{title}";
|
||||
ignore-list = [
|
||||
];
|
||||
on-click = "activate";
|
||||
};
|
||||
tray = {
|
||||
icon-size = 18;
|
||||
spacing = 3;
|
||||
};
|
||||
clock = {
|
||||
format = " {:%R\n %d.%m.%Y}";
|
||||
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
actions = {
|
||||
on-click-right = "mode";
|
||||
on-click-forward = "tz_up";
|
||||
on-click-backward = "tz_down";
|
||||
on-scroll-up = "shift_up";
|
||||
on-scroll-down = "shift_down";
|
||||
};
|
||||
};
|
||||
network = {
|
||||
format-wifi = " {icon}";
|
||||
format-ethernet = " ";
|
||||
format-disconnected = "";
|
||||
format-icons = [
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
];
|
||||
on-click = nmtui;
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
good = 95;
|
||||
warning = 30;
|
||||
critical = 20;
|
||||
};
|
||||
format = "{icon} {capacity}%";
|
||||
format-charging = " {capacity}%";
|
||||
format-plugged = " {capacity}%";
|
||||
format-alt = "{time} {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
pulseaudio = {
|
||||
max-volume = 150;
|
||||
scroll-step = 10;
|
||||
format = "{icon}";
|
||||
tooltip-format = "{volume}%";
|
||||
format-muted = " ";
|
||||
format-icons = {
|
||||
default = [
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
];
|
||||
};
|
||||
on-click = pulsemixer;
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
* {
|
||||
text-shadow: none;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "DejaVuSansM Nerd Font:style=Regular";
|
||||
font-weight: 600;
|
||||
font-size: 12.7px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: @base00;
|
||||
border-top: 1px solid @base01;
|
||||
color: @base05;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: @base01;
|
||||
border-radius: 5px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: @base01;
|
||||
}
|
||||
tooltip label{
|
||||
color: @base05;
|
||||
}
|
||||
|
||||
#custom-os_button {
|
||||
font-size: 24px;
|
||||
padding-left: 12px;
|
||||
padding-right: 20px;
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
#custom-os_button:hover {
|
||||
background: @base03;
|
||||
color: @base05;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
color: transparent;
|
||||
margin-right: 1.5px;
|
||||
margin-left: 1.5px;
|
||||
}
|
||||
#workspaces button {
|
||||
padding: 3px;
|
||||
color: @base04;
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
#workspaces button.active {
|
||||
color: @base05;
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#workspaces button.focused {
|
||||
color: @base02;
|
||||
}
|
||||
#workspaces button.urgent {
|
||||
background: rgba(255, 200, 0, 0.35);
|
||||
border-bottom: 3px dashed @warning_color;
|
||||
color: @warning_color;
|
||||
}
|
||||
#workspaces button:hover {
|
||||
background: @base03;
|
||||
color: @base05;
|
||||
}
|
||||
|
||||
|
||||
#taskbar button {
|
||||
min-width: 130px;
|
||||
border-bottom: 3px solid rgba(255, 255, 255, 0.3);
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
color: white;
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
|
||||
#taskbar button.active {
|
||||
border-bottom: 3px solid white;
|
||||
background: @base02;
|
||||
}
|
||||
|
||||
#taskbar button:hover {
|
||||
border-bottom: 3px solid white;
|
||||
background: @base03;
|
||||
color: @base05;
|
||||
}
|
||||
|
||||
#cpu, #disk, #memory {
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
|
||||
#window {
|
||||
border-radius: 10px;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#tray{
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
#tray > .passive {
|
||||
border-bottom: none;
|
||||
}
|
||||
#tray > .active {
|
||||
border-bottom: 3px solid white;
|
||||
}
|
||||
#tray > .needs-attention {
|
||||
border-bottom: 3px solid @warning_color;
|
||||
}
|
||||
#tray > widget {
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
#tray > widget:hover {
|
||||
background: @base03;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
font-family: "JetBrainsMono Nerd Font";
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
#pulseaudio:hover {
|
||||
background: @base03;
|
||||
}
|
||||
|
||||
#network {
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
#language {
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
}
|
||||
#clock:hover {
|
||||
background: @base03;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
257
home/wayland/waybar/config.nix
Normal file
257
home/wayland/waybar/config.nix
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "left";
|
||||
# monitor configuration, kind of dirty since it assumes DP-1 is my main monitor
|
||||
# output = primaryMonitor osConfig; #builtins.elemAt monitors 0;
|
||||
width = 25;
|
||||
spacing = 6;
|
||||
margin-left = null;
|
||||
margin-top = 6;
|
||||
margin-bottom = 6;
|
||||
margin-right = null;
|
||||
fixed-center = true;
|
||||
exclusive = true;
|
||||
modules-left = [
|
||||
"custom/search"
|
||||
"group/info"
|
||||
];
|
||||
modules-center = ["hyprland/workspaces"];
|
||||
modules-right = [
|
||||
"group/info-right"
|
||||
"battery"
|
||||
"group/network"
|
||||
"clock"
|
||||
"custom/lock"
|
||||
];
|
||||
|
||||
##### LEFT MODULES #####
|
||||
"custom/search" = {
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
on-click = "${lib.getExe pkgs.killall} rofi || run-as-service $(rofi -show drun)";
|
||||
};
|
||||
|
||||
#### INFO MODULE - START ####
|
||||
"group/info" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = false;
|
||||
};
|
||||
modules = [
|
||||
"custom/dmark"
|
||||
"group/gcpu"
|
||||
"memory"
|
||||
"disk"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/dmark" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
#### CPU MODULE - START ####
|
||||
"group/gcpu" = {
|
||||
orientation = "inherit";
|
||||
modules = [
|
||||
"custom/cpu-icon"
|
||||
"cpu"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/cpu-icon" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
cpu = {
|
||||
format = "<b>{usage}</b>";
|
||||
"on-click" = "foot btop";
|
||||
};
|
||||
##### CPU MODULE - END #####
|
||||
|
||||
memory = {
|
||||
format = "<b> \n{:2}</b>";
|
||||
};
|
||||
|
||||
disk = {
|
||||
interval = 600;
|
||||
format = "<b> \n{percentage_used}</b>";
|
||||
path = "/";
|
||||
};
|
||||
#### INFO MODULE - END ####
|
||||
|
||||
##### CENTER MODULES #####
|
||||
"river/tags" = {
|
||||
num-tags = 9;
|
||||
tag-labels = ["一" "二" "三" "四" "五" "六" "七" "八" "九" "十"];
|
||||
};
|
||||
|
||||
##### RIGHT MODULES #####
|
||||
##### RIGHT INFO MODULE - START ####
|
||||
"group/info-right" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = false;
|
||||
};
|
||||
modules = [
|
||||
"custom/dmark-up"
|
||||
"pulseaudio"
|
||||
"backlight"
|
||||
"bluetooth"
|
||||
"tray"
|
||||
];
|
||||
};
|
||||
|
||||
"custom/dmark-up" = {
|
||||
format = "";
|
||||
tooltip = false;
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
scroll-step = 5;
|
||||
tooltip = true;
|
||||
tooltip-format = "{volume}";
|
||||
on-click = "${pkgs.killall}/bin/killall pavucontrol || ${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
format = "{icon}";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
default = ["" "" ""];
|
||||
};
|
||||
};
|
||||
|
||||
backlight = let
|
||||
brightnessctl = lib.getExe pkgs.brightnessctl;
|
||||
in {
|
||||
format = "{icon}";
|
||||
format-icons = ["" "" "" "" "" "" ""];
|
||||
on-scroll-up = "${brightnessctl} s 5%-";
|
||||
on-scroll-down = "${brightnessctl} s +5%";
|
||||
tooltip = true;
|
||||
tooltip-format = "Brightness: {percent}% ";
|
||||
smooth-scrolling-threshold = 1;
|
||||
};
|
||||
|
||||
bluetooth = {
|
||||
# controller = "controller1", // specify the alias of the controller if there are more than 1 on the system
|
||||
format = "";
|
||||
format-disabled = ""; # an empty format will hide the module
|
||||
format-connected = "";
|
||||
tooltip-format = "{controller_alias}\t{controller_address}";
|
||||
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{device_enumerate}";
|
||||
tooltip-format-disabled = "";
|
||||
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
|
||||
};
|
||||
|
||||
"tray" = {
|
||||
spacing = 10;
|
||||
};
|
||||
|
||||
##### RIGHT INFO MODULE - END ####
|
||||
|
||||
battery = {
|
||||
rotate = 270;
|
||||
states = {
|
||||
good = 80;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{icon}";
|
||||
format-charging = "<b>{icon} </b>";
|
||||
format-full = "<span color='#82A55F'><b>{icon}</b></span>";
|
||||
format-plugged = "";
|
||||
format-icons = ["" "" "" "" "" "" "" "" "" "" "" ""];
|
||||
tooltip-format = "{timeTo} {capacity} % | {power} W";
|
||||
};
|
||||
|
||||
#### NETWORK MODULE - START ####
|
||||
"group/network" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
"transition-duration" = 500;
|
||||
"transition-left-to-right" = true;
|
||||
};
|
||||
modules = [
|
||||
"network"
|
||||
"network#speed"
|
||||
];
|
||||
};
|
||||
|
||||
network = {
|
||||
format-wifi = "";
|
||||
format-ethernet = "";
|
||||
format-alt = "";
|
||||
format-disconnected = "";
|
||||
};
|
||||
|
||||
"network#speed" = let
|
||||
nm-editor = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
|
||||
in {
|
||||
format = " {bandwidthDownBits} ";
|
||||
rotate = 90;
|
||||
interval = 5;
|
||||
tooltip-format = "{ipaddr}";
|
||||
tooltip-format-wifi = "{essid} ({signalStrength}%) \n{ipaddr} | {frequency} MHz{icon} ";
|
||||
tooltip-format-ethernet = "{ifname} \n{ipaddr} | {frequency} MHz{icon} ";
|
||||
tooltip-format-disconnected = "Not Connected to any type of Network";
|
||||
tooltip = true;
|
||||
on-click = "${nm-editor}";
|
||||
};
|
||||
|
||||
#### NETWORK MODULE - END ####
|
||||
|
||||
clock = {
|
||||
format = ''
|
||||
{:%H
|
||||
%M}'';
|
||||
tooltip-format = ''
|
||||
<big>{:%Y %B}</big>
|
||||
<tt><small>{calendar}</small></tt>
|
||||
'';
|
||||
};
|
||||
|
||||
"custom/lock" = {
|
||||
tooltip = false;
|
||||
on-click = "${pkgs.bash}/bin/bash -c '(sleep 0.5s; ${lib.getExe pkgs.swaylock-effects} --grace 0)' & disown";
|
||||
format = "";
|
||||
};
|
||||
|
||||
"custom/power" = {
|
||||
tooltip = false;
|
||||
on-click = let
|
||||
sudo = pkgs.sudo + "/bin/sudo";
|
||||
rofi = config.programs.rofi.package + "/bin/rofi";
|
||||
poweroff = pkgs.systemd + "/bin/poweroff";
|
||||
reboot = pkgs.systemd + "/bin/reboot";
|
||||
in
|
||||
pkgs.writeShellScript "shutdown-waybar" ''
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
off=" Shutdown"
|
||||
reboot=" Reboot"
|
||||
cancel=" Cancel"
|
||||
|
||||
sure="$(printf '%s\n%s\n%s' "$off" "$reboot" "$cancel" |
|
||||
${rofi} -dmenu -p ' Are you sure?')"
|
||||
|
||||
if [ "$sure" = "$off" ]; then
|
||||
${sudo} ${poweroff}
|
||||
elif [ "$sure" = "$reboot" ]; then
|
||||
${sudo} ${reboot}
|
||||
fi
|
||||
'';
|
||||
format = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
22
home/wayland/waybar/default.nix
Normal file
22
home/wayland/waybar/default.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (config.lib.stylix) colors;
|
||||
|
||||
waybar_config = import ./config.nix {inherit osConfig config lib pkgs;};
|
||||
waybar_style_content = import ./style.nix {inherit colors;};
|
||||
waybar_style = pkgs.writeText "waybar-style.css" waybar_style_content;
|
||||
in {
|
||||
home.packages = with pkgs.python3Packages; [requests];
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
package = pkgs.waybar;
|
||||
settings = waybar_config;
|
||||
# style = waybar_style;
|
||||
};
|
||||
}
|
||||
214
home/wayland/waybar/style.nix
Normal file
214
home/wayland/waybar/style.nix
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
{colors}:
|
||||
with colors; let
|
||||
OSLogo = builtins.fetchurl rec {
|
||||
name = "OSLogo-${sha256}.png";
|
||||
sha256 = "1cifj774r4z4m856fva1mamnpnhsjl44kw3asklrc57824f5lyz3";
|
||||
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/master/logo/nix-snowflake-colours.svg";
|
||||
};
|
||||
in ''
|
||||
* {
|
||||
font-family: Material Design Icons, Iosevka Nerd Font Mono;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: #${base00};
|
||||
border: .5px solid #${base01};
|
||||
border-radius: 0px;
|
||||
color: #${base05};
|
||||
margin: 8px 8px;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.modules-left {
|
||||
margin: 7px 7px 7px 7px;
|
||||
background-color: #${base02};
|
||||
border: .5px solid #${base01};
|
||||
border-radius: 15px;
|
||||
padding: 2px 2px;
|
||||
}
|
||||
|
||||
.modules-center {
|
||||
margin: 7px 7px 7px 7px;
|
||||
background-color: #${base02};
|
||||
border: .5px solid #${base01};
|
||||
border-radius: 15px;
|
||||
padding: 2px 0px 2px 0px;
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin: 7px 7px 7px 7px;
|
||||
background-color: #${base02};
|
||||
border: .5px solid #${base01};
|
||||
border-radius: 15px;
|
||||
padding: 2px 0px 2px 0px;
|
||||
}
|
||||
|
||||
#custom-weather,
|
||||
#clock,
|
||||
#network,
|
||||
#custom-swallow,
|
||||
#custom-power,
|
||||
#cpu,
|
||||
#battery,
|
||||
#backlight,
|
||||
#memory,
|
||||
#tags,
|
||||
#custom-search,
|
||||
#custom-power,
|
||||
#custom-todo,
|
||||
#custom-lock,
|
||||
#custom-weather,
|
||||
#volume,
|
||||
#cpu,
|
||||
#bluetooth,
|
||||
#gamemode,
|
||||
#gcpu,
|
||||
#memory,
|
||||
#disk,
|
||||
#submap,
|
||||
#pulseaudio {
|
||||
padding: 4px 0px 4px 0px;
|
||||
margin: 0px 0px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
#tags button {
|
||||
background-color: transparent;
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
color: #${base07};
|
||||
font-size: 21px;
|
||||
/* padding-left: 6px; */
|
||||
box-shadow: inset 0 -3px transparent;
|
||||
}
|
||||
|
||||
#tags button:hover {
|
||||
color: #${base05};
|
||||
background-color: #${base03};
|
||||
}
|
||||
|
||||
#tags button.focused {
|
||||
border-radius: 20px;
|
||||
border-color: #${base0E};
|
||||
}
|
||||
|
||||
#tags button.occupied {
|
||||
color: #${base0E};
|
||||
}
|
||||
|
||||
#tags button.urgent {
|
||||
color: #${base08};
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
color: #${base08};
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
#tags {
|
||||
background-color: #${base02};
|
||||
}
|
||||
|
||||
#network {
|
||||
color: #${base07};
|
||||
|
||||
}
|
||||
|
||||
#gamemode {
|
||||
color: #${base07};
|
||||
}
|
||||
|
||||
#custom-weather {
|
||||
color: #${base05};
|
||||
background-color: #${base02};
|
||||
}
|
||||
|
||||
#bluetooth {
|
||||
color: #${base0E};
|
||||
}
|
||||
|
||||
#bluetooth.off,
|
||||
#bluetooth.pairable,
|
||||
#bluetooth.discovering,
|
||||
#bluetooth.disabled {
|
||||
color: rgba(0, 0, 0, 0.0);
|
||||
background-color: rgba(0, 0, 0, 0.0);
|
||||
margin: -50;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: #${base05};
|
||||
background-color: #${base02};
|
||||
font-weight: 700;
|
||||
font-size: 20px;
|
||||
font-family: "Iosevka Term";
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #${base0B};
|
||||
}
|
||||
|
||||
#pulseaudio.source-muted,
|
||||
#pulseaudio.muted {
|
||||
color: #${base08};
|
||||
}
|
||||
|
||||
#custom-swallow {
|
||||
color: #${base0E};
|
||||
|
||||
}
|
||||
|
||||
#custom-lock {
|
||||
color: #${base07};
|
||||
|
||||
}
|
||||
|
||||
#custom-todo {
|
||||
color: #${base05};
|
||||
}
|
||||
|
||||
#custom-cpu {
|
||||
color: #${base0B};
|
||||
}
|
||||
|
||||
#custom-search {
|
||||
background-image: url("${OSLogo}");
|
||||
background-size: 65%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
color: #${base0A};
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: #${base0C};
|
||||
}
|
||||
|
||||
#battery.warning {
|
||||
color: #${base09};
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
color: #${base08};
|
||||
}
|
||||
|
||||
tooltip {
|
||||
font-family: 'Lato', sans-serif;
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
tooltip label {
|
||||
font-family: 'Lato', sans-serif;
|
||||
padding: 20px;
|
||||
}
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue