aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnirudh Oppiliappan <x@icyphox.sh>2022-01-15 12:30:03 +0530
committerAnirudh Oppiliappan <x@icyphox.sh>2022-01-15 12:30:03 +0530
commit0c24f03e03c6d88ff9d620d308a778bcbde8dc77 (patch)
treef6d9ad8a8d2b311aabf391481aa41a8e207c91d5
parentccd2786efc5751772a29ce82e9cb8731eea7e856 (diff)
downloaddotfiles-0c24f03e03c6d88ff9d620d308a778bcbde8dc77.tar.gz
More things
-rw-r--r--bash/.bashrc.d/99-prompt.bash102
-rwxr-xr-xbin/a2
-rwxr-xr-xbin/setup-gpg9
-rwxr-xr-xbin/zatheme.sh24
-rw-r--r--home/.Xresources6
-rw-r--r--home/.tmux.conf11
-rw-r--r--prompt/git.go2
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 @@
1red="\e[31m" 1# red="\e[31m"
2grn="\e[32m" 2# grn="\e[32m"
3ylw="\e[33m" 3# ylw="\e[33m"
4cyn="\e[36m" 4# cyn="\e[36m"
5blu="\e[34m" 5# blu="\e[34m"
6prp="\e[35m" 6# prp="\e[35m"
7bprp="\e[35;1m" 7# bprp="\e[35;1m"
8gry="\e[94m" 8# gry="\e[94m"
9rst="\e[0m" 9# rst="\e[0m"
10 10#
11git_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#
42prompt_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#
46rootornot() { 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
51PS1='\n$(prompt_pwd) $(git_branch)\n▲$(rootornot) ' 51PS1='$(prompt) '
52PS2="> " 52PS2="> "
diff --git a/bin/a b/bin/a
index d7c03b8..025354d 100755
--- a/bin/a
+++ b/bin/a
@@ -10,7 +10,7 @@ fi
10 10
11if ! pgrep -x acme > /dev/null 11if ! pgrep -x acme > /dev/null
12then 12then
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
14else 14else
15 editinacme $1 15 editinacme $1
16fi 16fi
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
4pw="$(ssh-askpass 'Unlock your GPG key')"
5keygrip=$(gpg-connect-agent -q 'keyinfo --list' /bye | awk '/KEYINFO/ { print $3 }')
6
7for k in $keygrip; do
8 echo "$pw" | /usr/local/libexec/gpg-preset-passphrase --preset $k
9done
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
7set recolor "true" 7set recolor "true"
8 8
9set default-bg "'$( get_xres color0 )'" 9set default-bg "'$( xres color0 )'"
10set default-fg "'$( get_xres color7 )'" 10set default-fg "'$( xres color7 )'"
11 11
12set completion-bg "'$( get_xres color0 )'" 12set completion-bg "'$( xres color0 )'"
13set completion-fg "'$( get_xres color7 )'" 13set completion-fg "'$( xres color7 )'"
14set completion-highlight-bg "'$( get_xres color4 )'" 14set completion-highlight-bg "'$( xres color4 )'"
15set completion-highlight-fg "'$( get_xres color7 )'" 15set completion-highlight-fg "'$( xres color7 )'"
16 16
17set statusbar-bg "'$( get_xres color4 )'" 17set statusbar-bg "'$( xres color4 )'"
18set statusbar-fg "'$( get_xres color0 )'" 18set statusbar-fg "'$( xres color0 )'"
19 19
20set inputbar-bg "'$( get_xres color0 )'" 20set inputbar-bg "'$( xres color0 )'"
21set inputbar-fg "'$( get_xres color7 )'" 21set inputbar-fg "'$( xres color7 )'"
22 22
23set recolor-darkcolor "'$( get_xres color7 )'" 23set recolor-darkcolor "'$( xres color7 )'"
24set recolor-lightcolor "'$( get_xres color0 )'" 24set recolor-lightcolor "'$( xres color0 )'"
25 25
26set window-height "800" 26set window-height "800"
27set window-width "600" 27set 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
39xterm.vt100.translations: #override \n\ 39xterm.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
21bind -n M-e select-pane -U 21bind -n M-e select-pane -U
22bind -n M-y select-pane -L 22bind -n M-y select-pane -L
23bind -n M-o select-pane -R 23bind -n M-o select-pane -R
24bind -n M-Up resize-pane -U 5
25bind -n M-Down resize-pane -D 5
26bind -n M-Left resize-pane -L 5
27bind -n M-Right resize-pane -R 5
24 28
25# window binds 29# window binds
26bind -n C-M-y previous-window 30bind -n C-M-y previous-window
@@ -30,6 +34,9 @@ bind-key v new-window -c "#{pane_current_path}"
30bind-key s choose-session 34bind-key s choose-session
31bind-key ) swap-window -t +2 35bind-key ) swap-window -t +2
32bind-key ( swap-window -t -1 36bind-key ( swap-window -t -1
37
38unbind -T copy-mode MouseDragEnd1Pane
39bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
33bind-key -T copy-mode-vi v send-keys -X begin-selection 40bind-key -T copy-mode-vi v send-keys -X begin-selection
34bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c " 41bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c "
35bind-key -T copy-mode-vi r send-keys -X rectangle-toggle 42bind-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)"
42set-option -g status-position top 49set-option -g status-position top
43 50
44# statusline hide / unhide 51# statusline hide / unhide
45bind -n M-down set -q status off 52bind -n C-down set -q status off
46bind -n M-up set -q status on 53bind -n C-up set -q status on
47bind P paste-buffer 54bind P paste-buffer
48 55
49bind E command-prompt -p "Command:" \ 56bind 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}