summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2020-10-04 14:38:58 +0200
committerNaïm Favier <n@monade.li>2020-10-04 14:38:58 +0200
commita6a4f0eef255b9e1c0779ad05c79c5e7ae228016 (patch)
treecf9c8c5a873afe89e4edec881c8eefbf3ca180d2
parentb963eb6d1f5f31a25e939b209094f305d42e21d4 (diff)
Pie are not square. Pie are round. Cornbread are square.HEADmaster
-rw-r--r--Makefile8
-rw-r--r--bash/bashrc6
-rw-r--r--bash/functions4
-rwxr-xr-xscripts/bar50
4 files changed, 35 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 5ca8cfa..84e5944 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,14 @@
.PHONY: here
here: $(shell hostname)
-.PHONY: functor
-functor: station
+.PHONY: fu
+fu: station
.PHONY: mo
mo: station
-.PHONY: sigma
-sigma: server
+.PHONY: wo
+wo: server
.PHONY: sas
sas: login bash ascii scripts misc tmux vim git ghc x firefox
diff --git a/bash/bashrc b/bash/bashrc
index e40035a..c41b04a 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -43,11 +43,9 @@ command_not_found_handle() {
tmux=${BASH_REMATCH[2]}
session=${BASH_REMATCH[3]}
if [[ $tmux ]]; then
- mosh "$target" -- tmux -u attach${session:+ -t "$session"}
- elif (( $# == 1 )); then
- mosh "$target"
+ ssh -qt "$target" "tmux -u attach${session:+ -t ${session@Q}}"
else
- ssh -t "$target" "${@:2}"
+ ssh -q "$target" "${@:2}"
fi
else
unset command_not_found_handle
diff --git a/bash/functions b/bash/functions
index 0b00dea..88dacba 100644
--- a/bash/functions
+++ b/bash/functions
@@ -48,6 +48,10 @@ mkcd() {
mkdir -p "$@" && builtin cd "$@"
}
+mvcd() {
+ mv -i -- "$PWD" "$1" && builtin cd .
+}
+
bck() {
local f
for f do
diff --git a/scripts/bar b/scripts/bar
index 2bf5e2c..e1274be 100755
--- a/scripts/bar
+++ b/scripts/bar
@@ -153,9 +153,9 @@ xdo above -t "$(xdo id -n root)" "$(xdo id -m -n lemonbar)" &
do :; done &
# Network
- ip -o monitor link |
+ ip -o monitor address |
while
- sleep 0.3
+ sleep 0.1
parts=()
ip -o address show up scope global |
awk '!seen[$2]++ { print $2 }' |
@@ -176,9 +176,7 @@ xdo above -t "$(xdo id -n root)" "$(xdo id -m -n lemonbar)" &
parts+=("G$interface");;
esac
done
- if (( ${#parts[@]} )); then
- (IFS=:; printf 'N%s\n' "${parts[*]}")
- fi
+ (IFS=:; printf 'N%s\n' "${parts[*]}")
read -r
do :; done &
@@ -327,26 +325,28 @@ while read -rn 1 event; do
N) # is for network
IFS= read -r parts
network=
- while read -rn 1 type; do
- case $type in
- D)
- read -d : interface
- network+="%{A3:sudo systemctl restart netctl-ifplugd@$interface:}%{A}"
- ;;
- L)
- IFS=, read -d : interface ssid
- # [[ $ssid == $home_ssid ]] && ssid=
- # trunc ssid 15
- # escape ssid
- network+="%{A:le wifi:}%{A3:sudo systemctl restart netctl-auto@$interface:}%{A}%{A}"
- ;;
- G)
- read -d : interface
- network+="%{A3:sudo systemctl restart wg-quick@$interface:}%{A}"
- ;;
- esac
- done <<< "$parts:"
- pad network
+ if [[ $parts ]]; then
+ while read -rn 1 type; do
+ case $type in
+ D)
+ read -d : interface
+ network+="%{A3:sudo systemctl restart netctl-ifplugd@$interface:}%{A}"
+ ;;
+ L)
+ IFS=, read -d : interface ssid
+ # [[ $ssid == $home_ssid ]] && ssid=
+ # trunc ssid 15
+ # escape ssid
+ network+="%{A:le wifi:}%{A3:sudo systemctl restart netctl-auto@$interface:}%{A}%{A}"
+ ;;
+ G)
+ read -d : interface
+ network+="%{A3:sudo systemctl restart wg-quick@$interface:}%{A}"
+ ;;
+ esac
+ done <<< "$parts:"
+ pad network
+ fi
;;
G) # is for Gmail
mail=