aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-05-02 16:25:36 +0300
committerJoursoir <chat@joursoir.net>2022-05-02 16:25:36 +0300
commitf5b3d8433b3ec885c96a39d614c70dc2459cf879 (patch)
treefa0bf4dff989f4cd690512d4fd2f3fd959555312
parentae44913ddd2ab8b17594f0d471f37bd8c50e8a64 (diff)
downloaddotfiles-f5b3d8433b3ec885c96a39d614c70dc2459cf879.tar.gz
dotfiles-f5b3d8433b3ec885c96a39d614c70dc2459cf879.tar.bz2
dotfiles-f5b3d8433b3ec885c96a39d614c70dc2459cf879.zip
dotconfig/polybar: set the type of interface using a environment variable
-rwxr-xr-xdotconfig/polybar/launch.sh5
-rw-r--r--dotconfig/polybar/modules5
2 files changed, 5 insertions, 5 deletions
diff --git a/dotconfig/polybar/launch.sh b/dotconfig/polybar/launch.sh
index 510d097..829d7ac 100755
--- a/dotconfig/polybar/launch.sh
+++ b/dotconfig/polybar/launch.sh
@@ -6,7 +6,10 @@ killall -9 polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
+# Set variables
+NETWORK_TYPE="wired" # or `wireless`
+
# Launch the bar
echo "---" | tee -a /tmp/mypolybar.log
-polybar main >> /tmp/mypolybar.log 2>&1 & disown
+NETWORK_TYPE=$NETWORK_TYPE polybar main >> /tmp/mypolybar.log 2>&1 & disown
echo "Bar launched..."
diff --git a/dotconfig/polybar/modules b/dotconfig/polybar/modules
index e10965f..822d875 100644
--- a/dotconfig/polybar/modules
+++ b/dotconfig/polybar/modules
@@ -93,16 +93,13 @@
[module/network]
type = internal/network
- ; Name of the network interface to display. You can get the names of the
- ; interfaces on your machine with `ip link`
- interface = enp34s0
; If no interface is specified, polybar can detect an interface of the given type.
; If multiple are found, it will prefer running interfaces and otherwise just
; use the first one found.
; Either 'wired' or 'wireless'
; New in version 3.6.0
- interface-type = wired
+ interface-type = ${env:NETWORK_TYPE:wired}
; Seconds to sleep between updates
interval = 1.0