dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 45a8af36ad4424f111d8ed536729f7dfb3bcefd0
parent 9c3b3edf02e6d706e9d8801e3f7e6e9826958bbe
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Tue, 21 Jan 2020 21:01:56 +0000

minor stuff ya know

Diffstat:
A.Xresources | 44++++++++++++++++++++++++++++++++++++++++++++
M.bashrc | 6------
M.config/dfm/config | 2+-
M.config/fish/config.fish | 62++++++++++++++++++++++++++++++--------------------------------
M.config/i3/config | 68+++++++++++++++++++++++++++++++++++++++++++-------------------------
M.config/irssi/config | 4++--
M.config/picom/config | 13++++++++++++-
M.ls_colors | 2+-
A.scripts/bin/display/fehffile | 3+++
A.scripts/bin/display/wallblur | 48++++++++++++++++++++++++++++++++++++++++++++++++
M.scripts/bin/dmenu/dfm | 6+++++-
M.scripts/bin/dmenu/dmpv | 7++++++-
A.scripts/bin/i3/makegrid | 15+++++++++++++++
M.scripts/bin/i3/mpvlisten | 4++--
A.scripts/bin/i3/scratcher | 13+++++++++++++
M.scripts/bin/misc/hmpv | 2+-
M.scripts/bin/misc/rmpv | 1-
A.scripts/bin/misc/slock_mod | 13+++++++++++++
A.scripts/bin/misc/terminalimg | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.scripts/bin/misc/urlhand | 35+++++++++++++++++++++++++++++++++++
M.scripts/i3blocks/title | 2+-
A.test | 0
M.vimrc | 15+++++++++++++--
M.xinitrc | 1-
24 files changed, 358 insertions(+), 78 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -0,0 +1,44 @@ +! +! .Xresources +! Created by Hayden Hamilton +! +! haydenvh.com +! Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 .licenses/gplv2.license +! + +! special +*.foreground: #1e5eb3 +*.background: #090711 +*.cursorColor: #1e5eb3 + +! black +*.color0: #141726 +*.color8: #dc6f3c + +! red +*.color1: #24283c +*.color9: #4747e1 + +! green +*.color2: #31364b +*.color10: #892b2b + +! yellow +*.color3: #40445c +*.color11: #a1a1d9 + +! blue +*.color4: #575b72 +*.color12: #1f8a27 + +! magenta +*.color5: #777b8e +*.color13: #a84b8d + +! cyan +*.color6: #a3a6b3 +*.color14: #434343 + +! white +*.color7: #c7cad9 +*.color15: #3ab475 diff --git a/.bashrc b/.bashrc @@ -55,12 +55,6 @@ image(){ mpv $* --vo=drm --pause } -##C Compilation -comp(){ - out="$1" - gcc $2 $3 $4 $5 $6 $7 $8 $9 -o ~/.scripts/bin/c/"$out" -} - ##Random hostfile() { if [ "$(echo "$1" | sed 's/ /qqq/g' | awk '/qqq/')" == "" ] diff --git a/.config/dfm/config b/.config/dfm/config @@ -1,4 +1,3 @@ -DFM_DOT="0" DFM_USE_HH_PATCH="1" DFM_FILETYPE_PNG="feh" DFM_FILETYPE_JPEG="feh" @@ -14,3 +13,4 @@ DFM_FILETYPE_OGG="mpv" DFM_FILETYPE_SH="vim" DFM_FILETYPE_HTML="w3m" DFM_FILETYPE_MD="vim" +DFM_DOT="0" diff --git a/.config/fish/config.fish b/.config/fish/config.fish @@ -1,6 +1,6 @@ #Prompt function fish_prompt - set STRING (pwd | sed "s~$HOME~\~~g" | tr "/" "\n" | cut -c 1-5 | tr "\n" "/") + set STRING (pwd | sed "s~$HOME~\~~g" | tr "/" "\n" | cut -c 1-3 | tr "\n" "/") tput setaf 2 printf "[" tput setaf 3 @@ -18,32 +18,28 @@ function fish_prompt end #Aliases -function vi; vim $argv; end -function xi; -sudo xbps-install $argv; cleancache; end -function xq; sudo xbps-query $argv; cleancache; end -function xr; sudo xbps-remove $argv; cleancache; end -function irssi; irssi --config ~/.config/irssi/config $argv; end -function pipes; command pipes -R -r 10000 -c 10 -c 11 -c 12 -c 13 -c 14 -c 15 -s 15 $argv; end -function clock; tty-clock; end -function ytdl; youtube-dl --add-metadata -ic $argv; end -function ytdla; youtube-dl --add-metadata -xic $argv; end -function ls; command ls --color $argv; end -function map; telnet mapscii.me; end -function tetris; ssh netris.rocketnine.space; end -function calcurse; command calcurse -D ~/.config/calcurse/; end -function irssi; command irssi --home ~/.config/irssi/ -n hayden; ircgetpass; end -function sleep; sudo zzz; end -function hibernate; sudo ZZZ; end -function urxvtrestart; xrdb -merge ~/.Xdefaults; xrdb -merge ~/.Xresources; exec urxvtc; end -function rmst; bash ~/.scripts/random/gnulinux.sh; end -function fff; bash ~/.config/fff/config; end -function python; python3; end -function vimb; command vimb --no-maximize; end -function cleancache; sudo xbps-remove -O; end -function dots; git push origin master -f; git push github master -f; end -function dotsadd; bash ~/.gitaddlist; end -function clock; tty-clock -s -c -C 7; end +abbr -a -g vi vim $argv +abbr -a -g xi sudo xbps-install +abbr -a -g xq sudo xbps-query +abbr -a -g xr sudo xbps-remove +abbr -a -g irssi irssi --config ~/.config/irssi/config +abbr -a -g pipes pipes -R -r 10000 -c 10 -c 11 -c 12 -c 13 -c 14 -c 15 -s 15 $argv +abbr -a -g clock tty-clock +abbr -a -g ytdl youtube-dl --add-metadata -ic +abbr -a -g ytdla youtube-dl --add-metadata -xic +abbr -a -g ls ls --color +abbr -a -g map telnet mapscii.me +abbr -a -g tetris ssh netris.rocketnine.space +abbr -a -g calcurse calcurse -D ~/.config/calcurse/ +abbr -a -g irssi irssi --home ~/.config/irssi/ -n haydenh +abbr -a -g sleep sudo zzz +abbr -a -g hibernate sudo ZZZ +abbr -a -g rmst bash ~/.scripts/random/gnulinux.sh +abbr -a -g fff bash ~/.config/fff/config +abbr -a -g python python3 +abbr -a -g vimb vimb --no-maximize +abbr -a -g cleancache sudo xbps-remove -O +abbr -a -g clock tty-clock -s -c -C 7 #Set fish colors set fish_color_command a84b8d @@ -55,10 +51,12 @@ set -x LS_COLORS "di=35:fi=0:ln=33:ex=91;01:*.sh=91:*.html=92:*.css=97:*.md=97:* #Frame buffer -function video; mpv $argv --vo=drm; end -function music; mpv $argv --vo=drm --pause; end - -##Auto tar -function at; bash ~/.autotar; end +abbr -a -g video mpv $argv --vo=drm +abbr -a -g music mpv $argv --vo=drm --pause fish_vi_key_bindings + +function hostfile + set name (curl -F "file=@$argv" http://0x0.st) + echo "Your file has been hosted at $name" +end diff --git a/.config/i3/config b/.config/i3/config @@ -16,6 +16,7 @@ font pango:monospace 8 set $mod Mod4 set $terminal st set $browser vimb +set $alt mod1 exec export BROWSER="surf" exec export EDITOR="vim" exec_always export SUDO_ASKPASS="$HOME/.scripts/bin/dmenu/daskpass" @@ -58,10 +59,12 @@ bar{ background $background statusline #eeddee focused_workspace $background #ffffff #000000 - active_workspace $background $yellow2 #000000 - inactive_workspace $background $yellow2 #000000 + active_workspace $background $background #ffffff + inactive_workspace $background $background #ffffff urgent_workspace $background #ffffff #990000 } + #bindsym button1 nop + tray_output none } bar{ font pango:monospace 7 @@ -75,24 +78,22 @@ bar{ colors { background $background statusline #eeddee - focused_workspace $background #ffffff #000000 - active_workspace $background $yellow2 #000000 - inactive_workspace $background $yellow2 #000000 - urgent_workspace $background #ffffff #990000 } + #bindsym button1 nop + tray_output none } ##Setting workspace names -set $ws1 "1.WWW" -set $ws2 "2.DEV" -set $ws3 "3.DEV" -set $ws4 "4.DEV" -set $ws5 "5.DEV" -set $ws6 "6.SYS" -set $ws7 "7.SYS" -set $ws8 "8.IRC" -set $ws9 "9.GFX" -set $ws10 "10.MSC" +set $ws1 "[1.WWW]" +set $ws2 "[2.DEV]" +set $ws3 "[3.DEV]" +set $ws4 "[4.DEV]" +set $ws5 "[5.DEV]" +set $ws6 "[6.SYS]" +set $ws7 "[7.SYS]" +set $ws8 "[8.IRC]" +set $ws9 "[9.GFX]" +set $ws10 "[0.MSC]" ##Change workspace bindsym $mod+1 workspace $ws1 @@ -151,6 +152,8 @@ workspace "TEMPORARY" output VGA1 assign [class="Gimp"] $ws9 assign [class="Vimb"] $ws1 assign [class="URxvt" instance="irssi"] $ws8 + +##Window rule for_window [class="URxvt" instance="fileman"] floating enable; sticky enable ##Movement bindings @@ -184,19 +187,19 @@ bindsym $mod+shift+q kill bindsym $mod+w exec rfeh ~/.wallpapers/ bindsym $mod+shift+w exec fehffile ~/.wall bindsym $mod+ctrl+w exec wallblur true -bindsym $mod+mod1+w exec fehffile ~/.cache/rfeh/prev +bindsym $mod+$alt+w exec fehffile ~/.cache/rfeh/prev bindsym $mod+e exec $terminal -e dvimedit bindsym $mod+shift+e exec $terminal -e dvimedit -bindsym $mod+r exec $terminal -name fileman -e dfm fm +bindsym $mod+r exec $terminal -n fileman -e dfm fm bindsym $mod+shift+r restart bindsym $mod+t layout tabbed bindsym $mod+shift+t layout toggle split -bindsym $mod+y exec $terminal -name irssi -e irssi --home ~/.config/irssi/ +bindsym $mod+y exec $terminal -n irssi -e irssi --home ~/.config/irssi/ bindsym $mod+shift+y exec dircgetpass bindsym $mod+u exec wallvar ~/.wallpapers/ 60; exec dunstify "Auto-changing wallpapers on." bindsym $mod+shift+u exec killall wallvar; exec dunstify "Auto-changing wallpapers off." -bindsym $mod+i exec $terminal -name fff -e ffflaunch -bindsym $mod+shift+i exec $terminal -name fff -e ffflaunch +bindsym $mod+i exec $terminal -n fileman -e ffflaunch +bindsym $mod+shift+i exec $terminal -n fileman -e ffflaunch bindsym $mod+o exec makegrid $TERMINAL ##bindsym $mod+super+o bindsym $mod+p focus parent @@ -222,8 +225,8 @@ bindsym $mod+v workspace "TEMPORARY" bindsym $mod+shift+v exec killall mpv bindsym $mod+b exec vimb --no-maximize bindsym $mod+shift+b exec dmpvurl /tmp/mpv-socket /tmp/mpv-socket2 -bindsym $mod+n exec dmpv music /tmp/mpv-socket /tmp/mpv-socket2 --no-video -bindsym $mod+shift+n exec dmpv videos /tmp/mpv-socket2 /tmp/mpv-socket +##bindsym $mod+n +##bindsym $mod+shift+n bindsym $mod+m exec dmount bindsym $mod+shift+m exec dumount @@ -262,9 +265,9 @@ bindsym XF86MonBrightnessUp exec brightnessctl --quiet set +5% bindsym XF86MonBrightnessDown exec brightnessctl --quiet set -5% ##Function bindings (hmpv) -bindsym F8 exec dmpv videos /tmp/mpv-socket2 /tmp/mpv-socket +bindsym F8 exec dmpv videos /tmp/mpv-socket2 /tmp/mpv-socket --fs fuzz bindsym shift+F8 exec rmpv videos 50 -bindsym F9 exec dmpv music /tmp/mpv-socket /tmp/mpv-socket2 --no-video +bindsym F9 exec dmpv music /tmp/mpv-socket /tmp/mpv-socket2 --no-video fuzz bindsym shift+F9 exec rmpv music 50 bindsym F10 exec hmpv back /tmp/mpv-socket bindsym shift+F10 exec hmpv prev /tmp/mpv-socket @@ -275,6 +278,21 @@ bindsym shift+F12 exec hmpv next /tmp/mpv-socket bindsym Home exec brightnessctl s +500000 bindsym End exec brightnessctl s 500000- +###Same, but for 60% keyboards +bindsym $mod+ctrl+y exec dmpv videos /tmp/mpv-socket2 /tmp/mpv-socket --fs fuzz +bindsym $mod+$alt+y exec rmpv videos 50 +bindsym $mod+ctrl+u exec dmpv music /tmp/mpv-socket /tmp/mpv-socket2 --no-video fuzz +bindsym $mod+$alt+u exec rmpv music 50 +bindsym $mod+ctrl+i exec hmpv back /tmp/mpv-socket +bindsym $mod+$alt+i exec hmpv prev /tmp/mpv-socket +bindsym $mod+ctrl+o exec hmpv toggle /tmp/mpv-socket; exec hmpv toggle /tmp/mpv-socket2 +bindsym $mod+$alt+o exec hmpv quit /tmp/mpv-socket +bindsym $mod+ctrl+p exec hmpv forward /tmp/mpv-socket +bindsym $mod+$alt+p exec hmpv next /tmp/mpv-socket +bindsym $mod+ctrl+t exec brightnessctl s +500000 +bindsym $mod+$alt+t exec brightnessctl s 500000- + + ##i3 related commands focus_follows_mouse no mouse_warping none diff --git a/.config/irssi/config b/.config/irssi/config @@ -22,7 +22,7 @@ chatnets = { }; channels = ( { name = "#voidlinux"; chatnet = "Freenode"; autojoin = "Yes"; }, - { name = "#haydenh"; chatnet = "Freenode"; autojoin = "Yes"; }, + { name = "#staw"; chatnet = "Freenode"; autojoin = "Yes"; }, { name = "#freenode"; chatnet = "Freenode"; autojoin = "No"; }, { name = "#irssi"; chatnet = "Freenode"; autojoin = "No"; }, { name = "#neomutt"; chatnet = "Freenode"; autojoin = "Yes"; }, @@ -271,7 +271,7 @@ settings = { core = { real_name = "haydenh"; user_name = "haydenh"; - nick = "hayden"; + nick = "haydenh"; recode_transliterate = "no"; timestamp_format = "%H:%M:%S"; }; diff --git a/.config/picom/config b/.config/picom/config @@ -5,12 +5,23 @@ # Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license # shadow=true -shadow-radius=25 +shadow-radius=32.5 shadow-offset-x=-20 shadow-offset-y=-20 +shadow-exclude = [ + "class_g ?= 'i3bar'", + "class_g ?= 'i3'", +]; + opacity-rule = [ "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + "100:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_FULLSCREEN'", + "100:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_FULLSCREEN'", + "100:_NET_WM_STATE@[2]:32a *= '_NET_WM_STATE_FULLSCREEN'", + "100:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_FULLSCREEN'", + "100:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_FULLSCREEN'", + "100:_NET_WM_STATE@[5]:32a *= '_NET_WM_STATE_FULLSCREEN'", "87:class_g ?= 'urxvt' && !focused", "84:class_g ?= 'urxvt' && focused", "87:class_g ?= 'st-256color' && !focused", diff --git a/.ls_colors b/.ls_colors @@ -1,2 +1,2 @@ #!/bin/bash -export LS_COLORS="di=35:fi=0:ln=33:ex=91;01:*.sh=91:*.html=92:*.css=97:*.md=97:*.yml=93:*.c=94:*.h=94:*.h.orig=94;01:*.h.rej=94;01:*.mk=96:*LICENSE=90:*Makefile=90:*README=97:*.c.orig=94;01:*.c.rej=94;01:*.png=95:*.jpg=95:*.heic=95:*.heif=95:*.mp3=95;01:*opus=.95;01:*.m4a=95;01:*.flac=95;01:*.wav=95;01:*.mp4=95;04:*.mkv=95;04" +export LS_COLORS="di=35:fi=0:ln=33:ex=91;01:*.sh=91:*.html=92:*.css=97:*.md=97:*.yml=93:*.c=94:*.h=94:*.h.orig=94;01:*.h.rej=94;01:*.mk=96:*LICENSE=90:*Makefile=90:*README=97:*.c.orig=94;01:*.c.rej=94;01:*.png=95:*.jpg=95:*.heic=95:*.heif=95:*.mp3=95;01:*opus=.95;01:*.m4a=95;01:*.flac=95;01:*.wav=95;01:*.mp4=95;04:*.mkv=95;04:*.webm=95;04" diff --git a/.scripts/bin/display/fehffile b/.scripts/bin/display/fehffile @@ -0,0 +1,3 @@ +#!/bin/bash +files=$(cat $1 | tr " " "\n" | sed "s~^~--bg-fill ~g" | tr "\n" " ") +feh $files diff --git a/.scripts/bin/display/wallblur b/.scripts/bin/display/wallblur @@ -0,0 +1,48 @@ +#!/bin/bash +# +# wallblur +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 haydenh.gitlab.io/p/gplv2.license + +cachebool="$1" +if [ "$(echo $1 | awk '/help/ {print $0}')" != "" ] +then + echo 'wallblur ["true" for file caching] + +Written by Hayden Hamilton <hayden@haydenvh.com>' + exit 0 +fi +donorm(){ + convert $file -colors 2 $1 + files+="$1 " +} +input=$(cat ~/.cache/rfeh/prev) +count=0 +files="" +for file in $input +do + count=$(($count+1)) + if [ "$cachebool" == "true" ] + then + file2=$(echo $file | sed "s~$HOME~$HOME/.cache/rfeh~g") + if [ -f $file2 ] + then + files+="$file2 " + else + file3=$(echo $file2 | sed 's~/~/ ~g' | awk 'sub(FS $NF,x)' | sed 's~/ ~/~g') + if [ -d $file3 ] + then + echo > /dev/null + else + mkdir -p $file3 + fi + donorm "$file2" + fi + else + donorm "/tmp/screen${count}.png" + fi +done +files=$(echo "$files" | tr " " "\n" | sed "s~^~--bg-fill ~g" | tr "\n" " ") +feh $files diff --git a/.scripts/bin/dmenu/dfm b/.scripts/bin/dmenu/dfm @@ -29,6 +29,7 @@ Written by Hayden Hamilton <haydenvh.com>" exit 0 fi forn1="$1" +lsforce="$3" if [ "$1" == "" ] then export forn1="fm" @@ -106,7 +107,10 @@ dooutput(){ } getdot(){ - if [ "$DFM_DOT" == "1" ] + if [ "$lsforce" != "" ] + then + lscommand="$lsforce" + elif [ "$DFM_DOT" == "1" ] then lscommand="ls -A" elif [ "$DFM_DOT" == "0" ] diff --git a/.scripts/bin/dmenu/dmpv b/.scripts/bin/dmenu/dmpv @@ -2,5 +2,10 @@ dmenu="dmenu" . $HOME/.dmenurc +if [ "$5" = "fuzz" ] +then + com="find" +fi + hmpv pause $3 -dfm "mpv --input-ipc-server $2 $4" ~/$1 +dfm "mpv --input-ipc-server $2 $4" ~/$1 $com diff --git a/.scripts/bin/i3/makegrid b/.scripts/bin/i3/makegrid @@ -0,0 +1,15 @@ +#!/bin/bash +term="$1" + +i3-msg "split h" +i3-msg "exec $term" +i3-msg "exec $term" +sleep 0.5 +i3-msg "split v" +i3-msg "exec $term" +sleep 0.5 +i3-msg "focus left" +sleep 0.1 +i3-msg "split v" +sleep 0.1 +i3-msg "exec $term" diff --git a/.scripts/bin/i3/mpvlisten b/.scripts/bin/i3/mpvlisten @@ -11,14 +11,14 @@ do then if [ "$aplay" == "false" ] then - hmpv pause $socket2 + hmpv pause $socket2 2>/dev/null >/dev/null apause="false" aplay="true" fi else if [ "$apause" == "false" ] then - hmpv unpause $socket2 + hmpv unpause $socket2 2>/dev/null >/dev/null apause="true" aplay="false" fi diff --git a/.scripts/bin/i3/scratcher b/.scripts/bin/i3/scratcher @@ -0,0 +1,13 @@ +#!/bin/bash +i3msg(){ + i3-msg -s $(i3 --get-socketpath) "$@" +} +i3msg "floating toggle" +sleep 0.1 +i3msg "resize set 1000 500" +i3msg "border pixel 2" +i3msg "sticky toggle" +sleep 0.1 +i3msg "move position center" +sleep 0.5 +i3msg "move scratchpad" diff --git a/.scripts/bin/misc/hmpv b/.scripts/bin/misc/hmpv @@ -15,7 +15,7 @@ unpause() { echo '{ "command": ["set_property", "pause", false] }' | socat - $socket > /dev/null } getstate() { - stateraw=$(echo '{ "command": ["get_property", "pause"] }' | socat - $socket | tr '{":0,}' ' ' | awk '// {print $2}') + stateraw=$(echo '{ "command": ["get_property", "pause"] }' | socat - $socket 2>/dev/null | tr '{":0,}' ' ' | awk '// {print $2}') if [ "$stateraw" == "true" ] then state="paused" diff --git a/.scripts/bin/misc/rmpv b/.scripts/bin/misc/rmpv @@ -36,4 +36,3 @@ randomize() { allfiles files=$(for i in `seq $count`; do randomize; done) mpv --input-ipc-server=/tmp/mpv-socket $files - diff --git a/.scripts/bin/misc/slock_mod b/.scripts/bin/misc/slock_mod @@ -0,0 +1,13 @@ +#!/bin/bash +socket1="$1" +socket2="$2" + +echo "dmpv/rmpv: $(hmpv state $socket1)" > ~/.cache/socket; echo "dmpvurl: $(hmpv state $socket2)" >> ~/.cache/socket +hmpv pause $socket1; sleep 0.1; hmpv pause $socket2; sleep 0.1; hmpv pause $socket2; sleep 0.1; hmpv pause $socket2 +slock -m "Locked at $(date) by $USER - what? You thought I would let you in... Fool." + +state=$(cat ~/.cache/socket | awk '/:/') +state1=$(echo "$state" | head -n -1 | awk '{print $2}') +state2=$(echo "$state" | tail +2 | awk '{print $2}') +[ "$state1" == "playing" ] && hmpv unpause $socket1 +[ "$state2" == "playing" ] && hmpv unpause $socket2 diff --git a/.scripts/bin/misc/terminalimg b/.scripts/bin/misc/terminalimg @@ -0,0 +1,70 @@ +#!/bin/bash + +[ -f /usr/lib/w3m/w3mimgdisplay ] && w3m="/usr/lib/w3m/w3mimgdisplay" +[ -f /usr/loca/lib/w3m/w3mimgdisplay ] && w3m="/usr/local/lib/w3m/w3mimgdisplay" + +display(){ + clear + image="$1" + IFS=$'\n' read -d "" -ra win_info \ + < <(xdotool getactivewindow getwindowgeometry --shell) + + export "${win_info[@]}" &>/dev/null + + read -r img_width img_height < <("$w3m" <<< "5;$image") + + ((HEIGHT=HEIGHT-HEIGHT*5/LINES)) + + ((img_width > WIDTH)) && { + ((img_height=img_height*WIDTH/img_width)) + ((img_width=WIDTH)) + }; + + ((img_height > HEIGHT)) && { + ((img_width=img_width*HEIGHT/img_height-40)) + ((img_height=HEIGHT-40)) + }; + + + str="$(tput setaf 10)$(tput setab 0)$image | ${number}/${#array[@]}$(tput sgr0)" + length=$(printf "$str" | wc -c) + printf "$(tput sgr0)" + col=$(tput cols) + tput setab 0; tput cup $LINES 0 + for void in $(seq $col) + do + printf " " + done + tput cup $LINES 5 + printf "$str" + printf '0;1;%s;%s;%s;%s;;;;;%s\n3;\n4\n' \ + "0" \ + "0" \ + "$img_width" \ + "$img_height" \ + "$image" | "$w3m" &>/dev/null +} + +input=$(tr " " "\n" < /dev/stdin) +IFS=$'\n' +array=( $input ) +unset IFS +number="0" +tput civis + +clear +while true +do + display ${array[$number]} + read -rsn 1 -t 10000 key < /dev/tty + [ "$key" = "k" ] || [ "$key" = "l" ] &&{ + number=$(($number+1)) + }; + [ "$key" = "j" ] || [ "$key" = "h" ] &&{ + number=$(($number-1)) + }; + [ "$key" = "q" ] &&{ + tput cnorm + exit 0 + }; +done diff --git a/.scripts/bin/misc/urlhand b/.scripts/bin/misc/urlhand @@ -0,0 +1,35 @@ +#!/bin/bash + +array=$(cat /dev/stdin | awk '/http/' | sed 's/.*http/http/g' | awk '{print $1}' | sort) + +clear +count=0 +IFS=$'\n' +printf "" > ~/.cache/urlhand1 +for link in $array +do + count=$(($count+1)) + echo "$count: $link" + echo "$count:$link" | sed 's|/|\t|g' >> ~/.cache/urlhand1 +done + +printf "\nSelect a number: "; read var < /dev/tty +arg=$(grep "$var:" < ~/.cache/urlhand1 | sed 's|\t|/|g' | sed 's/^[0-9]*://') +handlers=("mpv" "youtube-dl --add-metadata -ic" "youtube-dl --add-metadata -xic" "vimb --no-maximize" "surf" "w3m") +count=0 +echo +printf "" > ~/.cache/urlhand2 +for item in ${!handlers[*]} +do + count=$(($count+1)) + echo "$count: ${handlers[$item]}" + echo "$count:${handlers[$item]}" | sed 's|/|\t|g' >> ~/.cache/urlhand2 +done + +printf "\nSelect a handler: "; read var < /dev/tty +hand=$(grep "$var:" < ~/.cache/urlhand2 | sed 's|\t|/|g' | sed 's/^[0-9]*://') +killall mpvlisten +hmpv pause /tmp/mpv-socket +hmpv pause /tmp/mpv-socket2 +bash -c "$hand $arg" +mpvlisten /tmp/mpv-socket2 /tmp/mpv-socket & diff --git a/.scripts/i3blocks/title b/.scripts/i3blocks/title @@ -8,7 +8,7 @@ id=$(xprop -root _NET_ACTIVE_WINDOW | awk '// {print $5}') out1=$(xprop -id $id | awk '/WM_CLASS/ {print $3}' | sed 's/"//g' | sed 's/,//g') -out2=$(xprop -id $id | awk '/WM_ICON_NAME\(STRING\)/ { $1=""; $2=""; print}' | sed 's/"//g' | sed "s/^[ \t]*//") +out2=$(xprop -id $id | awk '/_NET_WM_NAME/{ $1=""; $2=""; print}' | sed 's/"//g' | sed "s/^[ \t]*//") if [ "$BLOCK_BUTTON" == "1" ] then dunstify "Current window title" "$out2" diff --git a/.test b/.test diff --git a/.vimrc b/.vimrc @@ -12,10 +12,14 @@ set nocompatible "Leader let mapleader="," +"Manpage +let $PAGER='' + "Tab completion set path+=** set wildmenu set wildmode=longest,list,full +set incsearch "Set colourscheme syntax on @@ -24,5 +28,12 @@ set relativenumber set number set hlsearch -autocmd BufWritePost config.h,config.def.h,dmenu.c !sudo make install clean -autocmd BufWritePost ~/.Xreources,~/.Xdefaults !xrdb -merge % +"Remove arrow keys +no <Up> <Nop> +no <Down> <Nop> +no <Left> <Nop> +no <Right> <Nop> +ino <Up> <Nop> +ino <Down> <Nop> +ino <Left> <Nop> +ino <Right> <Nop> diff --git a/.xinitrc b/.xinitrc @@ -1,2 +1 @@ exec i3 -exec urxvtd -q -f -o