2023-06-02 10:40:51 -03:00
|
|
|
{ config, osConfig, pkgs, lib, font, ... }:
|
2023-01-24 11:42:49 -03:00
|
|
|
let
|
|
|
|
inherit (pkgs.uservars) key theme accent font;
|
|
|
|
inherit (theme) color;
|
|
|
|
in
|
|
|
|
{
|
2022-08-04 23:46:59 -03:00
|
|
|
config = {
|
|
|
|
programs.waybar = {
|
|
|
|
enable = true;
|
|
|
|
systemd.enable = true;
|
|
|
|
systemd.target = "sway-session.target";
|
|
|
|
settings = [{
|
|
|
|
layer = "top";
|
2024-01-15 22:37:11 -03:00
|
|
|
modules-left = [
|
|
|
|
"sway/workspaces"
|
|
|
|
"sway/mode"
|
|
|
|
"sway/window"
|
|
|
|
"hyprland/workspaces"
|
|
|
|
"hyprland/mode"
|
|
|
|
"hyprland/window"
|
|
|
|
];
|
2022-08-04 23:46:59 -03:00
|
|
|
modules-center = [ "clock" ];
|
2023-06-02 10:40:51 -03:00
|
|
|
modules-right = lib.flatten [
|
2022-08-12 20:58:53 -03:00
|
|
|
"sway/language"
|
2024-01-15 22:37:11 -03:00
|
|
|
"hyprland/language"
|
2022-08-12 20:58:53 -03:00
|
|
|
"mpd"
|
2023-02-06 14:28:39 -03:00
|
|
|
"custom/playerctl"
|
2023-06-06 10:04:14 -03:00
|
|
|
# "tray"
|
2022-08-12 20:58:53 -03:00
|
|
|
"custom/caffeine"
|
|
|
|
"pulseaudio"
|
2023-06-02 11:14:27 -03:00
|
|
|
(lib.optional (osConfig.services.vpn.enable or false) "custom/vpn")
|
2022-08-12 20:58:53 -03:00
|
|
|
"network"
|
|
|
|
"battery"
|
|
|
|
];
|
|
|
|
battery = {
|
|
|
|
tooltip = true;
|
|
|
|
states = {
|
|
|
|
full = 100;
|
|
|
|
good = 95;
|
|
|
|
warning = 25;
|
|
|
|
};
|
|
|
|
format = "{icon} ";
|
|
|
|
format-charging = "";
|
|
|
|
format-plugged = "";
|
|
|
|
format-full = "";
|
|
|
|
format-warning = "{icon} {time}";
|
|
|
|
format-icons = [ "" "" "" "" "" "" ];
|
|
|
|
};
|
2022-08-04 23:46:59 -03:00
|
|
|
network = {
|
|
|
|
interval = 5;
|
|
|
|
tooltip = false;
|
2022-12-06 20:29:38 -03:00
|
|
|
on-click = "terminal -e iwd";
|
2022-08-04 23:46:59 -03:00
|
|
|
format-wifi = "{icon}";
|
|
|
|
format-icons = [ "" "" "" "" "" ];
|
2023-06-02 22:42:56 -03:00
|
|
|
format-ethernet = "";
|
|
|
|
format-linked = "";
|
2022-08-04 23:46:59 -03:00
|
|
|
format-disconnected = "";
|
|
|
|
};
|
|
|
|
"sway/workspaces" = {
|
|
|
|
enable-bar-scroll = true;
|
|
|
|
format = "{icon}";
|
|
|
|
format-icons = {
|
|
|
|
"1" = "";
|
|
|
|
"2" = "";
|
2023-06-02 22:42:56 -03:00
|
|
|
"3" = "";
|
2022-08-04 23:46:59 -03:00
|
|
|
"4" = "";
|
|
|
|
"5" = "";
|
|
|
|
"6" = "";
|
2023-06-02 22:42:56 -03:00
|
|
|
"7" = "";
|
2022-08-04 23:46:59 -03:00
|
|
|
"8" = "";
|
|
|
|
"9" = "";
|
|
|
|
"10" = "";
|
|
|
|
urgent = "";
|
2023-11-26 15:40:25 -03:00
|
|
|
# focused = "";
|
2022-08-04 23:46:59 -03:00
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
};
|
2022-08-12 20:58:53 -03:00
|
|
|
"sway/window" = { max-length = 40; };
|
2024-01-15 22:37:11 -03:00
|
|
|
"sway/language" = { format = "{short} {variant}"; };
|
|
|
|
"hyprland/workspaces" = {
|
|
|
|
enable-bar-scroll = true;
|
2024-01-21 00:03:50 -03:00
|
|
|
on-scroll-up = "hyprctl dispatch workspace e-1";
|
|
|
|
on-scroll-down = "hyprctl dispatch workspace e+1";
|
2024-01-15 22:37:11 -03:00
|
|
|
format = "{icon}";
|
|
|
|
format-icons = {
|
|
|
|
"1" = "";
|
|
|
|
"2" = "";
|
|
|
|
"3" = "";
|
|
|
|
"4" = "";
|
|
|
|
"5" = "";
|
|
|
|
"6" = "";
|
|
|
|
"7" = "";
|
|
|
|
"8" = "";
|
|
|
|
"9" = "";
|
|
|
|
"10" = "";
|
|
|
|
urgent = "";
|
|
|
|
# focused = "";
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"hyprland/window" = { max-length = 40; };
|
|
|
|
"hyprland/language" = { format = "{short} {variant}"; };
|
2022-08-12 23:35:42 -03:00
|
|
|
"tray" = {
|
|
|
|
"spacing" = 7;
|
|
|
|
"icon-size" = 19;
|
|
|
|
};
|
2022-08-04 23:46:59 -03:00
|
|
|
clock = {
|
|
|
|
interval = 60;
|
|
|
|
format = "<b>{:%H:%M %a %d/%m}</b>";
|
2023-08-13 15:09:49 -03:00
|
|
|
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='${color.normal.magenta}'><b>{}</b></span>";
|
|
|
|
days = "<span color='${color.txt}'><b>{}</b></span>";
|
|
|
|
weeks = "<span color='${color.normal.cyan}'><b>W{}</b></span>";
|
|
|
|
weekdays = "<span color='${color.normal.yellow}'><b>{}</b></span>";
|
|
|
|
today = "<span color='${accent.color}'><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";
|
|
|
|
};
|
2022-08-04 23:46:59 -03:00
|
|
|
};
|
2023-01-22 18:12:04 -03:00
|
|
|
mpd =
|
|
|
|
let
|
|
|
|
mpc = "${pkgs.mpc-cli}/bin/mpc";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
format = "{stateIcon} {title} - {artist}";
|
|
|
|
format-paused = "{stateIcon}";
|
|
|
|
format-stopped = "";
|
|
|
|
state-icons = {
|
2023-02-06 14:28:39 -03:00
|
|
|
stopped = "";
|
2023-01-22 18:12:04 -03:00
|
|
|
paused = "";
|
|
|
|
playing = "";
|
|
|
|
};
|
|
|
|
tooltip = false;
|
|
|
|
on-click = "${mpc} toggle";
|
|
|
|
on-scroll-up = "${mpc} vol +10";
|
|
|
|
on-scroll-down = "${mpc} vol -10";
|
2022-08-12 20:58:53 -03:00
|
|
|
};
|
2023-02-08 17:12:54 -03:00
|
|
|
"custom/playerctl" = {
|
2023-05-15 12:49:01 -03:00
|
|
|
format = "{} ";
|
2023-02-08 17:12:54 -03:00
|
|
|
exec = "${pkgs.playerctl-status}/bin/playerctl-status";
|
|
|
|
on-click = "${pkgs.playerctl}/bin/playerctl --ignore-player=mpd play-pause";
|
|
|
|
interval = 1;
|
|
|
|
tooltip = false;
|
|
|
|
};
|
2022-08-04 23:46:59 -03:00
|
|
|
"custom/caffeine" = {
|
|
|
|
format = "{}";
|
2023-06-02 22:42:56 -03:00
|
|
|
exec = "systemctl --user status swayidle > /dev/null && echo || echo ";
|
2023-05-04 19:32:12 -03:00
|
|
|
on-click = "${pkgs._sway_idle_toggle}/bin/_sway_idle_toggle";
|
2022-08-04 23:46:59 -03:00
|
|
|
interval = 1;
|
|
|
|
tooltip = false;
|
|
|
|
};
|
2023-06-02 11:14:27 -03:00
|
|
|
"custom/vpn" = lib.mkIf (osConfig.services.vpn.enable or false) {
|
2023-04-23 23:37:00 -03:00
|
|
|
format = "{}";
|
|
|
|
exec = ''
|
2023-09-12 00:43:56 -03:00
|
|
|
${pkgs.mullvad}/bin/mullvad status | ${pkgs.gnugrep}/bin/grep "^Connected" > /dev/null \
|
2023-04-23 23:37:00 -03:00
|
|
|
&& echo "" \
|
|
|
|
|| echo ""
|
|
|
|
'';
|
|
|
|
on-click = "mullvad connect";
|
2023-06-27 12:49:47 -03:00
|
|
|
on-click-right = "mullvad disconnect";
|
2023-04-23 23:37:00 -03:00
|
|
|
interval = 1;
|
|
|
|
tooltip = false;
|
|
|
|
};
|
2022-08-04 23:46:59 -03:00
|
|
|
pulseaudio = {
|
|
|
|
interval = 5;
|
|
|
|
tooltip = false;
|
|
|
|
scroll-step = 10;
|
|
|
|
format = "{icon}";
|
|
|
|
format-bluetooth = "";
|
2023-06-02 22:42:56 -03:00
|
|
|
format-bluetooth-muted = "";
|
|
|
|
format-muted = "";
|
2022-08-04 23:46:59 -03:00
|
|
|
format-icons = {
|
2023-12-19 08:14:19 -03:00
|
|
|
"rtp-sink" =
|
|
|
|
[ "" "" "" ];
|
|
|
|
"alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" =
|
|
|
|
[ " " " " " " ];
|
2022-11-07 11:24:40 -03:00
|
|
|
"alsa_output.pci-0000_09_00.4.analog-stereo" =
|
2023-06-02 22:42:56 -03:00
|
|
|
[ " " " " " " ];
|
|
|
|
headphone = [ " " " " " " ];
|
2022-08-04 23:46:59 -03:00
|
|
|
handsfree = "";
|
|
|
|
headset = "";
|
|
|
|
phone = "";
|
|
|
|
portable = "";
|
|
|
|
car = "";
|
2023-06-02 22:42:56 -03:00
|
|
|
default = [ "" "" "" ];
|
2022-08-04 23:46:59 -03:00
|
|
|
};
|
|
|
|
on-click = "pavucontrol";
|
2023-02-14 17:50:28 -03:00
|
|
|
on-click-right = "${pkgs.pulse_sink}/bin/pulse_sink";
|
2023-09-12 00:51:09 -03:00
|
|
|
on-scroll-up = "${pkgs.volumesh}/bin/volumesh -i 10";
|
|
|
|
on-scroll-down = "${pkgs.volumesh}/bin/volumesh -d 10";
|
2022-08-04 23:46:59 -03:00
|
|
|
};
|
|
|
|
}];
|
2023-05-04 23:57:36 -03:00
|
|
|
style = builtins.readFile (pkgs.substituteAll {
|
|
|
|
src = ./style.css;
|
|
|
|
|
|
|
|
accent_color = accent.color;
|
|
|
|
|
|
|
|
color_bg = color.bg;
|
|
|
|
color_bg_dark = color.bg_dark;
|
|
|
|
color_bg_light = color.bg_light;
|
|
|
|
color_txt = color.txt;
|
|
|
|
|
|
|
|
font_interface = font.interface;
|
|
|
|
|
|
|
|
font_size_big = "${toString font.size.big}px";
|
|
|
|
font_size_medium = "${toString font.size.medium}px";
|
|
|
|
});
|
2022-08-04 23:46:59 -03:00
|
|
|
};
|
2022-08-30 22:01:06 -03:00
|
|
|
home.packages = with pkgs; [ waybar ];
|
2022-08-04 23:46:59 -03:00
|
|
|
};
|
|
|
|
}
|