ChrisTitusTech / Debian-titus

Debian customizations from Chris Titus Tech
GNU General Public License v3.0
421 stars 158 forks source link

A bash script for changing Polybar ethernet module's interface to yours #51

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello.

#!/bin/bash
if=$(ip -br l | awk '$1 !~ "lo|vir|wl" { print $1}')
# echo "$if" # test the interface
defif="enp5s0"  # define default interface
# echo "$defif" # test the default interface
# sed -i "s/$defif/$if/g" dotfiles/polybar/config
sed -i "s/$defif/$if/g" .config/polybar/config.ini # testing and it works

enp5s0 is saved as default interface in the config. This bash script learns your eth interface (without lo,vir,wl) and changes enp5s0 interface to yours.

I guess polybar's config file have to named with .ini extension. I noticed this a few days ago, when I ran polybar from terminal, it said config file is outdated and have to named with .ini extension. But I have committed (and others, thanks to everyone) to config file, the config.ini file does not include my commit. What can we do in this situtation?

Resources