diff --git a/configs/scripts.nix b/configs/scripts.nix index 081f4d2..f743f3a 100644 --- a/configs/scripts.nix +++ b/configs/scripts.nix @@ -380,11 +380,14 @@ let esac ''; scripts.wttr = unstable.writers.writeDashBin "wttr" '' - ${pkgs.curl}/bin/curl -s -H "Accept-Language: ''${LANG%_*}" --compressed "wttr.in/''${1-$(${pkgs.curl}/bin/curl -s ipinfo.io | ${pkgs.jq}/bin/jq .loc)}?0" + ${pkgs.curl}/bin/curl -s -H "Accept-Language: ''${LANG%_*}" --compressed "wttr.in/''${1-"@$(${pkgs.curl}/bin/curl -s ipinfo.io | ${pkgs.jq}/bin/jq -r .ip)"}?0" ''; scripts.nix-git = unstable.writers.writeDashBin "nix-git" '' ${pkgs.nix-prefetch-git}/bin/nix-prefetch-git "$@" 2> /dev/null | ${pkgs.jq}/bin/jq -r '"rev = \"\(.rev)\";\nsha256 = \"\(.sha256)\";"' ''; + scripts.autorenkalender = unstable.writers.writeDashBin "autorenkalender" '' + ${pkgs.curl}/bin/curl -s gutenberg.spiegel.de | ${pkgs.gnused}/bin/sed -n '/Autorenkalender/,/<\/div>/p' | ${pkgs.html2text}/bin/html2text | ${pkgs.coreutils}/bin/tail +2 + ''; scripts.q = let q-performance = '' diff --git a/dot/i3.nix b/dot/i3.nix index 7fc9bd9..a0ca7d3 100644 --- a/dot/i3.nix +++ b/dot/i3.nix @@ -50,7 +50,72 @@ rec { childBorder = colorScheme.green.light; }; }; - bars = []; + bars = [{ + workspaceButtons = false; + fonts = [ "${terminalFont.name} ${toString terminalFont.size}" ]; + mode = "hide"; + position = "top"; + statusCommand = + let + i3status-config = pkgs.writeText "i3status.conf" '' + general { + colors = true + color_good = "${colorScheme.green.dark}" + color_bad = "${colorScheme.red.dark}" + color_degraded = "${colorScheme.black.light}" + interval = 5 + separator = " " + } + + order += "run_watch retiolum" + order += "wireless wlp3s0" + order += "battery all" + order += "volume master" + order += "load" + order += "tztime local" + + wireless wlp3s0 { + format_up = "online" + format_down = "offline" + } + + run_watch retiolum { + pidfile = "/var/run/tinc.retiolum.pid" + } + + battery all { + format = "%status%percentage" + format_down = "No battery" + status_chr = "↑" + status_bat = "↓" + status_unk = "" + status_full = "↯" + path = "/sys/class/power_supply/BAT%d/uevent" + low_threshold = 15 + threshold_type = "percentage" + integer_battery_capacity = true + } + + volume master { + format = "%volume" + format_muted = "%volume" + device = "default" + mixer = "Master" + mixer_idx = 0 + } + + tztime local { + format = "%Y-%m-%d %H:%M" + } + + load { + format = "%1min" + } + ''; + in '' + ${pkgs.i3status}/bin/i3status -c ${i3status-config} + ''; + }]; keybindings = { "${modifier}+Down" = "focus down"; "${modifier}+Left" = "focus left";