From 434168baaacb376fa5d7207751affdc5e8aa48f5 Mon Sep 17 00:00:00 2001 From: dabruh <11458706-dabruh@users.noreply.gitlab.com> Date: Sun, 29 May 2022 00:31:14 +0200 Subject: [PATCH] Add i3status configuration overriding. --- .config/i3status/{config => config.main} | 32 ------------------- .config/i3status/config.post-main-25 | 6 ++++ .config/i3status/config.post-main-75 | 3 ++ .../overrides/config.post-main-01-cmus | 1 + .../overrides/config.post-main-01-docker | 1 + .../overrides/config.post-main-50-desktop | 20 ++++++++++++ .installer/ignored | 1 + .local/bin/battmon.sh | 0 .local/bin/i3-config-builder | 22 +++++++------ 9 files changed, 45 insertions(+), 41 deletions(-) rename .config/i3status/{config => config.main} (66%) create mode 100644 .config/i3status/config.post-main-25 create mode 100644 .config/i3status/config.post-main-75 create mode 100644 .config/i3status/overrides/config.post-main-01-cmus create mode 100644 .config/i3status/overrides/config.post-main-01-docker create mode 100644 .config/i3status/overrides/config.post-main-50-desktop mode change 100644 => 100755 .local/bin/battmon.sh mode change 100644 => 100755 .local/bin/i3-config-builder diff --git a/.config/i3status/config b/.config/i3status/config.main similarity index 66% rename from .config/i3status/config rename to .config/i3status/config.main index 515076b..54d0166 100644 --- a/.config/i3status/config +++ b/.config/i3status/config.main @@ -9,21 +9,6 @@ general { color_bad = "#e74c3c" } -order += "read_file cmusctl.status" -order += "run_watch Docker" -order += "wireless _first_" -order += "ethernet _first_" -order += "load" -order += "memory" -order += "disk /" -order += "disk /home" -order += "disk /mnt/das/hdd2tb-1-main" -order += "disk /mnt/das/hdd4tb-1-main" -order += "read_file borg_backup" -order += "volume master" -order += "battery 0" -order += "tztime local" - read_file cmusctl.status { format = "%content" path = "/tmp/cmusctl.status" @@ -67,23 +52,6 @@ disk "/home" { threshold_type = "percentage_used" } -disk "/mnt/das/hdd2tb-1-main" { - format = "2TB: %percentage_used" - low_threshold = 70 - threshold_type = "percentage_used" -} - -disk "/mnt/das/hdd4tb-1-main" { - format = "4TB: %percentage_used" - low_threshold = 70 - threshold_type = "percentage_used" -} - -read_file borg_backup { - format = "B: %content" - path = "/var/tmp/last_borg_backup" -} - volume master { format = "🔊 %volume" format_muted = "🔇 %volume" diff --git a/.config/i3status/config.post-main-25 b/.config/i3status/config.post-main-25 new file mode 100644 index 0000000..2846b68 --- /dev/null +++ b/.config/i3status/config.post-main-25 @@ -0,0 +1,6 @@ +order += "wireless _first_" +order += "ethernet _first_" +order += "load" +order += "memory" +order += "disk /" +order += "disk /home" diff --git a/.config/i3status/config.post-main-75 b/.config/i3status/config.post-main-75 new file mode 100644 index 0000000..5408241 --- /dev/null +++ b/.config/i3status/config.post-main-75 @@ -0,0 +1,3 @@ +order += "volume master" +order += "battery 0" +order += "tztime local" diff --git a/.config/i3status/overrides/config.post-main-01-cmus b/.config/i3status/overrides/config.post-main-01-cmus new file mode 100644 index 0000000..26a61a2 --- /dev/null +++ b/.config/i3status/overrides/config.post-main-01-cmus @@ -0,0 +1 @@ +order += "read_file cmusctl.status" diff --git a/.config/i3status/overrides/config.post-main-01-docker b/.config/i3status/overrides/config.post-main-01-docker new file mode 100644 index 0000000..2d173fd --- /dev/null +++ b/.config/i3status/overrides/config.post-main-01-docker @@ -0,0 +1 @@ +order += "run_watch Docker" diff --git a/.config/i3status/overrides/config.post-main-50-desktop b/.config/i3status/overrides/config.post-main-50-desktop new file mode 100644 index 0000000..67be300 --- /dev/null +++ b/.config/i3status/overrides/config.post-main-50-desktop @@ -0,0 +1,20 @@ +disk "/mnt/das/hdd2tb-1-main" { + format = "2TB: %percentage_used" + low_threshold = 70 + threshold_type = "percentage_used" +} + +disk "/mnt/das/hdd4tb-1-main" { + format = "4TB: %percentage_used" + low_threshold = 70 + threshold_type = "percentage_used" +} + +read_file borg_backup { + format = "B: %content" + path = "/var/tmp/last_borg_backup" +} + +order += "disk /mnt/das/hdd2tb-1-main" +order += "disk /mnt/das/hdd4tb-1-main" +order += "read_file borg_backup" diff --git a/.installer/ignored b/.installer/ignored index d82e9a3..df4e8d7 100755 --- a/.installer/ignored +++ b/.installer/ignored @@ -4,3 +4,4 @@ ^install\.sh$ ^setup_system\.sh$ ^\.config\/i3\/overrides +^\.config\/i3status\/overrides diff --git a/.local/bin/battmon.sh b/.local/bin/battmon.sh old mode 100644 new mode 100755 diff --git a/.local/bin/i3-config-builder b/.local/bin/i3-config-builder old mode 100644 new mode 100755 index 26f268f..219a122 --- a/.local/bin/i3-config-builder +++ b/.local/bin/i3-config-builder @@ -1,16 +1,19 @@ #!/bin/bash function i3setup() { - local file dir cfg path patterns=( - "config.vars" - "config.pre-main" - "config.main" - "config.post-main" - ) - dir="$HOME/.config/i3" + local file dir cfg path \ + component="$1" \ + patterns=( + "config.vars" + "config.pre-main" + "config.main" + "config.post-main" + ) + + dir="$HOME/.config/$component" cfg="$dir/config" - echo "Building i3 config... 🔨" + echo "Building $component config... 🔨" rm "$cfg" 2>/dev/null for pattern in "${patterns[@]}"; do @@ -36,4 +39,5 @@ function i3setup() { echo } -i3setup +i3setup i3 +i3setup i3status