summaryrefslogtreecommitdiff
path: root/mksh/mkshfunc
blob: adb6a9108a7b11df33eeef6dd25c1718e0288ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/mksh
catclip () {
	cat "$@" | xclip -selection clipboard
}

catpass () {
	PASSWD=$(cat ~/pass.txt); echo "$PASSWD\n$PASSWD" | pass insert "$1"; unset PASSWD
}

sigdwmblocks () {
	pkill -RTMIN+$(grep "$1" ~/git/dwmblocks/config.h | awk '{print $4}' | cut -d'}' -f1) dwmblocks
}

mkcd () {
  mkdir $@ && cd $1
}

sc () {
  if [ "$1" = "" ]; then
    cd $HOME
  else
    case "$1" in
      "-l") echo "
a  - ~/.config/awesome
cpr- ~/.config/primrose
db - ~/git/dwmbar
dwm- ~/suckless/dwm
g  - ~/git
pr - ~/git/primrose
s  - ~/.local/scripts
slo- ~/suckless/slock
st - ~/suckless/st
tfd- ~/Documents/fllixel/TheFiniteDemo
tst- !tabbed -c st -w
v  - ~/.vst
vsv- ~/.local/volsv
z  - ~/.config/zsh
zx - ~/Documents/zachir.xyz
";;
      "a") cd $XDG_CONFIG_HOME/awesome/ ;;
      "cpr") cd $XDG_CONFIG_HOME/primrose/ ;;
      "dwm") cd $HOME/suckless/dwm/ ;;
      "db") cd $HOME/git/dwmbar/ ;;
      "g") cd $HOME/git/ ;;
      "pr") cd $HOME/git/primrose/ ;;
      "slo") cd $HOME/suckless/slock/ ;;
      "s") cd $HOME/.local/scripts/ ;;
      "st") cd $HOME/suckless/st/ ;;
      "tfd") cd $HOME/Documents/flixel/TheFiniteDemo/ ;;
      "tst") tabbed -c st -w ;;
      "v") cd $HOME/.vst/ ;;
      "vsv") cd $HOME/.local/volsv ;;
      "z") cd $ZDOTDIR/ ;;
      "zx") cd $HOME/Documents/zachir.xyz/ ;;
      *) cd $1 ;;
    esac
  fi
}