Add net devices to Conky before starting
This commit is contained in:
parent
0d0defb8de
commit
a35be68780
3 changed files with 17 additions and 10 deletions
|
|
@ -3,14 +3,16 @@
|
||||||
IF_LIST=($(ip l | egrep '^[0-9]+:\s+(eth|en|wl)' | sed -r 's/^[0-9]+:\s+(\w+):.*/\1/' | sort))
|
IF_LIST=($(ip l | egrep '^[0-9]+:\s+(eth|en|wl)' | sed -r 's/^[0-9]+:\s+(\w+):.*/\1/' | sort))
|
||||||
|
|
||||||
# Add interfaces to conkyrc
|
# Add interfaces to conkyrc
|
||||||
|
if fgrep '#Network' $HOME/.conkyrc; then
|
||||||
for i in "${IF_LIST[@]}"; do
|
for i in "${IF_LIST[@]}"; do
|
||||||
if [[ "${i:0:1}" == "e" ]]; then
|
if [[ "${i:0:1}" == "e" ]]; then
|
||||||
sed -i -r "s/#Network/Wired:\${alignr}\${addr $i}\n#Network/" ~/.conkyrc
|
sed -i -r "s/#Network/Wired:\${alignr}\${addr $i}\n#Network/" $HOME/.conkyrc
|
||||||
else
|
else
|
||||||
sed -i -r "s/#Network/Wireless:\${alignr}\${addr $i}\n#Network/" ~/.conkyrc
|
sed -i -r "s/#Network/Wireless:\${alignr}\${addr $i}\n#Network/" $HOME/.conkyrc
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove '#Network' line to prevent duplicating lines if this script is re-run
|
# Remove '#Network' line to prevent duplicating lines if this script is re-run
|
||||||
sed -i -r "s/#Network//" ~/.conkyrc
|
sed -i -r "s/#Network//" $HOME/.conkyrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,4 @@ connect-to-network &
|
||||||
(sleep 5s && killall dunst) &
|
(sleep 5s && killall dunst) &
|
||||||
$HOME/.urxvt_default_res &
|
$HOME/.urxvt_default_res &
|
||||||
$HOME/.update_wallpaper &
|
$HOME/.update_wallpaper &
|
||||||
$HOME/.update_conky &
|
|
||||||
exec openbox-session
|
exec openbox-session
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,15 @@
|
||||||
setterm -blank 0 -powerdown 0
|
setterm -blank 0 -powerdown 0
|
||||||
if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then
|
if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then
|
||||||
|
# Update settings if using i3
|
||||||
if fgrep -q "i3" /proc/cmdline; then
|
if fgrep -q "i3" /proc/cmdline; then
|
||||||
sed -i -r 's/#(own_window_type override)/\1/' ~/.conkyrc
|
sed -i -r 's/#(own_window_type override)/\1/' ~/.conkyrc
|
||||||
sed -i -r 's/openbox-session/i3/' ~/.xinitrc
|
sed -i -r 's/openbox-session/i3/' ~/.xinitrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Update Conky
|
||||||
|
$HOME/.update_conky
|
||||||
|
|
||||||
|
# Start X or HW-diags
|
||||||
if ! fgrep -q "nox" /proc/cmdline; then
|
if ! fgrep -q "nox" /proc/cmdline; then
|
||||||
startx >/dev/null
|
startx >/dev/null
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue