commit 732ce2ddd2ec5c379ca825fffcdaa787e3ab4baf
parent 4257ae8d99b7656e278bce161e2c5f3b9f45fbf4
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 19 May 2019 13:08:02 +0200
Do not refer to absolute paths when calling bin/ scripts
Diffstat:
5 files changed, 14 insertions(+), 50 deletions(-)
diff --git a/.local/bin/displayselect b/.local/bin/displayselect
@@ -85,7 +85,7 @@ if [ "$(echo "$screens" | wc -l)" -gt 1 ]; then
fi
# Fix feh background if screen size/arangement has changed.
-~/bin/wallpaper.sh
+wallpaper.sh
# Re-remap keys if keyboard added (for laptop bases)
#remaps
# Restart dunst to ensure proper location on screen
diff --git a/.local/bin/irc.sh b/.local/bin/irc.sh
@@ -4,7 +4,7 @@ set -e
USER=irc
HOST=adamsgaard.dk
PORT=12344
-POSTCMD="bin/tmux-irc.sh"
+POSTCMD="tmux-irc.sh"
UNAMESTR=$(uname)
if [ "$UNAMESTR" = 'Linux' ]; then
diff --git a/.local/bin/tmux-utility.sh b/.local/bin/tmux-utility.sh
@@ -20,21 +20,12 @@ then
# Create new session, name it, name the window, detach
tmux new-session -s "$SESSION" -n misc -d
- if [ "$(hostname)" = "mstdeb" ]; then
- tmux send-keys -t "$SESSION" C-m "$HOME/bin/idkfa-ssh" C-m
+ tmux send-keys -t "$SESSION" "echo $PWD" C-m
+ tmux send-keys -t "$SESSION" "mutt" C-m
- else
- tmux send-keys -t "$SESSION" "echo $PWD" C-m
- tmux send-keys -t "$SESSION" "mutt" C-m
-
- tmux split-window -h -t "$SESSION"
- tmux send-keys -t "$SESSION" "$HOME/bin/google-cloud-lamps-instance1-ssh.sh" C-m
-
- tmux select-pane -t "$SESSION":1.1
- tmux split-window -p 33 -v -t "$SESSION"
- tmux send-keys -t "$SESSION" "fortune" C-m
- #tmux send-keys -t "$SESSION" "$EDITOR $HOME/iawriter/todo.md" C-m
- fi
+ tmux select-pane -t "$SESSION":1.1
+ tmux split-window -p 33 -v -t "$SESSION"
+ tmux send-keys -t "$SESSION" "fortune" C-m
tmux new-window -t "$SESSION" -n "board"
tmux select-pane -t "$SESSION":2.1
@@ -44,27 +35,6 @@ then
tmux select-pane -t "$SESSION":3.1
tmux send-keys -t "$SESSION" "ncmpcpp" C-m
- # optionally load additional windows
- if [ "$1" = "seaice" ]; then
- tmux new-window -t "$SESSION" -n Granular
- tmux select-pane -t "$SESSION":4.1
- tmux send-keys -t "$SESSION" "cd ~/code/Granular && vim" C-m
- tmux split-window -p 33 -h -t "$SESSION"
- tmux send-keys -t "$SESSION" "cd ~/code/Granular && julia" C-m
-
- tmux new-window -t "$SESSION" -n SeaIce-exp
- tmux select-pane -t "$SESSION":5.1
- tmux send-keys -t "$SESSION" "cd ~/code/SeaIce-experiments" C-m
- tmux split-window -p 33 -h -t "$SESSION"
- tmux send-keys -t "$SESSION" \
- "cd ~/code/SeaIce-experiments && ~/bin/granular-status.sh" C-m
-
- tmux new-window -t "$SESSION" -n idkfa
- tmux select-pane -t "$SESSION":6.1
- tmux send-keys -t "$SESSION" "$HOME/bin/idkfa-ssh" C-m
- #"sshfs ad@idkfa.ucsd.edu:/home/ad ~/idkfa && ~/bin/idkfa-ssh" C-m
- fi
-
#tmux select-layout tiled
tmux select-pane -t "$SESSION":1.1
diff --git a/.local/bin/uu b/.local/bin/uu
@@ -73,7 +73,7 @@ if [ -d ~/.zgen ]; then
fi
if [ -d ~/code/fffs ]; then
announce "Upgrading fffs packages"
- [ ! -h ~/bin/fffs ] && ln -s ~/code/fffs/fffs ~/bin/fffs
+ [ ! -h ~/.local/bin/fffs ] && ln -s ~/code/fffs/fffs ~/.local/bin/fffs
fffs zsh update
fi
@@ -83,6 +83,6 @@ if [ -d ~/.vim/vim-plugs ]; then
fi
if [ "$1" = 'all' ]; then
- ssh adamsgaard.dk -t '~/bin/uu'
- ssh debvm -t '~/bin/uu'
+ ssh adamsgaard.dk -t '~/.local/bin/uu'
+ ssh debvm -t '~/.local/bin/uu'
fi
diff --git a/.local/bin/zzz b/.local/bin/zzz
@@ -1,21 +1,15 @@
-#!/bin/bash
+#!/bin/sh
# Screen locking and power suspending script.
# The laptop should be locked and suspended, while the desktop should only be
# locked.
-HOSTNAME=`hostname`
-
-#if [[ "$HOSTNAME" == 'flaptop' ]]; then
- #killall ssh
-#fi
mpc stop
-#i3lock -c 1d1f21
-$HOME/bin/xlock
+xlock
-if [[ "$HOSTNAME" == 'flaptop' ]]; then
+if [ "$(hostname)" = 'flaptop' ]; then
sudo pm-suspend-hybrid
fi
-if [[ "$HOSTNAME" == 'idkfa' ]]; then
+if [ "$(hostname)" = 'idkfa' ]; then
systemctl suspend-then-hibernate
fi