diff --git a/Xdefaults b/Xdefaults index 7004428..20981e6 100644 --- a/Xdefaults +++ b/Xdefaults @@ -40,12 +40,13 @@ URxvt.borderColor: BG ! Set depth to make transparency work. URxvt*depth: 32 -URxvt.font: xft:mononoki:minispace=False:size=10:antialias=true,xft:MesloLGM Nerd Font:minispace=False:size=10,Noto Sans Mono CJK TC:minispace=False:size=10 -URxvt.boldFont: xft:mononoki:minispace=False:style=bold:size=10,xft:MesloLGM Nerd Font:minispace=False:size=10,Noto Sans Mono CJK TC:minispace=False:size=10 -URxvt.italicFont: xft:mononoki:minispace=False:style=italic:size=10 -URxvt.boldItalicfont: xft:mononoki:minispace=False:style=bolditalic:size=10 +URxvt.font: xft:mononoki:size=10:antialias=true,xft:MesloLGM Nerd Font:size=10,Noto Sans Mono CJK TC:size=10 +URxvt.boldFont: xft:mononoki:style=bold:size=10,xft:MesloLGM Nerd Font:size=10,Noto Sans Mono CJK TC:size=10 +URxvt.italicFont: xft:mononoki:style=italic:size=10 +URxvt.boldItalicfont: xft:mononoki:style=bolditalic:size=10 URxvt.letterSpace: 0 URxvt.lineSpace: -4 +URxvt.geometry: 92x24 URxvt.internalBorder: 20 URxvt.cursorBlink: true @@ -54,7 +55,7 @@ URxvt.saveline: 2048 URxvt.scrollBar: false URxvt.scrollBar_right: false URxvt.pointerBlank: true -URxvt.geometry: 92x24 + URxvt.urgentOnBell: true URxvt.iso14755: false diff --git a/sh_aliases b/bash_aliases similarity index 72% rename from sh_aliases rename to bash_aliases index 24e7106..1ba39f2 100644 --- a/sh_aliases +++ b/bash_aliases @@ -47,28 +47,15 @@ bitrate () { } alias syncdir="sudo rsync -rv --no-perms --no-owner --no-group --delete" -alias chromium-tor="chromium --incognito --proxy-server=socks5://localhost:9050 --user-data-dir=/tmp/tor" -alias chromium-i2p="chromium --incognito --proxy-server=socks5://localhost:4447 --user-data-dir=/tmp/i2p" +alias chromium-tor="chromium --incognito --proxy-server=socks5://localhost:9050 --user-data-dir=/tmp" alarmclock () { sudo rtcwake -m no -t "$(date -d 'tomorrow 07:00:00' '+%s')" && echo 'set alarm for tomorrow at 7am' } # does tail -f on a dir... bit of a hack -# i spelled this wrong on purpose i think mutlitail1 () { while true; do - f=$(ls -1 --sort time $@| head -1 | xargs realpath); - tail -$(tput lines) $f; - done; + f=$(ls -1 --sort time $1| head -1); + tail -$(tput lines) $1/$f; done; } - -alias watchdirty="watch grep -e Dirty: -e Writeback: /proc/meminfo" - -passthrough_disable () { - sudo mv /etc/modprobe.d/vfio.conf /etc/modprobe.d/vfio.conf.disabled -} -passthrough_enable () { - sudo mv /etc/modprobe.d/vfio.conf /etc/modprobe.d/vfio.conf.disabled -} -alias links="xlinks -g -html-g-text-color 0xf58f44 -html-g-background-color 0x191919 -font /home/david/.fonts/ttf-mononoki/mononoki-Regular.ttf" diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..869b220 --- /dev/null +++ b/bashrc @@ -0,0 +1,103 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +export VIMINIT="source ~/.config/vim/vimrc" +export NVIMINIT="source ~/.config/vim/vimrc" + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +shopt -s checkwinsize + +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + + +# parse the current branch and status of git to be added to the prompt +function parse_git_branch() { + BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` + if [ ! "${BRANCH}" == "" ] + then + STAT=`parse_git_dirty` + echo " [${BRANCH}${STAT}]" + else + echo "" + fi +} + +function parse_git_dirty { + status=`git status 2>&1 | tee` + dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"` + untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"` + ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"` + newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"` + renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"` + deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"` + bits='' + if [ "${renamed}" == "0" ]; then + bits=">${bits}" + fi + if [ "${ahead}" == "0" ]; then + bits="*${bits}" + fi + if [ "${newfile}" == "0" ]; then + bits="+${bits}" + fi + if [ "${untracked}" == "0" ]; then + bits="?${bits}" + fi + if [ "${deleted}" == "0" ]; then + bits="x${bits}" + fi + if [ "${dirty}" == "0" ]; then + bits="!${bits}" + fi + if [ ! "${bits}" == "" ]; then + echo " ${bits}" + else + echo "" + fi +} + +source "$HOME/.scripts/fzf-bash-completion.sh" + +bind -x '"\C-\t": fzf_bash_completion' + +export PS1="\[\e[0;97m\]\w\[\e[0;37m\]\`parse_git_branch\` > \[\e[0;0m\]" + +PATH="/home/david/.mangadl-bash:${PATH}" diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc index 7fa53fa..a7d7c7f 100755 --- a/config/bspwm/bspwmrc +++ b/config/bspwm/bspwmrc @@ -6,17 +6,26 @@ COLOR_SECONDARY="#5977b3" xsetroot -cursor_name left_ptr & xrdb ~/.Xdefaults +bash $HOME/.config/xrandr.alt.sh -bspc monitor -d a1 a2 a3 a4 a5 a6 a7 a8 a9 + +bspc monitor DP-2 -n A +bspc monitor DP-1 -n B +bspc monitor DP-4 -n C +bspc monitor HDMI-0 -n D pgrep -x sxhkd > /dev/null || sxhkd & pgrep -x picom > /dev/null || picom & -pgrep -x xss-lock > /dev/null || xss-lock slock & $HOME/.config/polybar/launch.sh $HOME/.scripts/bg.sh -bspc config border_width 1 +bspc monitor A -d a1 a2 a3 a4 a5 a6 a7 a8 a9 +bspc monitor B -d b1 b2 b3 b4 b5 b6 b7 b8 b9 +bspc monitor C -d c1 c2 c3 c4 c5 c6 c7 c8 c9 +bspc monitor D -d d1 d2 + +bspc config border_width 2 bspc config window_gap 0 bspc config focus_follows_pointer false @@ -26,6 +35,4 @@ bspc config active_border_color "$COLOR_BACKGROUND" bspc config focused_border_color "$COLOR_PRIMARY" wmname bspwm -urxvt & - -$HOME/.scripts/start-mpd +sleep 1; $HOME/.scripts/start-mpd diff --git a/config/cava/config b/config/cava/config index 9f8e2b8..105beec 100644 --- a/config/cava/config +++ b/config/cava/config @@ -56,6 +56,7 @@ # For alsa 'source' will be the capture device. # For fifo 'source' will be the path to fifo-file. # For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address +method = pulse ; source = auto ; method = alsa diff --git a/config/gtk-3.0/bookmarks b/config/gtk-3.0/bookmarks index 47fde0d..9f0efb8 100644 --- a/config/gtk-3.0/bookmarks +++ b/config/gtk-3.0/bookmarks @@ -9,5 +9,3 @@ file:///home/david/hd1/library library file:///tmp tmp file:///home/david/docs/school file:///home/david/video/anime -file:///home/david/lmms -file:///home/david/docs/proj/ardour diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf index 13afec6..cf7346b 100644 --- a/config/mpd/mpd.conf +++ b/config/mpd/mpd.conf @@ -3,15 +3,15 @@ input { plugin "curl" } -#audio_output { -# type "httpd" -# name "My HTTP Stream" -# encoder "lame" # optional, vorbis or lame -# port "6680" -# bitrate "420" -# format "44100:16:1" -# max_clients "0" -#} +audio_output { + type "httpd" + name "My HTTP Stream" + encoder "lame" # optional, vorbis or lame + port "6680" + bitrate "420" + format "44100:16:1" + max_clients "0" +} audio_output { type "pulse" diff --git a/config/mpv/mpv.conf b/config/mpv/mpv.conf index de4d6d7..437e3d6 100644 --- a/config/mpv/mpv.conf +++ b/config/mpv/mpv.conf @@ -1,4 +1,4 @@ -#vo=gpu +vo=gpu hwdec=auto screenshot-directory=~/pics/screenshot glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Upscale_Denoise_CNN.glsl:~~/shaders/Anime4K_Restore_CNN_Moderate_M.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl" diff --git a/config/neofetch/config.conf b/config/neofetch/config.conf index a77a956..0d770c2 100644 --- a/config/neofetch/config.conf +++ b/config/neofetch/config.conf @@ -694,7 +694,7 @@ disk_display="off" # Values: 'ascii', 'caca', 'chafa', 'jlp2a', 'iterm2', 'off', # 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' # Flag: --backend -#image_backend="ascii" +image_backend="ascii" # Image Source # @@ -708,7 +708,7 @@ disk_display="off" # NOTE: 'auto' will pick the best image source for whatever image backend is used. # In ascii mode, distro ascii art will be used and in an image mode, your # wallpaper will be used. -#image_source="auto" +image_source="auto" # Ascii Options @@ -760,7 +760,7 @@ disk_display="off" # Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, # postmarketOS, and Void have a smaller logo variant. # Use '{distro name}_small' to use the small variants. -#ascii_distro="arch" +ascii_distro="arch" # Ascii Colors # @@ -771,7 +771,7 @@ disk_display="off" # Example: # ascii_colors=(distro) - Ascii is colored based on Distro colors. # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. -#ascii_colors=(distro) +ascii_colors=(distro) # Bold ascii logo # Whether or not to bold the ascii logo. @@ -779,7 +779,7 @@ disk_display="off" # Default: 'on' # Values: 'on', 'off' # Flag: --ascii_bold -#ascii_bold="on" +ascii_bold="on" # Image Options diff --git a/config/picom/picom.conf b/config/picom/picom.conf index 68d0f83..f2cfbca 100644 --- a/config/picom/picom.conf +++ b/config/picom/picom.conf @@ -291,12 +291,11 @@ blur-background-exclude = [ experimental-backends = true; backend = "glx"; #backend = "xrender"; -#backend = "xr_glx_hybrid"; # Enable/disable VSync. -vsync = false -#vsync = true +# vsync = false +vsync = true # Enable remote control via D-Bus. See the *D-BUS API* section below for more details. # dbus = false diff --git a/config/polybar/config b/config/polybar/config index e7d4f5c..e519a18 100644 --- a/config/polybar/config +++ b/config/polybar/config @@ -1,16 +1,16 @@ [pos] -offsetx = 24 -offsety = 24 +offsetx = 24 +offsety = 24 [color] -bg = #191919 -bga = #191919 -fg1 = #f58d44 -fg2 = #5f819d +bg = #191919 +bga = #191919 +fg1= #f58d44 +fg2 = #5f819d [bar/base] -monitor = ${env:MONITOR} +monitor = ${env:MONITOR} enable-ipc = true font-0 = mononoki:style=Regular:pixelsize=11;3 @@ -18,34 +18,34 @@ font-1 = mononoki:style=Regular:pixelsize=15;4 font-2 = mononoki:style=Regular:pixelsize=19;5 font-3 = mononoki:style=Regular:pixelsize=11;3 font-4 = MesloLGM Nerd Font Mono:style=Regular:pixelsize=14;2 -font-5 = Noto Sans Mono CJK TC:style=Medium,Regular;pixelsize=10;2 +font-5 = Noto Sans Mono CJK TC:style=Medium,Regular;pixelsize=10;2 height = 25 background = ${color.bga} -module-margin = 1 +module-margin = 1 wm-restack = bspwm radius = 0 foreground = ${color.fg1} -padding-right = 1 +padding-right = 1 [bar/wsonly] -inherit = bar/base -width = 100% +inherit = bar/base +width = 100% modules-left = workspaces -modules-right = time +modules-right = time [bar/ws] inherit = bar/base width = 100% offset-x = 0 modules-left = workspaces xwindow -modules-right = mpd temperature memory wlan battery pulseaudio microphone time -tray-position = right -background = ${color.bga} -border-size = 0 -fg = ${color.fg1} +modules-right = mpd temperature memory wlan battery pulseaudio microphone time +tray-position = right +background = ${color.bga} +border-size = 0 +fg = ${color.fg1} [module/wsnumber] @@ -63,24 +63,22 @@ type = internal/xwindow label = %title:0:40:% [module/workspaces] -type = internal/xworkspaces +type = internal/xworkspaces -pin-workspaces = true +pin-workspaces = true -enable-click = true -enable-scroll = true +enable-click = true +enable-scroll = true -format = -format-padding = 0 -label-monitor = %name% -label-active = %{T2}雷%{T-} -label-active-padding = 1 +format = +format-padding = 0 +label-monitor = %name% +label-active = %{T2}雷%{T-} +label-active-padding = 1 label-occupied = %{T2}ﲭ%{T-} label-occupied-padding = 1 label-empty = %{T2}ﱤ%{T-} label-empty-padding = 1 -label-urgent = %{T2}ﲭ%{T-} -label-urgent-padding = 1 [module/time] @@ -96,13 +94,13 @@ type = internal/mpd host = 127.0.0.1 port = 6600 -format-online = -label-song = %title% +format-online = +label-song = %title% -bar-progress-width = 12 -bar-progress-indicator = | -bar-progress-fill = ─ -bar-progress-empty = ─ +bar-progress-width = 12 +bar-progress-indicator = | +bar-progress-fill = ─ +bar-progress-empty = ─ format-online-padding = 0 @@ -111,11 +109,11 @@ format-offline-padding = 0 label-song-maxlen = 40 label-song-ellipsis = true -icon-play =  -bar-empty = ─ -icon-pause =  -icon-prev =  -icon-next =  +icon-play =  +bar-empty = ─ +icon-pause =  +icon-prev =  +icon-next =  [module/pulseaudio] @@ -133,71 +131,71 @@ ramp-volume-2 = "" label-muted = "%{T3} %{T-}--%" [module/microphone] -type = custom/script -exec = pactl list sources | grep -qi 'Mute: yes' && echo "" || echo "" -interval = 1 -click-left = pactl list sources | grep -qi 'Mute: yes' && pactl set-source-mute 2 false || pactl set-source-mute 2 true +type = custom/script +exec = pactl list sources | grep -qi 'Mute: yes' && echo "" || echo "" +interval = 1 +click-left = pactl list sources | grep -qi 'Mute: yes' && pactl set-source-mute 2 false || pactl set-source-mute 2 true [module/vpn] -type = custom/script -exec = echo vpn -exec-if = pgrep -x openvpn -interval = 5 -format-underline = #268bd2 -format-prefix = "🖧 " -format-prefix-foreground = #5b +type = custom/script +exec = echo vpn +exec-if = pgrep -x openvpn +interval = 5 +format-underline = #268bd2 +format-prefix = "🖧 " +format-prefix-foreground = #5b [module/temperature] -type = custom/script -exec = sensors | awk '/^Tctl:/ { print substr($2, 2) }' -format-prefix = " " -interval = 1 +type = custom/script +exec = sensors | awk '/^Tctl:/ { print substr($2, 2) }' +format-prefix = " " +interval = 1 [module/memory] -type = custom/script -exec = free -h | awk '/^Mem:/ {print $3 "/" $2}' -interval = 1 -format-prefix = "力 " +type = custom/script +exec = free -h | awk '/^Mem:/ {print $3 "/" $2}' +interval = 1 +format-prefix = "力 " [module/battery] -type = internal/battery -full-at = 99 -battery = BAT1 -adapter = ADP1 +type = internal/battery +full-at = 99 +battery = BAT1 +adapter = ADP1 -poll-interval = 3 -time-format = %H:%M +poll-interval = 3 +time-format = %H:%M -format-charging = -format-discharging = +format-charging = +format-discharging = -label-charging = %percentage%% -label-discharging = %percentage%% -label-full = %percentage%% +label-charging = -%percentage%% +label-discharging = -%percentage%% +label-full = %percentage%% -ramp-capacity-0 =  -ramp-capacity-1 =  -ramp-capacity-2 =  -ramp-capacity-3 =  -ramp-capacity-4 =  +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  -animation-charging-0 =  -animation-charging-1 =  -animation-charging-2 =  -animation-charging-3 =  -animation-charging-4 =  +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  animation-charging-framerate = 750 [module/network] -type = internal/network -interface = wlan0 -udspeed-minwidth = 5 -accumulate-stats = true -unknown-as-up = true -format-connected = -format-disconnected = +type = internal/network +interface = wlan1 +udspeed-minwidth = 5 +accumulate-stats = true +unknown-as-up = true +format-connected = +format-disconnected = -format-packetloss = +format-packetloss = -label-connected = %essid% +label-connected = %essid% diff --git a/config/polybar/launch.sh b/config/polybar/launch.sh index ca8d77e..98395fc 100755 --- a/config/polybar/launch.sh +++ b/config/polybar/launch.sh @@ -6,4 +6,19 @@ killall -q polybar # Wait until the processes have been shut down while pgrep -u $UID -x polybar >/dev/null; do sleep 0.1; done +# Launch Polybar, using default config location ~/.config/polybar/config +#polybar music & + +#MONITOR=DP-0 polybar --reload wsonly & + +export MONITOR=DP-1 +polybar wsonly & + +export MONITOR=DP-4 +polybar wsonly & + +export MONITOR=HDMI-0 +polybar wsonly & + +export MONITOR=DP-2 polybar ws & diff --git a/config/sxhkd/sxhkdrc b/config/sxhkd/sxhkdrc index 80feba1..3d2e4c9 100644 --- a/config/sxhkd/sxhkdrc +++ b/config/sxhkd/sxhkdrc @@ -17,6 +17,10 @@ super + ctrl + alt + f {XF86AudioMute} amixer -D pulse set Master 1+ toggle +#backlight +{XF86MonBrightnessUp, XF86MonBrightnessDown} + xbacklight -{inc,dec} 5 + # runner super + r rofi -show drun -show-icons @@ -48,10 +52,6 @@ super + v super + b $BROWSER -# open xlinks -super + x - $HOME/.scripts/links-launcher - # open email super + m $EMAIL_CLIENT @@ -151,7 +151,7 @@ super + period # file search and open super + slash - websearch + bspc rule -a \* -o state=floating && $TERMINAL -e ~/.scripts/fzf_menu.sh shift + super + slash bspc rule -a \* -o state=floating && $TERMINAL -e ~/.scripts/fzf_menu.sh @@ -242,7 +242,7 @@ super + ctrl + {_, shift +} Tab bspc node -f {next,prev}.local.!hidden.window # focus the next/previous desktop in the current monitor -super + {Left,Right} +super + ctrl + {Left,Right} bspc desktop -f {prev,next}.local # focus the older or newer node in the focus history @@ -279,6 +279,6 @@ super + alt + shift + {h,j,k,l} bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} # move a floating window -ctrl + super + {Left,Down,Up,Right} +super + {Left,Down,Up,Right} bspc node -v {-20 0,0 20,0 -20,20 0} diff --git a/config/vim/plugin/hare.vim b/config/vim/plugin/hare.vim deleted file mode 100644 index ad8cd3a..0000000 --- a/config/vim/plugin/hare.vim +++ /dev/null @@ -1,78 +0,0 @@ -" Vim syntax file -" Language: Hare - -if exists("b:current_syntax") - finish -endif - -syn case match -syn keyword hareKeyword let const fn def type static export defer _ -syn keyword hareBranch for return break continue yield -syn keyword hareConditional if else match switch -syn keyword hareLabel case -syn keyword hareBuiltin len offset free alloc assert append abort delete insert -syn keyword hareBuiltin vastart vaarg vaend -syn keyword hareOperator is as -syn match hareType "\vsize((\_\s|//.*)*\()@!" -syn match hareBuiltin "\vsize((\_\s|//.*)*\()@=" -syn match harePreProc "^use .*;" -syn match harePreProc "@[a-z]*" -syn match hareOperator "\.\.\." "\.\." - -syn region hareString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ -syn region hareString start=+`+ end=+`+ - -"adapted from c.vim -"integer number, or floating point number without a dot and with "f". -syn match hareNumbers display transparent "\v<\d" contains=hareNumber,hareOctal,hareBinary,hareFloat -syn match hareNumber display contained "\v\d+(e[-+]?\d+)?(z|[iu](8|16|32|64)?)?" -"hex number -syn match hareNumber display contained "\v0x\x+(z|[iu](8|16|32|64)?)?" -"octal number -syn match hareOctal display contained "\v0o\o+(z|[iu](8|16|32|64)?)?" -"binary number -syn match hareBinary display contained '\v0b[01]+(z|[iu](8|16|32|64)?)?' -syn match hareFloat display contained "\v\d+(e[-+]?\d+)?(f32|f64)" -"floating point number, with dot, optional exponent -syn match hareFloat display contained "\v\d+\.\d+(e[-+]?\d+)?(f32|f64)?" - -syn match hareSpaceError display excludenl "\v\s+$" -syn match hareSpaceError display "\v +\t"me=e-1 - -syn keyword hareTodo contained TODO FIXME XXX -syn region hareComment start="//" end="$" contains=hareTodo,@Spell - -syn keyword hareType u8 u16 u32 u64 i8 i16 i32 i64 -syn keyword hareType uint int -syn keyword hareType uintptr -syn keyword hareType f32 f64 -syn keyword hareType bool -syn keyword hareType char str -syn keyword hareType void -syn keyword hareType struct union -syn keyword hareType enum -syn keyword hareType nullable -syn keyword hareType rune -syn keyword hareType valist -syn keyword hareNull null -syn keyword hareBoolean true false - -hi def link hareBinary Number -hi def link hareBoolean Boolean -hi def link hareBranch Repeat -hi def link hareBuiltin Function -hi def link hareComment Comment -hi def link hareConditional Conditional -hi def link hareFloat Number -hi def link hareKeyword Keyword -hi def link hareLabel Label -hi def link hareNull Constant -hi def link hareNumber Number -hi def link hareOctal Number -hi def link hareOperator Operator -hi def link harePreProc PreProc -hi def link hareString String -hi def link hareTodo Todo -hi def link hareType Type -hi def link hareSpaceError Error -" vim: tabstop=8 shiftwidth=2 expandtab diff --git a/deploy.sh b/deploy.sh index 1f7aab7..71c7540 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,11 +1,11 @@ #!/bin/sh -configurations="iocane bg bspwm cava neofetch mpd mpv ncmpcpp vim sxhkd polybar picom rofi user-dirs.dirs gtk-3.0" +configurations=( iocane bg bspwm cava neofetch mpd mpv ncmpcpp vim sxhkd polybar picom rofi user-dirs.dirs gtk-3.0) save () { mkdir config - for i in ${configurations}; do + for i in "${configurations[@]}"; do cp -r "$HOME/.config/$i" config/ done @@ -13,8 +13,8 @@ save () { cp -r "$HOME/.scripts" scripts cp $HOME/.profile profile - cp $HOME/.mkshrc mkshrc - cp $HOME/.sh_aliases sh_aliases + cp $HOME/.bashrc bashrc + cp $HOME/.bash_aliases bash_aliases cp $HOME/.Xdefaults Xdefaults cp $HOME/.xinitrc xinitrc @@ -50,14 +50,14 @@ load () { printf "\033[31mWARNING THIS WILL REPLACE EXISTING CONFIGURATIONS\n\033[0mTo proceed type 'confirm': " read confirmation - if [ $confirmation = "confirm" ]; then + if [[ $confirmation == "confirm" ]]; then mkdir -p $HOME/.config cp -r config/* $HOME/.config mkdir -p $HOME/.scripts cp -r scripts/* $HOME/.scripts - cp mkshrc $HOME/.mkshrc - cp sh_aliases $HOME/.sh_aliases + cp bashrc $HOME/.bashrc + cp bash_aliases $HOME/.bash_aliases cp Xdefaults $HOME/.Xdefaults cp xinitrc $HOME/.xinitrc diff --git a/mkshrc b/mkshrc deleted file mode 100644 index 8a9023f..0000000 --- a/mkshrc +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/mksh -case $- in - *i*) ;; - *) return;; -esac - -export VIMINIT="source ~/.config/vim/vimrc" -export NVIMINIT="source ~/.config/vim/vimrc" - -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias dir='dir --color=auto' - alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -[ -f ~/.sh_aliases ] && . ~/.sh_aliases -[ -f ~/.profile ] && . ~/.profile - -# parse the current branch and status of git to be added to the prompt -function parse_git_branch() { - BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` - if [ ! "${BRANCH}" == "" ] - then - STAT=`parse_git_dirty` - echo " [${BRANCH}${STAT}]" - else - echo "" - fi -} - -function parse_git_dirty { - status=`git status 2>&1 | tee` - dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"` - untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"` - ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"` - newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"` - renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"` - deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"` - bits='' - [ "${renamed}" == "0" ] && bits=">${bits}" - [ "${ahead}" == "0" ] && bits="*${bits}" - [ "${newfile}" == "0" ] && bits="+${bits}" - [ "${untracked}" == "0" ] && bits="?${bits}" - [ "${deleted}" == "0" ] && bits="x${bits}" - [ "${dirty}" == "0" ] && bits="!${bits}" - [ ! "${bits}" == "" ] && echo " ${bits}" || echo "" -} - -bind '^L=clear-screen' - -export PS1=$(echo -e "\e[0;97m\${PWD/#\$HOME/\~}\e[0;37m\`parse_git_branch\` > \e[0;0m") diff --git a/profile b/profile index 07ee1a8..10981a1 100644 --- a/profile +++ b/profile @@ -1,17 +1,46 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. -[ -n "$BASH_VERSION" ] && [ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 -[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH" -[ -d "$HOME/.local/bin" ] && PATH="$HOME/.local/bin:$PATH" -[ -d "$HOME/.scripts" ] && PATH="$HOME/.scripts:$PATH" +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi -alias editor=vim +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi + + +if [ -d "$HOME/.scripts" ] ; then + PATH="$HOME/.scripts:$PATH" +fi + +#export LC_ALL="C" +#export TERMINAL="konsole --hide-menubar --profile qtile" +alias editor=vim export TERMINAL="urxvt" -export BROWSER="/usr/bin/chromium-browser" +export BROWSER="/usr/bin/chromium" export FILE_MANAGER="/usr/bin/thunar" export EMAIL_CLIENT="/usr/bin/thunderbird" +export BLOG_DIR="/home/david/docs/proj/blog" export EDITOR="/usr/bin/vim" -[ "$(fgconsole 2>/dev/null)" = "1" ] && exec startx -- vt1 &> /dev/null +export ANDROID_SDK_ROOT=/opt/android-sdk +[[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx -- vt1 &> /dev/null diff --git a/scripts/bg.sh b/scripts/bg.sh index decf4f1..747aa20 100755 --- a/scripts/bg.sh +++ b/scripts/bg.sh @@ -1,3 +1,2 @@ #!/bin/sh -feh --force-aliasing --bg-tile ~/.config/dither.png -#feh --force-aliasing --bg-fill ~/.config/bg +feh --force-aliasing --bg-fill ~/.config/bg diff --git a/scripts/cinema.sh b/scripts/cinema.sh index 46c7082..c453260 100755 --- a/scripts/cinema.sh +++ b/scripts/cinema.sh @@ -1,3 +1,3 @@ #!/bin/sh -MAIN_DP=DP-0; +MAIN_DP=DP-2; v=$(xrandr --current --verbose | grep "Brightness" | cut -f2 -d " " | tr '\n' '*' | rev | cut -c 2- | rev | sed -e "s/$/==1/" | bc -l | grep -q 0 && echo 1 || echo 0); xrandr | grep " connected" | cut -f1 -d " " | while read -r line; do echo $line | grep -q $MAIN_DP && : || xrandr --output $line --brightness $v; done diff --git a/scripts/fzf-bash-completion.sh b/scripts/fzf-bash-completion.sh index 337e908..9a63e15 100644 --- a/scripts/fzf-bash-completion.sh +++ b/scripts/fzf-bash-completion.sh @@ -42,9 +42,9 @@ _fzf_bash_completion_flatten_subshells() { printf '%s\n' "$line$buffer" buffer= fi - done < <(cat) + done < <(tac) printf '%s\n' "$buffer" - ) | cat + ) | tac } _fzf_bash_completion_find_matching_bracket() { diff --git a/scripts/gamma.sh b/scripts/gamma.sh index cd9433f..0117dd5 100755 --- a/scripts/gamma.sh +++ b/scripts/gamma.sh @@ -1,5 +1,5 @@ #!/bin/bash -MAIN_DP=DP-0; +MAIN_DP=DP-2; v=$1 diff --git a/scripts/links-launcher b/scripts/links-launcher deleted file mode 100755 index eef2a2f..0000000 --- a/scripts/links-launcher +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -startpage=${1:-https://search.davidovski.xyz/} - -bin="$(which links || which xlinks)" - -[ "${#DISPLAY}" = "0" ] || opts="-g -html-g-text-color 0xf58f44 -html-g-background-color 0x191919 -font /home/david/.fonts/ttf-mononoki/mononoki-Regular.ttf" - -$bin $opts $startpage - diff --git a/scripts/lock b/scripts/lock index d0b8d36..01820fb 100755 --- a/scripts/lock +++ b/scripts/lock @@ -1,3 +1,2 @@ #!/bin/sh -#i3lock-fancy -p -t '' -slock +i3lock-fancy -p -t '' diff --git a/scripts/powermenu b/scripts/powermenu index a1ac5f4..49b8f3e 100755 --- a/scripts/powermenu +++ b/scripts/powermenu @@ -1,3 +1,2 @@ #!/bin/sh - printf "suspend\nreboot\npoweroff\nhibernate" | rofi -dmenu -p "systemctl" | xargs -r systemctl diff --git a/scripts/record_window.sh b/scripts/record_window.sh deleted file mode 100755 index 841b756..0000000 --- a/scripts/record_window.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -info=/tmp/wminfo - -xwininfo > /tmp/wminfo - -geom=$(cat $info | grep "geometry" | cut -d' ' -f4) - -width=$(cat $info | grep Width | cut -d' ' -f4) -height=$(cat $info | grep Height | cut -d' ' -f4) - -size="${width}x${height}" -position=+$(echo $geom | cut -d'+' -f2- | sed "s/+/,/g") - -filename=$(date +"$HOME/pics/screenshot/%F_%T.mp4") - -echo $size and $position -ffmpeg -y -f x11grab -video_size $size -i $position $filename - -rm $info diff --git a/scripts/screenshot b/scripts/screenshot index d0df6a8..626671c 100755 --- a/scripts/screenshot +++ b/scripts/screenshot @@ -1,2 +1,2 @@ #!/bin/bash -maim -su /dev/stdout | tee $(date +"$HOME/pics/screenshot/%F_%T.png") | xclip -selection clipboard -t image/png +maim -su /dev/stdout | tee >(xclip -selection clipboard -t image/png) > $(date +"$HOME/pics/screenshot/%F_%T.png") diff --git a/scripts/tablet b/scripts/tablet index ec3eefa..3b49064 100755 --- a/scripts/tablet +++ b/scripts/tablet @@ -9,10 +9,10 @@ tablet_ratio = (lambda s: float(s[0]) / float(s[1]))(sys.argv[4].split(":")) if #Layout of screens: (x, y, w, h) screens = [ - (0, 0, 1280, 1024), - (1280, 0, 2560, 1440), (3840, 0, 1080, 1920), + (1280, 0, 2560, 1440), (4920, 0, 1080, 1920), + (0, 0, 1280, 1024), ] #TODO find this with xrandr diff --git a/scripts/websearch b/scripts/websearch index 32d8773..996ddc3 100755 --- a/scripts/websearch +++ b/scripts/websearch @@ -1,17 +1,14 @@ #!/bin/sh -browser="links-launcher" -SEARCH_ENGINE="https://librex.beparanoid.de/search.php?q=" -SEARCH_HISTORY=$HOME/.local/share/search_history + +SEARCH_ENGINE="https://search.brave.com/search?q=" +SEARCH_HISTORY=/tmp/.search_history SEARCH=$(cat $SEARCH_HISTORY | dmenu -p "search") -echo "$SEARCH" >> $SEARCH_HISTORY +touch $SEARCH_HISTORY -query=$(echo $SEARCH | sed 's/ /+/g') +cat <<< "$SEARCH +$(cat $SEARCH_HISTORY)" > $SEARCH_HISTORY -echo $query | grep -q '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' && { - links-launcher "$query" -} || { - links-launcher "$SEARCH_ENGINE$query" -} +brave "$SEARCH_ENGINE$SEARCH" diff --git a/xinitrc b/xinitrc index acf3072..0d5e974 100644 --- a/xinitrc +++ b/xinitrc @@ -1,3 +1,5 @@ xrdb ~/.Xdefaults +eval $(gnome-keyring-daemon --start) +export SSH_AUTH_SOCK exec bspwm