commit 99b6eaeac2b1ba71dd916085088a9e13956237c9 parent 720f3b20ca8ea0dcb6ab63cbdbd57c28422b0b21 Author: Mark Feller <mjfeller1992@gmail.com> Date: Mon, 25 May 2020 11:03:05 -0600 merge in linux changes Diffstat:
41 files changed, 364 insertions(+), 358 deletions(-)
diff --git a/dots/.config/aliases b/dots/.config/aliases @@ -1,16 +0,0 @@ -alias ls="ls -F" -alias l="ls -lah" -alias q="exit" -alias vi=vim - -alias neo="clear && neofetch" -alias f="fzf --preview=\"head -$LINES {}\"" -alias fz="vim \$(f)" -alias weather="curl wttr.in/\~Boulder+Colorado" - -alias dots="cd $HOME/.config/rice/dots" -alias g="cd $GOPATH/src/gitlab.com/mark.feller" - -# Youtube -alias yt="youtube-dl" -alias yta='youtube-dl --extract-audio --audio-quality 0 --audio-format flac --output "%(title)s.%(ext)s"' diff --git a/dots/.config/aliasrc b/dots/.config/aliasrc @@ -0,0 +1,17 @@ +#!/bin/sh + +alias ls="ls -F --group-directories-first" +alias l="ls -lah" +alias cp="cp -iv" +alias mv="mv -iv" +alias rm="rm -iv" +alias q="exit" +alias vim=nvim +alias vi=nvim + +alias weather="curl wttr.in/\~Boulder+Colorado" + +# Youtube +alias yt="youtube-dl" +alias yta='youtube-dl --extract-audio --audio-quality 0 --audio-format flac --output "%(title)s.%(ext)s"' +alias ytad='youtube-dl --extract-audio --audio-quality 0 --audio-format flac --output "%(title)s [%(upload_date)s].%(ext)s"' diff --git a/dots/.config/compton/compton.conf b/dots/.config/compton/compton.conf @@ -1,5 +1,5 @@ shadow = true; -shadow-radius = 15; +shadow-radius = 20; shadow-opacity = 0.4; -shadow-offset-x = -7; -shadow-offset-y = -7; +shadow-offset-x = -25; +shadow-offset-y = -25; diff --git a/dots/.config/i3/config b/dots/.config/i3/config @@ -1,236 +0,0 @@ -# i3 config file (v4) -# -# Please see https://i3wm.org/docs/userguide.html for a complete reference! - -# ---------------------------------------------------------------------- -# Bindings -# ---------------------------------------------------------------------- - -set $mod Mod4 - -# Use Mouse+$mod to drag floating windows to their wanted position -floating_modifier $mod - -bindsym $mod+Return exec "$TERMINAL" -bindsym $mod+Shift+q kill -bindsym $mod+space exec "rofi -show drun" - -bindsym $mod+t split h -bindsym $mod+v split v -bindsym $mod+f fullscreen toggle -bindsym $mod+Shift+space floating toggle -bindsym $mod+a focus parent - -bindsym $mod+Shift+c reload -bindsym $mod+Shift+r restart - -# exit i3 (logs you out of your X session) -bindsym $mod+Escape exec "lock" -bindsym $mod+Shift+e exec "prompt 'Do you really want to exit i3?' 'i3-msg exit'" -bindsym $mod+Shift+Escape exec "prompt 'Do you really want to shutdown?' 'shutdown -h now'" - -# change focus -bindsym $mod+h focus left -bindsym $mod+j focus down -bindsym $mod+k focus up -bindsym $mod+l focus right - -# alternatively, you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - -# move focused window -bindsym $mod+Shift+h move left -bindsym $mod+Shift+j move down -bindsym $mod+Shift+k move up -bindsym $mod+Shift+l move right - -# alternatively, you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# Define names for default workspaces for which we configure key bindings later on. -# We use variables to avoid repeating the names in multiple places. -set $ws1 "1" -set $ws2 "2" -set $ws3 "3" -set $ws4 "4" -set $ws5 "5" -set $ws6 "6" -set $ws7 "7" -set $ws8 "8" -set $ws9 "9" -set $ws10 "10" - -# switch to workspace -bindsym $mod+1 workspace $ws1 -bindsym $mod+2 workspace $ws2 -bindsym $mod+3 workspace $ws3 -bindsym $mod+4 workspace $ws4 -bindsym $mod+5 workspace $ws5 -bindsym $mod+6 workspace $ws6 -bindsym $mod+7 workspace $ws7 -bindsym $mod+8 workspace $ws8 -bindsym $mod+9 workspace $ws9 -bindsym $mod+0 workspace $ws10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace $ws1 -bindsym $mod+Shift+2 move container to workspace $ws2 -bindsym $mod+Shift+3 move container to workspace $ws3 -bindsym $mod+Shift+4 move container to workspace $ws4 -bindsym $mod+Shift+5 move container to workspace $ws5 -bindsym $mod+Shift+6 move container to workspace $ws6 -bindsym $mod+Shift+7 move container to workspace $ws7 -bindsym $mod+Shift+8 move container to workspace $ws8 -bindsym $mod+Shift+9 move container to workspace $ws9 -bindsym $mod+Shift+0 move container to workspace $ws10 - -# pulseaudio volume -bindsym $mod+u exec "volume-change -5%" -bindsym $mod+i exec "volume-change +5%" - -# laptop power status -bindsym $mod+p exec "power-status" - -# date -bindsym $mod+d exec "notify-date" - -# ---------------------------------------------------------------------- -# Theme -# ---------------------------------------------------------------------- - -default_border pixel 3 - -# gruvbox colorscheme -set $bg #161819 -set $fg #ebdbb2 -set $red #cc241d -set $green #98971a -set $yellow #d79921 -set $blue #458588 -set $purple #b16286 -set $cyan #689d6a -set $gray #a89984 -set $darkgray #1d2021 -set $accent #1d2021 - -# class border backgr. text indicator child_border -client.focused $accent $darkgray $accent $accent $accent -client.focused_inactive $bg $darkgray $bg $bg $bg -client.unfocused $bg $darkgray $bg $bg $bg -client.urgent $red $red $fg $red $red - -# ---------------------------------------------------------------------- -# Resize Mode -# ---------------------------------------------------------------------- - -mode "resize" { - bindsym h resize shrink width 10 px or 10 ppt - bindsym j resize grow height 10 px or 10 ppt - bindsym k resize shrink height 10 px or 10 ppt - bindsym l resize grow width 10 px or 10 ppt - - bindsym Shift+h resize shrink width 1 px or 1 ppt - bindsym Shift+j resize grow height 1 px or 1 ppt - bindsym Shift+k resize shrink height 1 px or 1 ppt - bindsym Shift+l resize grow width 1 px or 1 ppt - - - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - bindsym Return mode "default" - bindsym Escape mode "default" - bindsym $mod+r mode "default" -} - -bindsym $mod+r mode "resize" - -# ---------------------------------------------------------------------- -# Gaps Mode -# ---------------------------------------------------------------------- - -# Desktop -#gaps outer 110 -#gaps inner 50 - -# Laptop -gaps outer 0 -gaps inner 10 - -set $mode_gaps Gaps: (o)uter, (i)nner -set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) -set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) -bindsym $mod+Shift+g mode "$mode_gaps" - -mode "$mode_gaps" { - bindsym o mode "$mode_gaps_outer" - bindsym i mode "$mode_gaps_inner" - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" -} - -mode "$mode_gaps_outer" { - bindsym k gaps outer current plus 30 - bindsym j gaps outer current minus 30 - bindsym 0 gaps outer current set 0 - - bindsym Shift+k gaps outer all plus 5 - bindsym Shift+j gaps outer all minus 5 - bindsym Shift+0 gaps outer all set 0 - - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" -} - -mode "$mode_gaps_inner" { - bindsym k gaps inner current plus 30 - bindsym j gaps inner current minus 30 - bindsym 0 gaps inner current set 0 - - bindsym Shift+k gaps inner all plus 5 - bindsym Shift+j gaps inner all minus 5 - bindsym Shift+0 gaps inner all set 0 - - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" -} - -# ---------------------------------------------------------------------- -# Special Windows -# ---------------------------------------------------------------------- - -# Steam - https://github.com/ValveSoftware/steam-for-linux/issues/1040 -for_window [class="^Steam$" title="^Friends$"] floating enable -for_window [class="^Steam$" title="Steam - News"] floating enable -for_window [class="^Steam$" title=".* - Chat"] floating enable -for_window [class="^Steam$" title="^Settings$"] floating enable -for_window [class="^Steam$" title=".* - event started"] floating enable -for_window [class="^Steam$" title=".* CD key"] floating enable -for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable -for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable -for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable -for_window [title="^Steam Keyboard$"] floating enable - -# ---------------------------------------------------------------------- -# Init -# ---------------------------------------------------------------------- - -# # use compton with blur and use hsetroot for background -# exec compton --config .config/compton/compton.conf -b -# exec hsetroot -solid '#363F3E' - -# or dont use compton -exec xsetroot -solid "#161819" - -exec xinput set-prop 12 288 1 # Tap to Click -exec xinput set-prop 12 290 1 # Natural Scrolling -exec setxkbmap -option caps:ctrl_modifier -exec_always --no-startup-id notify-send 'Welcome' 'Press Super+F1 for the manual.' -t 10000 diff --git a/dots/.config/lf/lfrc b/dots/.config/lf/lfrc @@ -1 +1,23 @@ +set shell sh set hidden +set color256 + +cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 + +cmd delete ${{ + set -f + printf "%s\n\t" "$fx" + printf "delete?[y/N]" + read ans + [ $ans = "y" ] && rm -rf $fx +}} + +cmd openshell ${{ + set -f + zsh +}} + +map D delete +map r push :rename<space> +map <enter> shell +map S openshell diff --git a/dots/.config/mimeapps.list b/dots/.config/mimeapps.list @@ -0,0 +1,12 @@ +[Default Applications] + +# xdg-open will use these settings to determine how to open filetypes. +# These .desktop entries can also be seen and changed in ~/.local/share/applications/ + +application/pdf=pdf.desktop; +application/postscript=pdf.desktop; +text/plain=text.desktop; +text/x-shellscript=text.desktop; +image/png=image.desktop; +image/jpeg=image.desktop; +image/gif=image.desktop; diff --git a/dots/.config/mpd/.gitignore b/dots/.config/mpd/.gitignore @@ -1,6 +0,0 @@ -database -log -pid -socket= -state -sticker.sql diff --git a/dots/.config/mpd/mpd.conf b/dots/.config/mpd/mpd.conf @@ -1,5 +1,5 @@ user "mjf" -music_directory "~/Music" +music_directory "~/music" port "6600" @@ -11,6 +11,6 @@ state_file "~/.config/mpd/state" sticker_file "~/.config/mpd/sticker.sql" audio_output { - type "osx" - name "default audio" + type "alsa" + name "ALSA sound card" } diff --git a/dots/.config/ncmpcpp/.gitignore b/dots/.config/ncmpcpp/.gitignore @@ -1,2 +0,0 @@ -error.log -lyrics diff --git a/dots/.config/ncmpcpp/config b/dots/.config/ncmpcpp/config @@ -3,7 +3,7 @@ ncmpcpp_directory = "~/.config/ncmpcpp" lyrics_directory = "~/.config/ncmpcpp/lyrics" # mpd -mpd_music_dir = "~/Music" +mpd_music_dir = "~/music" mpd_port = "6600" playlist_disable_highlight_delay = 1 message_delay_time = 3 @@ -58,4 +58,4 @@ visualizer_sync_interval = "30" visualizer_look = "∙▋" visualizer_in_stereo = "yes" -#execute_on_song_change = "$HOME/.local/bin/notify-mpd" +#execute_on_song_change = "$HOME/.local/bin/notify_mpd" diff --git a/dots/.config/nvim/colors/gruvbox.vim b/dots/.config/nvim/colors/gruvbox.vim @@ -0,0 +1,44 @@ +" Vim color file +" Maintainer: Bram Moolenaar <Bram@vim.org> +" Last Change: 2001 Jul 23 + +" This is the default color scheme. It doesn't define the Normal +" highlighting, it uses whatever the colors used to be. + +" Set 'background' back to the default. The value can't always be estimated +" and is then guessed. +hi clear Normal +set bg& + +" Remove all existing highlighting and set the defaults. +hi clear + +" Load the syntax highlighting defaults, if it's enabled. +if exists("syntax_on") + syntax reset +endif + +let colors_name = "gruvbox" + +hi Comment ctermfg=8 +hi Constant ctermfg=6 +hi String ctermfg=6 +hi Special ctermfg=none +hi Identifier ctermfg=none +hi Statement ctermfg=none cterm=bold +hi PreProc ctermfg=none +hi type ctermfg=none cterm=bold +hi Underlined ctermfg=none +hi Ignore ctermfg=none +hi Keyword ctermfg=none cterm=bold +hi Label ctermfg=none +hi Repeat ctermfg=none +hi Error ctermbg=1 + +" Golang +hi goDirective ctermfg=none cterm=bold +hi goDeclType ctermfg=none + +hi LineNR ctermfg=8 + +" vim: sw=2 diff --git a/dots/.config/nvim/init.vim b/dots/.config/nvim/init.vim @@ -0,0 +1,13 @@ +colorscheme gruvbox +set number +set relativenumber + +set viminfo=%,<800,'10,/50,:100,h,f0,n~/.cache/.viminfo +" | | | | | | | + viminfo file path +" | | | | | | + file marks 0-9,A-Z 0=NOT stored +" | | | | | + disable 'hlsearch' loading viminfo +" | | | | + command-line history saved +" | | | + search history saved +" | | + files marks saved +" | + lines saved each register (old name for <, vi6.2) +" + save/restore buffer list diff --git a/dots/.config/sxhkd/sxhkdrc b/dots/.config/sxhkd/sxhkdrc @@ -0,0 +1,20 @@ +super + t + notify_date + +super + p + popup pulsemixer + +super + m + popup ncmpcpp + +super + shift + m + popup_man + +super + shift + BackSpace + prompt 'Do you really want to exit dwm?' 'killall dwm' + +super + BackSpace + prompt 'Do you really want to shutdown?' 'shutdown -h now' + +super + space + dmenu_run diff --git a/dots/.config/zsh/.gitignore b/dots/.config/zsh/.gitignore @@ -1 +0,0 @@ -.zcompdump* diff --git a/dots/.config/zsh/.zshrc b/dots/.config/zsh/.zshrc @@ -32,3 +32,5 @@ HISTSIZE=10000 SAVEHIST=10000 HISTFILE=~/.cache/zsh/history SHELL_SESSION_HISTORY=0 + +LS_COLORS="rs=0:di=36;36:ln=36;51:mh=00:pi=40;36;11:so=36;13:do=36;5:bd=48;236;36;11:cd=48;236;36;3:or=48;236;36;9:mi=01;36;41:su=48;196;36;15:sg=48;11;36;16:ca=48;196;36;226:tw=48;10;36;16:ow=48;10;36;21:st=48;21;36;15:ex=1:*.tar=36;9:*.tgz=36;9:*.arc=36;9:*.arj=36;9:*.taz=36;9:*.lha=36;9:*.lz4=36;9:*.lzh=36;9:*.lzma=36;9:*.tlz=36;9:*.txz=36;9:*.tzo=36;9:*.t7z=36;9:*.zip=36;9:*.z=36;9:*.dz=36;9:*.gz=36;9:*.lrz=36;9:*.lz=36;9:*.lzo=36;9:*.xz=36;9:*.zst=36;9:*.tzst=36;9:*.bz2=36;9:*.bz=36;9:*.tbz=36;9:*.tbz2=36;9:*.tz=36;9:*.deb=36;9:*.rpm=36;9:*.jar=36;9:*.war=36;9:*.ear=36;9:*.sar=36;9:*.rar=36;9:*.alz=36;9:*.ace=36;9:*.zoo=36;9:*.cpio=36;9:*.7z=36;9:*.rz=36;9:*.cab=36;9:*.wim=36;9:*.swm=36;9:*.dwm=36;9:*.esd=36;9:*.jpg=36;13:*.jpeg=36;13:*.mjpg=36;13:*.mjpeg=36;13:*.gif=36;13:*.bmp=36;13:*.pbm=36;13:*.pgm=36;13:*.ppm=36;13:*.tga=36;13:*.xbm=36;13:*.xpm=36;13:*.tif=36;13:*.tiff=36;13:*.png=36;13:*.svg=36;13:*.svgz=36;13:*.mng=36;13:*.pcx=36;13:*.mov=36;13:*.mpg=36;13:*.mpeg=36;13:*.m2v=36;13:*.mkv=36;13:*.webm=36;13:*.ogm=36;13:*.mp4=36;13:*.m4v=36;13:*.mp4v=36;13:*.vob=36;13:*.qt=36;13:*.nuv=36;13:*.wmv=36;13:*.asf=36;13:*.rm=36;13:*.rmvb=36;13:*.flc=36;13:*.avi=36;13:*.fli=36;13:*.flv=36;13:*.gl=36;13:*.dl=36;13:*.xcf=36;13:*.xwd=36;13:*.yuv=36;13:*.cgm=36;13:*.emf=36;13:*.ogv=36;13:*.ogx=36;13:*.aac=36;45:*.au=36;45:*.flac=36;45:*.m4a=36;45:*.mid=36;45:*.midi=36;45:*.mka=36;45:*.mp3=36;45:*.mpc=36;45:*.ogg=36;45:*.ra=36;45:*.wav=36;45:*.oga=36;45:*.opus=36;45:*.spx=36;45:*.xspf=36;45:" diff --git a/dots/.local/bin/aura b/dots/.local/bin/aura @@ -1,27 +0,0 @@ -#!/bin/sh - -gry="\e[30m" -red="\e[31m" -grn="\e[32m" -ylw="\e[33m" -blu="\e[34m" -prp="\e[35m" -cyn="\e[36m" -wht="\e[37m" -rst="\e[0m" - -# fetch some general info -source /etc/os-release -distro="$NAME $VERSION_ID" -kernel=`uname -r | sed 's/-.*//'` -pkgs=`dnf list --installed | wc -l` - -echo -echo -e " distro $distro" -echo -e " kernel $kernel" -echo -e " packages $pkgs" -echo -e " shell zsh" -echo -e " wm i3" -echo -echo -e " ${gry}▼ ${red}▲ ${grn}▼ ${ylw}▲ ${cyn}▼ ${blu}▲ ${prp}▼ ${wht}▲" -echo diff --git a/dots/.local/bin/lock b/dots/.local/bin/lock @@ -1,4 +1,5 @@ #!/bin/sh +# # Lock i3 using a blurred image of the desktop PICTURE=/tmp/i3lock.png diff --git a/dots/.local/bin/notify-date b/dots/.local/bin/notify-date @@ -1,8 +0,0 @@ -#!/bin/sh -# Display the date using notify-send -# A nice alternative to displaying the time on a bar. - -# Arbitrary but unique message id -msgId="661049" - -dunstify -r $msgId -t 5000 "$(date +"%A, %-d %b %-I:%M")" diff --git a/dots/.local/bin/notify-mpd b/dots/.local/bin/notify-mpd @@ -1,22 +0,0 @@ -#!/bin/sh -# Send notifications when mpd song changes - -# Arbitrary but unique message id -msgId="661050" - -tmp="/tmp/cover.jpg" -form="Artist: %artist%\nAlbum: %album%\nTitle: %title%" - -rm -f $tmp - -# create the notification text -toprint="$(mpc status -f "$form" | head -n3 | sed \"s:&:&:g\")" -artpath="/home/mjf/Music/$(dirname "$(mpc status -f '%file%' | head -n1)")/cover.jpg" - -# generate the cover icon if we find one -if [ -f "$artpath" ]; then - convert -resize 84x84 "$artpath" $tmp -fi - -# send out the notication with the cover icon and song information -dunstify -r $msgId -i "$tmp" "$toprint" diff --git a/dots/.local/bin/notify_date b/dots/.local/bin/notify_date @@ -0,0 +1,3 @@ +#!/bin/sh + +notify-send -t 5000 "$(date +"%A, %-d %b %-I:%M")" diff --git a/dots/.local/bin/notify_mpd b/dots/.local/bin/notify_mpd @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Send notifications when mpd song changes + +tmp="/tmp/cover.jpg" +form="Artist: %artist%\nAlbum: %album%\nTitle: %title%" + +rm -f $tmp + +# create the notification text +toprint="`mpc status -f \"$form\" | head -n3 | sed \"s:&:&:g\"`" +artpath="/home/mjf/Music/$(dirname "$(mpc status -f '%file%' | head -n1)")/cover.jpg" + +# generate the cover icon if we find one +if [ -f "$artpath" ]; then + convert -resize 84x84 "$artpath" $tmp +fi + +# send out the notication with the cover icon and song information +notify-send -i "$tmp" "$toprint" + diff --git a/dots/.local/bin/notify_power b/dots/.local/bin/notify_power @@ -0,0 +1,10 @@ +#!/bin/sh +# +# + +# Arbitrary but unique message id +msgId="661051" + +status=$(upower -i "$(upower -e | grep BAT)" | grep --color=never -E "state|to\ full|to\ empty|percentage" | sed "s/: */: /" | sed "s/^ *//") + +notify-send "Power" "$status" diff --git a/dots/.local/bin/popup b/dots/.local/bin/popup @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Create a dwm popup terminal running $1. + +st -c Center -g ${POPUP_GEOMETRY:-80x24} -e $@ & diff --git a/dots/.local/bin/popup_man b/dots/.local/bin/popup_man @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Select a manpage and spawn a popup terminal with it. + +unset MANWIDTH +manpage=$(man -k . | /usr/local/bin/dmenu -i -bw 6 -c -l 20 | awk '{ print $1 }') +[ -z $manpage ] || POPUP_GEOMETRY=90x45 popup man $manpage diff --git a/dots/.local/bin/power-status b/dots/.local/bin/power-status @@ -1,8 +0,0 @@ -#!/bin/sh - -# Arbitrary but unique message id -msgId="661051" - -status=$(upower -i "$(upower -e | grep BAT)" | grep --color=never -E "state|to\ full|to\ empty|percentage" | sed "s/: */: /" | sed "s/^ *//") - -dunstify -r $msgId "Power" "$status" diff --git a/dots/.local/bin/prompt b/dots/.local/bin/prompt @@ -1,7 +1,8 @@ #!/bin/sh -# A rofi binary prompt script. -# Gives a rofi prompt labeled with $1 to perform command $2. +# +# A dmenu prompt script. +# Gives a demu prompt labeled with $1 to perform command $2. # For example: # `./prompt "Do you want to shutdown?" "shutdown -h now"` -[ "$(printf "No\\nYes" | rofi -dmenu -i -p "$1" -nb darkred -sb red -sf white -nf gray )" = "Yes" ] && $2 +[ "$(printf "No\\nYes" | dmenu -i -c -l 2 -p "$1")" = "Yes" ] && $2 diff --git a/dots/.local/bin/setbg b/dots/.local/bin/setbg @@ -0,0 +1,2 @@ +#!/bin/sh +feh --no-fehbg --bg-center --image-bg '#637d6e' '/home/mjf/pictures/glenda_transparent.png' diff --git a/dots/.local/bin/st_copyout b/dots/.local/bin/st_copyout @@ -0,0 +1,12 @@ +#!/bin/sh + +tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX) +trap 'rm $tmpfile' 0 1 15 +sed -n "w $tmpfile" + +ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^s*//')" + +chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" + +esp1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')" +awk "/^$chosen$/{p=1;print;next} p&&/$esp1/{p=0};p" "$tmpfile" | xclip -selection clipboard diff --git a/dots/.local/bin/surf_search b/dots/.local/bin/surf_search @@ -0,0 +1,50 @@ +#!/bin/sh +# +# surf_qsearch: +# Search script for surf. Takes the surf window id as argument. +# POSIX compliant and GNU-free, I think. +# +# Add something like the following to your surf/config.(def.)h, replacing +# surf_qsearch with the name of the file you've copied this code into: +# +# /* Quick searching. */ +# #define QSEARCH { \ +# .v = (char *[]){"/bin/sh", "-c", "surf_qsearch $0 $1", winid, NULL } \ +# } +# +# Add a keybinding in keys[]: +# +# { MODKEY, GDK_q, spawn, QSEARCH }, + +# Get the full query. The 'echo | dmenu' idiom may be a bit of +# a hack, but it seems to work. +q="$(echo | dmenu -c -h 50)" +[ -z "$q" ] && exit 0 + +# Extract the engine code. +e="${q%% *}" + +# Encode the search string (i.e. the rest of q). xxd was formerly used +# here, but xxd is part of vim packages on some systems, whereas od is +# ubiquitous. A search script that breaks if someone accidentally removes +# vim is stupid. +s=$(printf %s "${q#* }" | tr -d '\n' | od -t x1 -An | tr ' ' '%') +# These are examples. Change as desired. +# 's' = startpage.com +# 'w' = wikipedia.org +# 'a' = wiki.archlinux.org +# 'd' = en.wiktionary.org +case $e in + 's') + xprop -id $1 -f _SURF_GO 8s -set _SURF_GO "https://startpage.com/do/search?q=${s}" + ;; + 'w') + xprop -id $1 -f _SURF_GO 8s -set _SURF_GO "https://en.wikipedia.org/wiki/index.php/Special:Search?search=${s}&go=Go" + ;; + 'a') + xprop -id $1 -f _SURF_GO 8s -set _SURF_GO "https://wiki.archlinux.org/index.php/Special:Search?search=${s}&go=Go" + ;; + *) + xprop -id $1 -f _SURF_GO 8s -set _SURF_GO "https://duckduckgo.com/lite?q=${s}&" + ;; +esac diff --git a/dots/.local/bin/unix b/dots/.local/bin/unix @@ -0,0 +1,26 @@ +#!/bin/sh + +#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes +#converted to shell by #nixers @ irc.unix.chat + +cat << 'eof' + [38;5;255m,_ ,_==▄▂[0m + [38;5;255m, ▂▃▄▄▅▅[48;5;240m▅[48;5;20m▂[48;5;240m▅¾[0m. [38;5;199m/ [38;5;20m/[0m + [38;5;255m[48;5;20m▄[0m[38;5;255m[48;5;199m▆[38;5;16m[48;5;255m<´ [38;5;32m"[38;5;34m»[38;5;255m▓▓[48;5;32m▓[48;5;240m%[0m\ [38;5;199m/ [38;5;20m/ [38;5;45m/ [38;5;118m/[0m + [38;5;255m,[38;5;255m[48;5;240m▅[38;5;16m[48;5;255m7" [38;5;160m´[38;5;34m>[38;5;255m[48;5;39m▓▓[38;5;199m[48;5;255m▓[0m[38;5;255m% [38;5;20m/ [38;5;118m/ [38;5;199m> [38;5;118m/ [38;5;199m>[38;5;255m/[38;5;45m%[0m + [38;5;255m▐[48;5;240m[38;5;255m¶[48;5;240m[38;5;255m▓[48;5;255m [38;5;196m,[38;5;34m»[48;5;201m[38;5;255m▓▓[0m[38;5;255m¾´[0m [38;5;199m/[38;5;255m> %[38;5;199m/[38;5;118m%[38;5;255m/[38;5;199m/ [38;5;45m/ [38;5;199m/[0m + [38;5;255m[48;5;240m▓[48;5;255m[38;5;16m▃[48;5;16m[38;5;255m▅▅[38;5;16m[48;5;255m▅▃,,[38;5;32m▄[38;5;16m▅[38;5;255m[48;5;16m▅▅[38;5;255m[48;5;20mÆ[0m[38;5;255m\[0m[38;5;20m/[38;5;118m/[38;5;255m /[38;5;118m/[38;5;199m/[38;5;255m>[38;5;45m// [38;5;255m/[38;5;118m>[38;5;199m/ [38;5;20m/[0m + [48;5;20m[38;5;255mV[48;5;255m[38;5;16m║[48;5;20m[38;5;255m«[0m[38;5;255m¼.;[48;5;240m[38;5;255m→[48;5;255m[38;5;16m ║[0m[38;5;255m<«.,[48;5;25m[38;5;255m`[48;5;240m=[0m[38;5;20m/[38;5;199m/ [38;5;255m/>[38;5;45m/[38;5;118m/[38;5;255m%/[38;5;199m% / [38;5;20m/[0m + [38;5;20m//[48;5;255m[38;5;16m╠<´ -²,)[48;5;16m[38;5;255m(▓[48;5;255m[38;5;16m~"-[38;5;199m╝/[0m[38;5;255m¾[0m[38;5;199m/ [38;5;118m%[38;5;255m/[38;5;118m>[38;5;45m/ [38;5;118m/[38;5;199m>[0m + [38;5;20m/ / [38;5;118m/ [48;5;20m[38;5;255m▐[48;5;240m[38;5;16m%[48;5;255m -./▄▃▄[48;5;16m[38;5;255m▅[48;5;255m[38;5;16m▐[48;5;255m[38;5;16m, [38;5;199m/[48;5;199m[38;5;255m7[0m[38;5;20m/[38;5;199m/[38;5;255m;/[38;5;199m/[38;5;118m% [38;5;20m/ /[0m + [38;5;20m/ [38;5;199m/[38;5;255m/[38;5;45m/[38;5;118m/[38;5;255m[48;5;240m`[48;5;20m[38;5;255m▌[48;5;20m[38;5;255m▐[48;5;255m[38;5;16m %z[0m[38;5;255mWv xX[48;5;20m[38;5;255m▓[48;5;34m[38;5;255m▇[48;5;199m[38;255m▌[0m[38;5;20m/[38;5;199m/[38;5;255m&;[38;5;20m% [38;5;199m/ [38;5;20m/[0m + [38;5;20m/ / [38;5;255m/ [38;5;118m%[38;5;199m/[38;5;255m/%/[48;5;240m[38;5;255m¾[48;5;255m[38;5;16m½´[38;5;255m[48;5;16m▌[0m[38;5;246m▃▄[38;5;255m▄▄[38;5;246m▄▃▃[0m[48;5;16m[38;5;255m▐[38;5;255m[48;5;199m¶[48;5;20m[38;5;255m\[0m[38;5;20m/[0m[48;5;255m[38;5;240m&[0m [38;5;20m/[0m + [38;5;199m<[38;5;118m/ [38;5;45m/[38;5;255m</[38;5;118m%[38;5;255m/[38;5;45m/[38;5;255m`[48;5;16m▓[48;5;255m[38;5;16m![48;5;240m[38;5;255m%[48;5;16m[38;5;255m▓[0m[38;5;255m%[48;5;240m[38;5;255m╣[48;5;240m[38;5;255;╣[0m[38;5;255mW[0m[38;5;250mY<Y)[48;5;255m[38;5;16my&[0m[38;5;255m/`[48;5;240m\[0m + [38;5;20m/ [38;5;199m/ [38;5;199m%[38;5;255m/%[38;5;118m/[38;5;45m/[38;5;255m<[38;5;118m/[38;5;199m%[38;5;45m/[38;5;20m/[48;5;240m[38;5;255m\[38;5;16m[48;5;255mi7; ╠N[0m[38;5;246m>[38;5;255m)VY>[48;5;240m[38;5;255m7[0m[38;5;255m; [38;5;255m[48;5;240m\[0m[38;5;255m_[0m [38;5;255mUNIX IS VERY SIMPLE [38;5;45mIT JUST NEEDS A[0m + [38;5;20m/ [38;5;255m/[38;5;118m<[38;5;255m/ [38;5;45m/[38;5;255m/<[38;5;199m/[38;5;20m/[38;5;199m/[38;5;20m<[38;5;255m_/%\[38;5;255m[48;5;16m▓[48;5;255m[38;5;16m V[0m[38;5;255m%[48;5;255m[38;5;16mW[0m[38;5;255m%£)XY[0m [38;5;240m_/%[38;5;255m‾\_,[0m [38;5;45mGENIUS TO UNDERSTAND ITS SIMPLICITY[38;5;255m[0m + [38;5;199m/ [38;5;255m/ [38;5;199m/[38;5;255m/[38;5;118m%[38;5;199m/[48;5;240m[38;5;255m_,=-[48;5;20m-^[0m[38;5;255m/%/%%[48;5;255m[38;5;16m\¾%[0m[38;5;255m¶[0m[48;5;255m[38;5;16m%[0m[38;5;255m%}[0m [38;5;240m/%%%[38;5;20m%%[38;5;240m%;\,[0m + [38;5;45m%[38;5;20m/[38;5;199m< [38;5;20m/[48;5;20m[38;5;255m_/[48;5;240m [0m[38;5;255m%%%[38;5;240m%%[38;5;20m;[38;5;255mX[38;5;240m%[38;5;20m%[38;5;255m\%[38;5;240m%;, _/%%%;[38;5;20m,[38;5;240m \[0m + [38;5;118m/ [38;5;20m/ [38;5;240m%[38;5;20m%%%%[38;5;240m%;, [38;5;255m\[38;5;240m%[38;5;20m%[38;5;255ml[38;5;240m%%;// _/[38;5;20m%;,[0m [38;5;234mdmr[0m + [38;5;20m/ [38;5;240m%[38;5;20m%%;,[0m [38;5;255m<[38;5;20m;[38;5;240m\-=-/ /[0m + [38;5;20m;,[0m [38;5;240ml[0m +eof diff --git a/dots/.local/bin/volume-change b/dots/.local/bin/volume-change @@ -1,21 +0,0 @@ -#!/bin/sh - -# Arbitrary but unique message id -msgId="661051" - -# Get the current sink -SINK=$(pactl list short sinks \ - | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' \ - | head -n 1) - -# Update the volume -pactl -- set-sink-volume "$SINK" "$1" - -# Get the current volume percentage -NOW=$(pactl list sinks \ - | grep '^[[:space:]]Volume:' \ - | head -n $(( "$SINK" + 1 )) \ - | tail -n 1 \ - | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,') - -dunstify -r $msgId "<b>Volume</b> ${NOW}%" diff --git a/dots/.local/bin/volume_change b/dots/.local/bin/volume_change @@ -0,0 +1,21 @@ +#!/bin/sh + +# Arbitrary but unique message id +msgId="661051" + +# Get the current sink +SINK=$(pactl list short sinks \ + | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' \ + | head -n 1) + +# Update the volume +pactl -- set-sink-volume "$SINK" "$1" + +# Get the current volume percentage +NOW=$(pactl list sinks \ + | grep '^[[:space:]]Volume:' \ + | head -n $(( "$SINK" + 1 )) \ + | tail -n 1 \ + | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,') + +notify-send "<b>Volume</b> ${NOW}%" diff --git a/dots/.local/bin/wifi-conn b/dots/.local/bin/wifi_conn diff --git a/dots/.local/share/applications/file.desktop b/dots/.local/share/applications/file.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=File Manager +Exec=/usr/local/bin/st -e lf %u diff --git a/dots/.local/share/applications/img.desktop b/dots/.local/share/applications/img.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Image Viewer +Exec=/usr/bin/sxiv -a %u diff --git a/dots/.local/share/applications/pdf.desktop b/dots/.local/share/applications/pdf.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Zathura +Exec=/usr/bin/zathura %u diff --git a/dots/.local/share/applications/text.desktop b/dots/.local/share/applications/text.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Text Editor +Exec=/usr/bin/local/st -e vim %u diff --git a/dots/.xinitrc b/dots/.xinitrc @@ -0,0 +1,7 @@ +#!/bin/sh +# +# xinitrc runs automatically when you run startx. + +[ -f ~/.xprofile ] && . ~/.xprofile + +ssh-agent dwm diff --git a/dots/.xprofile b/dots/.xprofile @@ -0,0 +1,9 @@ +#!/bin/sh +# +# This file runs when a DM logs you into a grapgical session. +# If you use startx/xinit this file will also be sourced. + +setbg & +dunst & +sxhkd & +compton --config ~/.config/compton/compton.conf & diff --git a/dots/.zprofile b/dots/.zprofile @@ -0,0 +1,31 @@ +#!/bin/zsh +# +# zsh profile file. Runs on login. Environment variables are set here. + +export XDG_CONFIG_HOME=$HOME/.config +export XDG_DATA_HOME=$HOME/.local/share +export XDG_CACHE_HOME=$HOME/.cache + +export PATH=$PATH:$HOME/.local/bin/ + +export EDITOR=nvim +export READER=zathura +export SHELL=zsh +export TERMINAL=st + +export MANWIDTH=80 +export LESSHISTFILE=- +export HISTFILE=$XDG_CACHE_HOME/bash_history + +# ZSH Config +export ZDOTDIR=$XDG_CONFIG_HOME/zsh +export ZSHDDIR=$XDG_CONFIG_HOME/zsh +export ZSH=$XDG_CONFIG_HOME/oh-my-zsh + +export GOPATH=$HOME/prog/go +export PATH=$PATH:$GOPATH/bin +export PATH=$PATH:$HOME/.cargo/bin + +export LS_COLORS="rs=0:di=36;36:ln=36;51:mh=00:pi=40;36;11:so=36;13:do=36;5:bd=48;236;36;11:cd=48;236;36;3:or=48;236;36;9:mi=01;36;41:su=48;196;36;15:sg=48;11;36;16:ca=48;196;36;226:tw=48;10;36;16:ow=48;10;36;21:st=48;21;36;15:ex=1:*.tar=36;9:*.tgz=36;9:*.arc=36;9:*.arj=36;9:*.taz=36;9:*.lha=36;9:*.lz4=36;9:*.lzh=36;9:*.lzma=36;9:*.tlz=36;9:*.txz=36;9:*.tzo=36;9:*.t7z=36;9:*.zip=36;9:*.z=36;9:*.dz=36;9:*.gz=36;9:*.lrz=36;9:*.lz=36;9:*.lzo=36;9:*.xz=36;9:*.zst=36;9:*.tzst=36;9:*.bz2=36;9:*.bz=36;9:*.tbz=36;9:*.tbz2=36;9:*.tz=36;9:*.deb=36;9:*.rpm=36;9:*.jar=36;9:*.war=36;9:*.ear=36;9:*.sar=36;9:*.rar=36;9:*.alz=36;9:*.ace=36;9:*.zoo=36;9:*.cpio=36;9:*.7z=36;9:*.rz=36;9:*.cab=36;9:*.wim=36;9:*.swm=36;9:*.dwm=36;9:*.esd=36;9:*.jpg=36;13:*.jpeg=36;13:*.mjpg=36;13:*.mjpeg=36;13:*.gif=36;13:*.bmp=36;13:*.pbm=36;13:*.pgm=36;13:*.ppm=36;13:*.tga=36;13:*.xbm=36;13:*.xpm=36;13:*.tif=36;13:*.tiff=36;13:*.png=36;13:*.svg=36;13:*.svgz=36;13:*.mng=36;13:*.pcx=36;13:*.mov=36;13:*.mpg=36;13:*.mpeg=36;13:*.m2v=36;13:*.mkv=36;13:*.webm=36;13:*.ogm=36;13:*.mp4=36;13:*.m4v=36;13:*.mp4v=36;13:*.vob=36;13:*.qt=36;13:*.nuv=36;13:*.wmv=36;13:*.asf=36;13:*.rm=36;13:*.rmvb=36;13:*.flc=36;13:*.avi=36;13:*.fli=36;13:*.flv=36;13:*.gl=36;13:*.dl=36;13:*.xcf=36;13:*.xwd=36;13:*.yuv=36;13:*.cgm=36;13:*.emf=36;13:*.ogv=36;13:*.ogx=36;13:*.aac=36;45:*.au=36;45:*.flac=36;45:*.m4a=36;45:*.mid=36;45:*.midi=36;45:*.mka=36;45:*.mp3=36;45:*.mpc=36;45:*.ogg=36;45:*.ra=36;45:*.wav=36;45:*.oga=36;45:*.opus=36;45:*.spx=36;45:*.xspf=36;45:" + +export LC_ALL=C diff --git a/install b/install @@ -1,4 +1,5 @@ #!/bin/sh +cd "$(dirname "$0")" || exit shared() { cp -rv dots/.config/git $HOME/.config