diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-01-15 12:30:03 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-01-15 12:30:03 +0530 |
commit | 0c24f03e03c6d88ff9d620d308a778bcbde8dc77 (patch) | |
tree | f6d9ad8a8d2b311aabf391481aa41a8e207c91d5 | |
parent | ccd2786efc5751772a29ce82e9cb8731eea7e856 (diff) | |
download | dotfiles-0c24f03e03c6d88ff9d620d308a778bcbde8dc77.tar.gz |
More things
-rw-r--r-- | bash/.bashrc.d/99-prompt.bash | 102 | ||||
-rwxr-xr-x | bin/a | 2 | ||||
-rwxr-xr-x | bin/setup-gpg | 9 | ||||
-rwxr-xr-x | bin/zatheme.sh | 24 | ||||
-rw-r--r-- | home/.Xresources | 6 | ||||
-rw-r--r-- | home/.tmux.conf | 11 | ||||
-rw-r--r-- | prompt/git.go | 2 |
7 files changed, 89 insertions, 67 deletions
diff --git a/bash/.bashrc.d/99-prompt.bash b/bash/.bashrc.d/99-prompt.bash index 94460c1..a039e6f 100644 --- a/bash/.bashrc.d/99-prompt.bash +++ b/bash/.bashrc.d/99-prompt.bash | |||
@@ -1,52 +1,52 @@ | |||
1 | red="\e[31m" | 1 | # red="\e[31m" |
2 | grn="\e[32m" | 2 | # grn="\e[32m" |
3 | ylw="\e[33m" | 3 | # ylw="\e[33m" |
4 | cyn="\e[36m" | 4 | # cyn="\e[36m" |
5 | blu="\e[34m" | 5 | # blu="\e[34m" |
6 | prp="\e[35m" | 6 | # prp="\e[35m" |
7 | bprp="\e[35;1m" | 7 | # bprp="\e[35;1m" |
8 | gry="\e[94m" | 8 | # gry="\e[94m" |
9 | rst="\e[0m" | 9 | # rst="\e[0m" |
10 | 10 | # | |
11 | git_branch() { | 11 | # git_branch() { |
12 | [[ -d "$PWD/.git" ]] && { | 12 | # [[ -d "$PWD/.git" ]] && { |
13 | local git_status="$(git status 2> /dev/null)" | 13 | # local git_status="$(git status 2> /dev/null)" |
14 | local on_branch="On branch ([^${IFS}]*)" | 14 | # local on_branch="On branch ([^${IFS}]*)" |
15 | local on_commit="HEAD detached at ([^${IFS}]*)" | 15 | # local on_commit="HEAD detached at ([^${IFS}]*)" |
16 | status="$(git status --porcelain 2> /dev/null)" | 16 | # status="$(git status --porcelain 2> /dev/null)" |
17 | local exit="$?" | 17 | # local exit="$?" |
18 | color="" | 18 | # color="" |
19 | 19 | # | |
20 | if [[ "$exit" -eq 0 ]]; then | 20 | # if [[ "$exit" -eq 0 ]]; then |
21 | if [[ "${#status}" -eq 0 ]]; then | 21 | # if [[ "${#status}" -eq 0 ]]; then |
22 | color="${grn}" | 22 | # color="${grn}" |
23 | else | 23 | # else |
24 | color="${red}" | 24 | # color="${red}" |
25 | fi | 25 | # fi |
26 | else | 26 | # else |
27 | printf '' | 27 | # printf '' |
28 | fi | 28 | # fi |
29 | 29 | # | |
30 | 30 | # | |
31 | if [[ $git_status =~ $on_branch ]]; then | 31 | # if [[ $git_status =~ $on_branch ]]; then |
32 | local branch=${BASH_REMATCH[1]} | 32 | # local branch=${BASH_REMATCH[1]} |
33 | printf '%b' "($color$branch$rst)" | 33 | # printf '%b' "($color$branch$rst)" |
34 | elif [[ $git_status =~ $on_commit ]]; then | 34 | # elif [[ $git_status =~ $on_commit ]]; then |
35 | local commit=${BASH_REMATCH[1]} | 35 | # local commit=${BASH_REMATCH[1]} |
36 | printf '%b' "($color$commit$rst)" | 36 | # printf '%b' "($color$commit$rst)" |
37 | fi | 37 | # fi |
38 | 38 | # | |
39 | } | 39 | # } |
40 | } | 40 | # } |
41 | 41 | # | |
42 | prompt_pwd() { | 42 | # prompt_pwd() { |
43 | printf '%b' "\001${cyn}\002$(dirs +0)\001${rst}\002" | 43 | # printf '%b' "\001${cyn}\002$(dirs +0)\001${rst}\002" |
44 | } | 44 | # } |
45 | 45 | # | |
46 | rootornot() { | 46 | # rootornot() { |
47 | [[ "$(id -u)" -eq 0 ]] && | 47 | # [[ "$(id -u)" -eq 0 ]] && |
48 | printf '%b' "\001${red}\002#\001${rst}\002" | 48 | # printf '%b' "\001${red}\002#\001${rst}\002" |
49 | } | 49 | # } |
50 | 50 | ||
51 | PS1='\n$(prompt_pwd) $(git_branch)\n▲$(rootornot) ' | 51 | PS1='$(prompt) ' |
52 | PS2="> " | 52 | PS2="> " |
@@ -10,7 +10,7 @@ fi | |||
10 | 10 | ||
11 | if ! pgrep -x acme > /dev/null | 11 | if ! pgrep -x acme > /dev/null |
12 | then | 12 | then |
13 | acme -a -f /mnt/font/SFMono-Regular/14a/font $1 | 13 | ~/code/acme/o.acme -a -f /mnt/font/SFMonoLigaturized-Regular/12a/font $1 |
14 | else | 14 | else |
15 | editinacme $1 | 15 | editinacme $1 |
16 | fi | 16 | fi |
diff --git a/bin/setup-gpg b/bin/setup-gpg new file mode 100755 index 0000000..273fcea --- /dev/null +++ b/bin/setup-gpg | |||
@@ -0,0 +1,9 @@ | |||
1 | #!/bin/sh | ||
2 | # unlock gpg key on login | ||
3 | |||
4 | pw="$(ssh-askpass 'Unlock your GPG key')" | ||
5 | keygrip=$(gpg-connect-agent -q 'keyinfo --list' /bye | awk '/KEYINFO/ { print $3 }') | ||
6 | |||
7 | for k in $keygrip; do | ||
8 | echo "$pw" | /usr/local/libexec/gpg-preset-passphrase --preset $k | ||
9 | done | ||
diff --git a/bin/zatheme.sh b/bin/zatheme.sh index b6ccff1..9c4a19c 100755 --- a/bin/zatheme.sh +++ b/bin/zatheme.sh | |||
@@ -6,22 +6,22 @@ echo 'set incremental-search true | |||
6 | 6 | ||
7 | set recolor "true" | 7 | set recolor "true" |
8 | 8 | ||
9 | set default-bg "'$( get_xres color0 )'" | 9 | set default-bg "'$( xres color0 )'" |
10 | set default-fg "'$( get_xres color7 )'" | 10 | set default-fg "'$( xres color7 )'" |
11 | 11 | ||
12 | set completion-bg "'$( get_xres color0 )'" | 12 | set completion-bg "'$( xres color0 )'" |
13 | set completion-fg "'$( get_xres color7 )'" | 13 | set completion-fg "'$( xres color7 )'" |
14 | set completion-highlight-bg "'$( get_xres color4 )'" | 14 | set completion-highlight-bg "'$( xres color4 )'" |
15 | set completion-highlight-fg "'$( get_xres color7 )'" | 15 | set completion-highlight-fg "'$( xres color7 )'" |
16 | 16 | ||
17 | set statusbar-bg "'$( get_xres color4 )'" | 17 | set statusbar-bg "'$( xres color4 )'" |
18 | set statusbar-fg "'$( get_xres color0 )'" | 18 | set statusbar-fg "'$( xres color0 )'" |
19 | 19 | ||
20 | set inputbar-bg "'$( get_xres color0 )'" | 20 | set inputbar-bg "'$( xres color0 )'" |
21 | set inputbar-fg "'$( get_xres color7 )'" | 21 | set inputbar-fg "'$( xres color7 )'" |
22 | 22 | ||
23 | set recolor-darkcolor "'$( get_xres color7 )'" | 23 | set recolor-darkcolor "'$( xres color7 )'" |
24 | set recolor-lightcolor "'$( get_xres color0 )'" | 24 | set recolor-lightcolor "'$( xres color0 )'" |
25 | 25 | ||
26 | set window-height "800" | 26 | set window-height "800" |
27 | set window-width "600" | 27 | set window-width "600" |
diff --git a/home/.Xresources b/home/.Xresources index af47148..dfcfd01 100644 --- a/home/.Xresources +++ b/home/.Xresources | |||
@@ -39,3 +39,9 @@ xterm.termName: xterm-256color | |||
39 | xterm.vt100.translations: #override \n\ | 39 | xterm.vt100.translations: #override \n\ |
40 | Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ | 40 | Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ |
41 | Ctrl Shift <Key>V: insert-selection(CLIPBOARD) | 41 | Ctrl Shift <Key>V: insert-selection(CLIPBOARD) |
42 | |||
43 | ! ssh-askpass | ||
44 | *Dialog.font: SF Mono:style=Regular:size=12:antialias=true | ||
45 | *shadowThickness: 0 | ||
46 | *borderWidth: 0 | ||
47 | *?.background: rgb:f4/f4/f4 | ||
diff --git a/home/.tmux.conf b/home/.tmux.conf index 5d4499f..445bac6 100644 --- a/home/.tmux.conf +++ b/home/.tmux.conf | |||
@@ -21,6 +21,10 @@ bind -n M-n select-pane -D | |||
21 | bind -n M-e select-pane -U | 21 | bind -n M-e select-pane -U |
22 | bind -n M-y select-pane -L | 22 | bind -n M-y select-pane -L |
23 | bind -n M-o select-pane -R | 23 | bind -n M-o select-pane -R |
24 | bind -n M-Up resize-pane -U 5 | ||
25 | bind -n M-Down resize-pane -D 5 | ||
26 | bind -n M-Left resize-pane -L 5 | ||
27 | bind -n M-Right resize-pane -R 5 | ||
24 | 28 | ||
25 | # window binds | 29 | # window binds |
26 | bind -n C-M-y previous-window | 30 | bind -n C-M-y previous-window |
@@ -30,6 +34,9 @@ bind-key v new-window -c "#{pane_current_path}" | |||
30 | bind-key s choose-session | 34 | bind-key s choose-session |
31 | bind-key ) swap-window -t +2 | 35 | bind-key ) swap-window -t +2 |
32 | bind-key ( swap-window -t -1 | 36 | bind-key ( swap-window -t -1 |
37 | |||
38 | unbind -T copy-mode MouseDragEnd1Pane | ||
39 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard" | ||
33 | bind-key -T copy-mode-vi v send-keys -X begin-selection | 40 | bind-key -T copy-mode-vi v send-keys -X begin-selection |
34 | bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c " | 41 | bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c " |
35 | bind-key -T copy-mode-vi r send-keys -X rectangle-toggle | 42 | bind-key -T copy-mode-vi r send-keys -X rectangle-toggle |
@@ -42,8 +49,8 @@ bind-key u display-popup -E "firefox -new-tab $(xurls)" | |||
42 | set-option -g status-position top | 49 | set-option -g status-position top |
43 | 50 | ||
44 | # statusline hide / unhide | 51 | # statusline hide / unhide |
45 | bind -n M-down set -q status off | 52 | bind -n C-down set -q status off |
46 | bind -n M-up set -q status on | 53 | bind -n C-up set -q status on |
47 | bind P paste-buffer | 54 | bind P paste-buffer |
48 | 55 | ||
49 | bind E command-prompt -p "Command:" \ | 56 | bind E command-prompt -p "Command:" \ |
diff --git a/prompt/git.go b/prompt/git.go index 59b11b5..ad56af7 100644 --- a/prompt/git.go +++ b/prompt/git.go | |||
@@ -50,6 +50,6 @@ func gitStatus(repo *git.Repository) string { | |||
50 | if n != 0 { | 50 | if n != 0 { |
51 | return "×" | 51 | return "×" |
52 | } else { | 52 | } else { |
53 | return "・" | 53 | return "•" |
54 | } | 54 | } |
55 | } | 55 | } |