diff --git a/.config/i3/blocks b/.config/i3/blocks index 9b3fc88..106342b 100644 --- a/.config/i3/blocks +++ b/.config/i3/blocks @@ -49,22 +49,18 @@ signal=2 # If the instance is not specified, use the interface used for default route. # The address can be forced to IPv4 or IPv6 with -4 or -6 switches. [wifi] -label= +command=$HOME/.scripts/wm/wifi.sh #instance=wlp3s0 interval=10 separator=true [iface] -label= +command=$HOME/.scripts/wm/iface.sh #instance=wlan0 #color=#00FF00 interval=10 separator=true -#[bandwidth] -#instance=eth0 -#interval=5 - # Battery indicator # # The battery instance defaults to 0. diff --git a/.config/i3/config b/.config/i3/config index 7ce3062..0016ec4 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -204,7 +204,7 @@ bindsym --release Print exec scrot -e "mv \$f $HOME/Pictures/screen_captures/" bindsym --release Shift+Print exec scrot -s -e "mv \$f $HOME/Pictures/screen_captures/" # Selection bindsym --release $mod+Print exec scrot -u -e "mv \$f $HOME/Pictures/screen_captures/" # Focused window # Touchscreen toggle -bindsym $mod+F7 exec $HOME/.scripts/wm/touchscreen.sh +bindsym $mod+F7 exec $HOME/.scripts/touchscreen.sh # Window rules smart_gaps on diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 7e8a699..9d910f3 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -89,7 +89,7 @@ alias gl="git log --graph --abbrev-commit --decorate --format=format:'%C(bold bl # Laptop alias offtouchpad='sudo rmmod i2c_hid' alias ontouchpad='sudo modprobe i2c_hid' -alias homenetwork='sudo netctl start wlan0-merlin-router5GHz' +alias nw="$HOME/.scripts/network.sh" # Other source $ZDOTDIR/.zshrc_extended diff --git a/.scripts/network.sh b/.scripts/network.sh new file mode 100644 index 0000000..488a705 --- /dev/null +++ b/.scripts/network.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +WIRELESS="wlan0" +WIRED="eth0" +PROFILE="eth0-dhcp" + +if [ -z "$1" ] || [ -z "$2" ]; then + exit; +fi + +# Enable/disable wireless +if [ "$1" = "w" ] || [ "$1" = "$WIRELESS" ]; then + if [ "$2" = "1" ]; then + sudo ip link set $WIRELESS up + else + sudo ip link set $WIRELESS down + fi +fi + +# Enable/disable wired +if [ "$1" = "e" ] || [ "$1" = "$WIRED" ]; then + + sudo netctl stop $PROFILE + sudo ip link set $WIRED down + + if [ "$2" = "1" ]; then + sudo netctl start $PROFILE + fi +fi diff --git a/.scripts/wm/touchscreen.sh b/.scripts/touchscreen.sh old mode 100644 new mode 100755 similarity index 100% rename from .scripts/wm/touchscreen.sh rename to .scripts/touchscreen.sh diff --git a/.scripts/wm/volume.sh b/.scripts/wm/volume.sh index 70f56c9..9ab2b21 100755 --- a/.scripts/wm/volume.sh +++ b/.scripts/wm/volume.sh @@ -8,7 +8,7 @@ STEP="5%" case $BLOCK_BUTTON in 1) pavucontrol ;; # left click, start sound settings 2) amixer -q -D $MIXER sset $INSTANCE 0 unmute ;; # scroll click, set 0 - 3) amixer -q -D $MIXER sset $INSTANCE toggle ;; # right click, mute/unmute + 3) amixer -q -D $MIXER sset $INSTANCE toggle ;; # right click, mute/unmute 4) amixer -q -D $MIXER sset $INSTANCE ${STEP}+ unmute ;; # scroll up, increase 5) amixer -q -D $MIXER sset $INSTANCE ${STEP}- unmute ;; # scroll down, decrease esac diff --git a/README.md b/README.md index be1f035..e18ea42 100644 --- a/README.md +++ b/README.md @@ -160,3 +160,7 @@ Mail gpg: gpg --decrypt | gpg --import gpg --search-keys + +Network: + + systemctl enable netctl-auto@wlan0.service diff --git a/etc/netctl/eth0-dhcp b/etc/netctl/eth0-dhcp new file mode 100644 index 0000000..7ae6292 --- /dev/null +++ b/etc/netctl/eth0-dhcp @@ -0,0 +1,4 @@ +Description='A basic dhcp ethernet connection' +Interface=eth0 +Connection=ethernet +IP=dhcp