2020-10-30 11:05:26 +01:00
|
|
|
{ pkgs, wirelessInterface, colours, batteryName }:
|
2020-05-08 11:51:22 +02:00
|
|
|
let
|
2020-09-24 19:16:51 +02:00
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
|
2020-06-10 17:37:25 +02:00
|
|
|
setsid = script:
|
|
|
|
|
pkgs.writers.writeDash "setsid-command" ''
|
|
|
|
|
${pkgs.utillinux}/bin/setsid ${script}
|
|
|
|
|
'';
|
2020-08-17 16:03:21 +02:00
|
|
|
coronaBlock = {
|
|
|
|
|
block = "custom";
|
|
|
|
|
interval = 60 * 2; # every two minutes
|
|
|
|
|
command = pkgs.writers.writeDash "corona" ''
|
|
|
|
|
${pkgs.curl}/bin/curl https://corona-stats.online/germany \
|
|
|
|
|
| ${pkgs.gnugrep}/bin/grep Germany \
|
|
|
|
|
| ${pkgs.gnused}/bin/sed 's/\s*//g' \
|
|
|
|
|
| ${pkgs.ansifilter}/bin/ansifilter \
|
|
|
|
|
| ${pkgs.gawk}/bin/awk -F'│' '{print "🤒 " $8 " 💀 " $5}'
|
|
|
|
|
'';
|
|
|
|
|
};
|
2020-06-10 17:37:25 +02:00
|
|
|
in {
|
2019-11-05 21:59:51 +01:00
|
|
|
theme = {
|
|
|
|
|
name = "plain";
|
|
|
|
|
overrides = {
|
|
|
|
|
critical_fg = colours.red.bright;
|
|
|
|
|
good_fg = colours.green.bright;
|
|
|
|
|
idle_fg = colours.foreground;
|
|
|
|
|
info_fg = colours.foreground;
|
|
|
|
|
warning_fg = colours.yellow.bright;
|
2020-05-31 18:25:39 +02:00
|
|
|
warning_bg = colours.background;
|
2019-11-05 21:59:51 +01:00
|
|
|
alternating_tint_bg = colours.background;
|
|
|
|
|
alternating_tint_fg = colours.background;
|
|
|
|
|
critical_bg = colours.background;
|
|
|
|
|
good_bg = colours.background;
|
|
|
|
|
idle_bg = colours.background;
|
|
|
|
|
info_bg = colours.background;
|
2020-11-10 21:03:10 +01:00
|
|
|
separator = "/ ";
|
2020-05-31 18:25:39 +02:00
|
|
|
separator_bg = "auto";
|
2020-09-03 19:16:49 +02:00
|
|
|
separator_fg = colours.black.bright;
|
2019-11-05 21:59:51 +01:00
|
|
|
};
|
|
|
|
|
};
|
2020-04-13 11:02:37 +02:00
|
|
|
icons = {
|
|
|
|
|
name = "none";
|
|
|
|
|
overrides = {
|
|
|
|
|
bat = "🔋";
|
|
|
|
|
bat_charging = "🔌";
|
|
|
|
|
bat_discharging = "🔋";
|
2020-08-26 11:33:16 +02:00
|
|
|
bat_empty = " ";
|
|
|
|
|
bat_full = " ";
|
|
|
|
|
bat_half = " ";
|
|
|
|
|
bat_quarter = " ";
|
|
|
|
|
bat_three_quarters = " ";
|
|
|
|
|
cogs = "🚦 ";
|
|
|
|
|
cpu = "🖥 ";
|
|
|
|
|
mail = "📧 ";
|
|
|
|
|
memory_mem = "🧠 ";
|
|
|
|
|
music = "🎵";
|
|
|
|
|
music_next = "⏭";
|
|
|
|
|
music_pause = "";
|
|
|
|
|
music_play = "▶";
|
|
|
|
|
music_prev = "⏮";
|
2020-04-23 13:15:34 +02:00
|
|
|
net_down = "❎";
|
2020-08-26 11:33:16 +02:00
|
|
|
net_up = "🌐";
|
2020-04-22 17:42:45 +02:00
|
|
|
net_vpn = "🛡 ";
|
2020-08-26 11:33:16 +02:00
|
|
|
net_wired = "🌐";
|
|
|
|
|
net_wireless = "📶";
|
|
|
|
|
pomodoro = "🍅 ";
|
|
|
|
|
time = "📅 ";
|
2020-04-23 13:15:34 +02:00
|
|
|
toggle_off = "👎";
|
|
|
|
|
toggle_on = "👍";
|
2020-08-26 11:33:16 +02:00
|
|
|
volume_empty = "🔈 ";
|
2020-04-22 17:42:45 +02:00
|
|
|
volume_full = "🔊 ";
|
|
|
|
|
volume_half = "🔉 ";
|
2020-08-26 11:33:16 +02:00
|
|
|
volume_muted = "🔇";
|
2021-04-04 11:12:17 +02:00
|
|
|
weather_sun = "🌣";
|
|
|
|
|
weather_clouds = "🌥";
|
|
|
|
|
weather_rain = "🌧";
|
|
|
|
|
weather_snow = "🌨";
|
|
|
|
|
weather_default = "🌡";
|
|
|
|
|
weather_thunder = "🌩";
|
2020-04-13 11:02:37 +02:00
|
|
|
};
|
|
|
|
|
};
|
2019-11-05 21:59:51 +01:00
|
|
|
block = [
|
2021-04-04 11:12:17 +02:00
|
|
|
{
|
|
|
|
|
block = "weather";
|
2021-04-05 10:08:01 +02:00
|
|
|
autolocate = true;
|
|
|
|
|
format = "{location}: {temp}°C";
|
2021-04-04 11:12:17 +02:00
|
|
|
service = {
|
|
|
|
|
name = "openweathermap";
|
|
|
|
|
api_key = lib.strings.fileContents <secrets/openweathermap.key>;
|
|
|
|
|
city_id = "2950159";
|
|
|
|
|
units = "metric";
|
|
|
|
|
};
|
|
|
|
|
}
|
2020-05-03 00:17:09 +02:00
|
|
|
{
|
|
|
|
|
block = "custom";
|
|
|
|
|
interval = 30;
|
2020-09-24 19:16:51 +02:00
|
|
|
command =
|
2020-09-29 22:59:02 +02:00
|
|
|
let query = "tag:unread AND tag:inbox";
|
2020-09-24 19:16:51 +02:00
|
|
|
in pkgs.writers.writeDash "count-new-mail" ''
|
|
|
|
|
mail_count="$(${pkgs.notmuch}/bin/notmuch search ${lib.escapeShellArg query} | wc -l)"
|
|
|
|
|
[ "$mail_count" = 0 ] && printf "📭" || printf "📬"
|
|
|
|
|
echo "$mail_count"
|
|
|
|
|
'';
|
2020-05-03 00:17:09 +02:00
|
|
|
}
|
2021-05-18 20:38:26 +02:00
|
|
|
(let service = "openvpn-hu-berlin"; in {
|
|
|
|
|
block = "custom";
|
|
|
|
|
interval = 5;
|
|
|
|
|
command = pkgs.writers.writeDash "net-device" ''
|
|
|
|
|
PATH=${lib.makeBinPath [ pkgs.systemd ]}
|
|
|
|
|
systemctl is-active --quiet ${service}.service && echo "🎓👍" || echo "🎓👎"
|
|
|
|
|
'';
|
|
|
|
|
on_click = pkgs.writers.writeDash "toggle" ''
|
|
|
|
|
PATH=${lib.makeBinPath [ pkgs.systemd pkgs.libnotify ]}
|
|
|
|
|
systemctl is-active --quiet ${service}.service && {
|
|
|
|
|
systemctl stop ${service}.service && notify-send -a "${service}" stopped
|
|
|
|
|
} || {
|
|
|
|
|
systemctl start ${service}.service && notify-send -a "${service}" started
|
|
|
|
|
}
|
|
|
|
|
'';
|
|
|
|
|
})
|
2019-11-05 21:59:51 +01:00
|
|
|
{
|
|
|
|
|
block = "net";
|
2020-10-30 11:05:26 +01:00
|
|
|
device = wirelessInterface;
|
2019-11-05 21:59:51 +01:00
|
|
|
speed_up = false;
|
|
|
|
|
speed_down = false;
|
2020-01-24 10:09:04 +01:00
|
|
|
signal_strength = true;
|
|
|
|
|
ssid = true;
|
2019-11-05 21:59:51 +01:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
block = "battery";
|
2020-10-30 11:05:26 +01:00
|
|
|
device = batteryName;
|
2019-11-05 21:59:51 +01:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
block = "sound";
|
2020-01-24 10:09:04 +01:00
|
|
|
on_click = "pavucontrol";
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
block = "disk_space";
|
2020-04-22 17:42:45 +02:00
|
|
|
alias = "💽";
|
2019-11-05 21:59:51 +01:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
block = "memory";
|
|
|
|
|
display_type = "memory";
|
2020-06-04 13:29:29 +02:00
|
|
|
format_mem = "{Mug}G";
|
2019-11-05 21:59:51 +01:00
|
|
|
clickable = false;
|
|
|
|
|
}
|
2020-06-10 17:37:25 +02:00
|
|
|
{ block = "load"; }
|
2019-11-05 21:59:51 +01:00
|
|
|
{
|
|
|
|
|
block = "time";
|
2020-09-15 16:21:38 +02:00
|
|
|
interval = 1;
|
2021-03-23 19:39:08 +01:00
|
|
|
format = "%Y-%m-%d (%W %a) %H:%M";
|
2019-11-05 21:59:51 +01:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|