diff --git a/applications/wemux.sh b/applications/wemux.sh old mode 100644 new mode 100755 index 05f91bb..59ba8be --- a/applications/wemux.sh +++ b/applications/wemux.sh @@ -1,7 +1,7 @@ #!/bin/sh SUDO="" -if command -v sudo 2>&1 /dev/null; then - SUDO="$(where sudo)" +if command -v sudo > /dev/null; then + SUDO="$(command -v sudo)" fi echo "Installing wemux..." test -d /usr/local/share/wemux || $SUDO git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux && $SUDO git --git-dir=/usr/local/share/wemux pull diff --git a/i3/run.sh b/i3/run.sh index f010b90..47bbefc 100755 --- a/i3/run.sh +++ b/i3/run.sh @@ -24,7 +24,7 @@ if [ "$1" = "wall" ];then #if [[ -d ~/.i3/wallOM ]];then feh --bg-scale "`shuf -n1 -e ~/.i3/wallOM/*`";else feh --bg-scale "`shuf -n1 -e ~/.i3/wall/*`";fi; #feh --bg-scale "$(shuf -n1 -e ~/.i3/wallOM/*)" #feh --bg-scale ~/.i3/image.png - feh --bg-scale $(shuf -n1 <(realpath /home/stonewareslord/owncloud/wallpaper/$(hostname))) + feh --bg-scale $(shuf -n1 <(realpath /home/stonewareslord/sync/wallpaper/$(hostname))) fi if [ "$1" = "swap" ];then python << EOF @@ -47,13 +47,14 @@ if [ "$1" = "boot" ];then /usr/bin/urxvtd -q -f -o if [ "$(hostname)" = "MMLin" ]; then xrandr --output HDMI1 --primary + xmodmap <(echo pointer = 3 2 1) elif [ "$(hostname)" = "G2" ]; then #TODO: Figure out what the display is called #xrandr --output HDMI1 --primary + xmodmap <(echo pointer = 1 2 3) fi feh --bg-scale $(shuf -n1 <(realpath /home/stonewareslord/owncloud/wallpaper/$(hostname))) xinput --set-prop 'Logitech USB Optical Mouse' 'Device Accel Constant Deceleration' 3 - xmodmap <(echo pointer = 3 2 1) $(which ck-launch-session 2>/dev/null) $(which i3) fi if [ "$1" = "screen-lock" ];then diff --git a/shells/Xresources b/shells/Xresources index 83410d1..48acda6 100644 --- a/shells/Xresources +++ b/shells/Xresources @@ -1,6 +1,7 @@ !URxvt.boldFont: -misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1 !URxvt.font: -*-*-*-*-*-*-*-*-*-*-*-*-*-* !URxvt.boldFont: -*-*-*-*-*-*-*-*-*-*-*-*-*-* +!URxvt.font: xft:Fixed:style=SemiCondensed:size=10 URxvt.urgentOnBell: true diff --git a/shells/zshrc b/shells/zshrc index b0882b6..fb69574 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -92,6 +92,7 @@ run(){ echo "Building..." >&2 gcc -Wall -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}") } +alias mtr='mtr -t' alias tg='telegram-cli -N -W' alias perm='stat -c "%a %n"' alias afci='git x ./autoformat.sh;git add --all;git commit -m "Autoformatted"' @@ -158,7 +159,7 @@ if test -f /etc/gentoo-release; then } update(){ # If this is a server computer - if [ "$(hostname|cut -b1)" = "S" ] ; then + if [ "$(hostname)" = "SGen" ] ; then echo "You're a server. Exiting" return fi @@ -205,6 +206,12 @@ alias -g nifyd=" > /dev/null 2>&1 & disown" alias -g L="2>&1|less" alias -g G='|& ag' alias -g GA='|& ag --pager less' +timer() { + for i in {1.."$1"}; do + sleep 1 + echo + done | pv -Sptels "$1" >/dev/null +} fixsh(){ sed -i -e $1"d" ~/.ssh/known_hosts } diff --git a/zsh/borg.zsh b/zsh/borg.zsh index 1c65913..5ad73aa 100644 --- a/zsh/borg.zsh +++ b/zsh/borg.zsh @@ -2,7 +2,6 @@ REPO="aw:backup/backup.borg" b-list() { if [[ -z "$1" ]]; then column -t <(borg list "$REPO") - borg list "$REPO" else borg list "$REPO"::"$1" fi @@ -13,14 +12,11 @@ b-delete() { fi } b-create() { - local BOOT="" - if (( $EUID != 0 )); then - echo -n "You aren't root, press enter to continue..." >&2 + local SUDO="" + if command -v sudo > /dev/null; then + SUDO="$(command -v sudo)" fi - if [[ ! "$(hostname)" = "SGen" ]]; then - BOOT="/boot" - fi - borg create -vpsx --compression lzma,7 --exclude-from /home/stonewareslord/syncthing/me/backup/$(hostname)/nobackup aw:backup/backup.borg::$(hostname)-$(uuidgen) / "$BOOT" + $SUDO /home/stonewareslord/syncthing/me/backup/$(hostname)/backup } b-rename() { borg rename -v "$REPO"::"$1" "$2"