Clean whitespace

master
Jacopo De Simoi 4 years ago
parent 43779accbd
commit ff2aa8dd23
  1. 97
      zshrc.org

@ -54,26 +54,26 @@ to different files according to the function `org-tags-to-filenames',
defined in the previous section. defined in the previous section.
*** Include :daily:pi:android: *** Include :daily:pi:android:
First, include a script that sets a number of confidential data (e.g. API keys and such) First, include a script that sets a number of confidential data (e.g. API keys and such)
#+begin_src sh #+begin_src sh
source ~/.config/confidential.sh source ~/.config/confidential.sh
# This defines a number of env variables: # This defines a number of env variables:
# ANDROID_A3=xxxx # ANDROID_A3=xxxx
# ANDROID_BLU=xxx # ANDROID_BLU=xxx
# ANDROID_IP=xxx.xxx.xxx.xxx # ANDROID_IP=xxx.xxx.xxx.xxx
#+end_src #+end_src
Then, add helper directory to fpath Then, add helper directory to fpath
#+begin_src sh #+begin_src sh
fpath=(~/clones/zshrc/ $fpath) fpath=(~/clones/zshrc/ $fpath)
#+end_src #+end_src
*** KDE helpers :daily: *** KDE helpers :daily:
Define a number of KDE helpers. Define a number of KDE helpers.
- ~kde-current-activity~ returns the id of the current activity - ~kde-current-activity~ returns the id of the current activity
- ~kde-current-activity-name~ returns the name of the current activity - ~kde-current-activity-name~ returns the name of the current activity
The other two swap between build and src dirs on my local git checkout The other two swap between build and src dirs on my local git checkout
#+begin_src sh #+begin_src sh
kde-current-activity () { kde-current-activity () {
qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity
} }
@ -91,19 +91,15 @@ The other two swap between build and src dirs on my local git checkout
kde-cd-src () { kde-cd-src () {
cd $(pwd | sed -e "s+$kde_build_basedir+$kde_src_basedir+") cd $(pwd | sed -e "s+$kde_build_basedir+$kde_src_basedir+")
} }
#+end_src #+end_src
**** TODO See if we can use zsh expansion instead of sed **** TODO See if we can use zsh expansion instead of sed
:PROPERTIES:
:CREATED: [2021-05-01 Sat 10:24]
:END:
*** Android helpers :daily: *** Android helpers :daily:
These are various helpers to drive my current Android phone when connected to the box. These are various helpers to drive my current Android phone when connected to the box.
#+begin_src sh #+begin_src sh
run-task () { run-task () {
adb -s $ANDROID_CUR shell am broadcast --user 0 -a net.dinglish.tasker.run_task -e task "$1" adb -s $ANDROID_CUR shell am broadcast --user 0 -a net.dinglish.tasker.run_task -e task "$1"
} }
@ -142,19 +138,16 @@ These are various helpers to drive my current Android phone when connected to th
adb -s $ANDROID_BLU forward --remove tcp:8097 adb -s $ANDROID_BLU forward --remove tcp:8097
} }
setup-pi-webcam() setup-pi-webcam()
{ {
ffmpeg -i http://192.168.0.41:8080/stream/video.mjpeg -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2 ffmpeg -i http://192.168.0.41:8080/stream/video.mjpeg -map 0:v -pix_fmt yuv420p -f v4l2 /dev/video2
} }
#+end_src #+end_src
**** TODO The last bit is really pi material **** TODO The last bit is really pi material
:PROPERTIES:
:CREATED: [2021-05-01 Sat 10:35]
:END:
*** Misc helpers :pi:daily:android: *** Misc helpers :pi:daily:android:
- tmux guard - tmux guard
This function checks if we are in a tmux session before This function checks if we are in a tmux session before
executing the command; otherwise print an error and bail out executing the command; otherwise print an error and bail out
#+begin_src sh #+begin_src sh
@ -167,18 +160,18 @@ setup-pi-webcam()
fi fi
} }
#+end_src #+end_src
- wttr.in - wttr.in
#+begin_src sh #+begin_src sh
wttr() wttr()
{ {
local location=Toronto local location=Toronto
[[ $(tput cols) -le 124 ]] && local narrow=n; [[ $(tput cols) -le 124 ]] && local narrow=n;
curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-$location}?T$narrow" curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-$location}?T$narrow"
} }
#+end_src #+end_src
- This is an helper for moving a file to some other place and adding - This is an helper for moving a file to some other place and adding a
a link back to the original position. ~bl~ stands for backlink link back to the original position. ~bl~ stands for backlink
BIG FAT WARNING: this needs to specify an actual file as a destination BIG FAT WARNING: this needs to specify an actual file as a destination
(similar to ln) adding a directory would not work. (similar to ln) adding a directory would not work.
@ -190,7 +183,7 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
} }
#+end_src #+end_src
*** konsole helpers :daily: *** konsole helpers :daily:
#+begin_src sh #+begin_src sh
function set-terminal-title() { function set-terminal-title() {
echo -en "\e]2;$@\a" echo -en "\e]2;$@\a"
} }
@ -211,11 +204,10 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
function restore-konsole-title() { function restore-konsole-title() {
set-konsole-title ${previous_title} set-konsole-title ${previous_title}
} }
#+end_src #+end_src
*** emacs helpers :daily: *** emacs helpers :daily:
#+begin_src sh
#+begin_src sh
SOLARIZED="true" SOLARIZED="true"
export EMACS="/home/jacopods/.emacs.d/emacsclient-activities" export EMACS="/home/jacopods/.emacs.d/emacsclient-activities"
@ -250,10 +242,9 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
eca -e "(kill-emacs)" eca -e "(kill-emacs)"
} }
#+end_src #+end_src
*** oh-my-zsh setup :daily:pi:android: *** oh-my-zsh setup :daily:pi:android:
#+begin_src sh #+begin_src sh
# Path to your oh-my-zsh configuration. # Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh ZSH=$HOME/.oh-my-zsh
@ -354,20 +345,19 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
bindkey "\e[9;5~" backward-delete-word bindkey "\e[9;5~" backward-delete-word
autoload zmv autoload zmv
#+end_src #+end_src
*** TODO editor env variables :daily: *** TODO editor env variables :daily:
This needs to be diff'd among the versions This needs to be diff'd among the versions
#+begin_src sh #+begin_src sh
# editor stuff # editor stuff
export EDITOR="$EMACS -n" export EDITOR="$EMACS -n"
export VISUAL=$EDITOR export VISUAL=$EDITOR
export GIT_EDITOR=$EMACS export GIT_EDITOR=$EMACS
export SUDO_EDITOR=$EMACS export SUDO_EDITOR=$EMACS
#+end_src #+end_src
*** git helpers :daily: *** git helpers :daily:
#+begin_src sh #+begin_src sh
git-create-pi-remote () { git-create-pi-remote () {
REPO_NAME=$(basename "`pwd`") REPO_NAME=$(basename "`pwd`")
source ~/scripts/git-init-pi4.sh "$REPO_NAME.git" source ~/scripts/git-init-pi4.sh "$REPO_NAME.git"
@ -383,16 +373,12 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
git-current-branch () { git-current-branch () {
git status -b | head -n 1 | awk {'print $3'} git status -b | head -n 1 | awk {'print $3'}
} }
#+end_src #+end_src
**** TODO Create a script to add an arbitrary remote **** TODO Create a script to add an arbitrary remote
:PROPERTIES:
:CREATED: [2021-05-01 Sat 16:26]
:END:
*** Aliases :pi:android:daily: *** Aliases :pi:android:daily:
#+begin_src sh
#+begin_src sh
## Aliases ## Aliases
alias emacs="eca" alias emacs="eca"
alias e="eca" alias e="eca"
@ -407,14 +393,13 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
alias xou="source /home/jacopods/scripts/setwacom.sh;/home/jacopods/clones/xournalpp/build/xournalpp" alias xou="source /home/jacopods/scripts/setwacom.sh;/home/jacopods/clones/xournalpp/build/xournalpp"
alias xmp="/home/jacopods/clones/xmp-cli/src/xmp" alias xmp="/home/jacopods/clones/xmp-cli/src/xmp"
alias alexa="/home/jacopods/clones/alexa-remote-control/alexa_remote_control.sh" alias alexa="/home/jacopods/clones/alexa-remote-control/alexa_remote_control.sh"
#+end_src #+end_src
**** Aliases for the pi :pi: **** Aliases for the pi :pi:
#+begin_src sh #+begin_src sh
alias hugo="/snap/bin/hugo" alias hugo="/snap/bin/hugo"
#+end_src #+end_src
*** Pomodoro helpers :daily:pi:android: *** Pomodoro helpers :daily:pi:android:
#+begin_src sh
#+begin_src sh
termdown_bin=/home/jacopods/.local/bin/termdown termdown_bin=/home/jacopods/.local/bin/termdown
alias pomo="$termdown_bin 25m -aW -f 3x5 -c 180 -b -q 10 -s $@" alias pomo="$termdown_bin 25m -aW -f 3x5 -c 180 -b -q 10 -s $@"
@ -429,9 +414,6 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
alias kbd-android="" alias kbd-android=""
alias K=/home/jacopods/tmp/keymaps/remap-keyboard alias K=/home/jacopods/tmp/keymaps/remap-keyboard
alias quercus="falkon q.utoronto.ca"
#alias portal="chromium portal.utoronto.ca"
alias ls=' exa' alias ls=' exa'
alias sl=' exa' # a frequent typo alias sl=' exa' # a frequent typo
alias c=' cd' alias c=' cd'
@ -471,21 +453,22 @@ BIG FAT WARNING: this needs to specify an actual file as a destination
return 1 return 1
fi fi
} }
#+end_src
*** Named directories :daily:
#+begin_src sh
hash -d Papers="/home/jacopods/work/Papers" hash -d Papers="/home/jacopods/work/Papers"
hash -d Books="/home/jacopods/work/Books" hash -d Books="/home/jacopods/work/Books"
hash -d kde="/scratch/kde/src" hash -d kde="/scratch/kde/src"
hash -d kde5="/scratch/kde/src5" hash -d kde5="/scratch/kde/src5"
#+end_src
#+end_src
*** Un-tarmak bindings :daily: *** Un-tarmak bindings :daily:
#+begin_src sh #+begin_src sh
bindkey "^t" forward-char bindkey "^t" forward-char
bindkey "^[t" forward-word bindkey "^[t" forward-word
bindkey "^g" transpose-chars bindkey "^g" transpose-chars
bindkey "^[g" transpose-words bindkey "^[g" transpose-words
#+end_src #+end_src
**** TODO Rearrange this bit **** TODO Rearrange this bit
:PROPERTIES: :PROPERTIES:

Loading…
Cancel
Save