emote shell scripts
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Wed, 14 Apr 2021 03:18:53 +0000 (23:18 -0400)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Wed, 14 Apr 2021 03:18:53 +0000 (23:18 -0400)
.config/sxhkd/sxhkdrc
.vim/mysnippets/tex.snippets
.vimrc
Scripts/emote_format [new file with mode: 0755]
Scripts/emoter [new file with mode: 0755]
Scripts/statusbar/blocks_bat
Scripts/vish [new file with mode: 0755]

index bfaf73f..de63487 100644 (file)
@@ -33,6 +33,12 @@ super + l
 super + {Down,Left,Right}
     mpc {toggle,prev,next}
 
+super + e
+    emoter
+
+super + shift + e
+    emoter -g
+
 alt + s
     screenshot -f
 
index 6d68b16..d563262 100644 (file)
@@ -187,6 +187,14 @@ snippet ... "elpises" iA
 \ldots
 endsnippet
 
+snippet big) "Big paren" w
+\left( $1 \right) $0
+endsnippet
+
+snippet big| "Big abs" w
+\left| $1 \right| $0
+endsnippet
+
 # text
 snippet span "Span" w
 \text{span}($0)
diff --git a/.vimrc b/.vimrc
index 62c1fb4..ade2675 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -23,11 +23,6 @@ let &t_EI = "\<Esc>[2 q" "normal mode
 let &t_SI = "\<Esc>[6 q" "insert mode
 let &t_SR = "\<Esc>[4 q" "replace mode
 
-" spell check
-setlocal spell
-set spelllang=en_us
-set spellcapcheck=
-
 " conceal
 set conceallevel=2
 
@@ -44,9 +39,17 @@ let g:netrw_liststyle = 3
 let g:netrw_banner = 0
 let g:netrw_winsize = 25
 
+" spell check
+setlocal spell
+set spelllang=en_us
+set spellcapcheck=
+
+" accept first spell check fix
+map <leader>z 1z=<cr>
+
 " View whitespace
 map <leader>s :set list!<cr>
-set lcs=space:·
+set listchars=tab:▸\ ,space:·,eol:¬
 
 " colors
 hi Conceal ctermbg=Black
@@ -65,7 +68,7 @@ function! StatusModeColor()
     else
         hi StatusLine cterm=None gui=None ctermfg=black ctermbg=DarkGrey
     endif
-    
+
     return ''
 endfunction
 
diff --git a/Scripts/emote_format b/Scripts/emote_format
new file mode 100755 (executable)
index 0000000..6945e36
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# format images to be discord size
+
+mv "$1" "$1_temp" && \
+    ffmpeg -i "$1_temp" -vf scale=48:-1 "$1" && \
+    rm "$1_temp"
diff --git a/Scripts/emoter b/Scripts/emoter
new file mode 100755 (executable)
index 0000000..c7f199e
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+emote_dir="$HOME/Downloads/emotes"
+
+mode="image/png"
+[ "$1" = "-g" ] && mode="image/gif"
+
+emote_name="$(ls $emote_dir | grep -E '\.png$|\.jpeg$|\.jpg' | dmenu)"
+[ ! -f "$emote_dir/$emote_name" ] && exit 0
+
+echo "$emote_dir/$emote_name" | \
+     xargs xclip -selection clipboard -t "$mode" -i
+
+# now paste the image
+xdotool getactivewindow key ctrl+v
+xdotool getactivewindow key --delay 250 KP_Enter
+
index f785cdf..d5e8e51 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/sh
 
 bat="$(cat /sys/class/power_supply/BAT0/capacity)"
+stat="$(cat /sys/class/power_supply/BAT0/status)"
+
+status="?"
+[ "$stat" = "Charging" ] && status="C"
+[ "$stat" = "Discharging" ] && status="D"
 
 icon=""
 [ $bat -gt "13" ] && icon=""
@@ -8,4 +13,4 @@ icon=""
 [ $bat -gt "63" ] && icon=""
 [ $bat -gt "88" ] && icon=""
 
-echo "$icon $bat%"
+echo "$icon $status$bat%"
diff --git a/Scripts/vish b/Scripts/vish
new file mode 100755 (executable)
index 0000000..6587c34
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+## creates a new shell script and chmods it
+
+[ -f "$1" ] && echo "File already exists, aborting" && return 1
+
+echo '#!/bin/sh' > "$1" && chmod +x "$1" && $EDITOR "$1"