Merge remote-tracking branch 'LukeSmithxyz/master'

This commit is contained in:
Vlad Doster 2019-12-21 00:53:55 -05:00
commit 494c02883c
19 changed files with 636 additions and 63 deletions

34
.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# If refreshing bspwm, remove all previous rules to prevent doubling up.
bspc rule -r "*"
# We look for a non-laptop monitor to use for default, but use the laptop
# screen (LVDS) if there's nothing else. This is because I assume that if you
# have an extra screen attached to a laptop, you want to use that.
mainmonitor="$(bspc query --monitors --names | grep -v LVDS | head -n 1)"
if ! echo "$mainmonitor" | grep LVDS >/dev/null 2>&1; then
xrandr --output "$mainmonitor" --auto --output LVDS1 --off
fi
# Start workspaces on the main monitor.
bspc monitor $mainmonitor -d 1 2 3 4 5 6 7 8 9 10
bspc desktop -f 1
# If you want a multi-monitor display or something else, I leave that to you to
# arrange. I have this sensible default for most people's use cases.
bspc config border_width 3
bspc config window_gap 15
bspc config top_padding 24 # top_padding I set equal to polybar's height
bspc config focus_follows_pointer true
dropdownname="dropdown"
bspc query -N -n .hidden >/dev/null || setsid $TERMINAL -n "$dropdownname" -e dropdown >/dev/null 2>&1 &
bspc rule -a St:$dropdownname hidden=on
bspc rule -a St:$dropdownname sticky=on
bspc rule -a St:$dropdownname state=floating
bspc config external_rules_command "$(which floaters)"

View File

@ -2,7 +2,7 @@ bf ~/.config/files
bd ~/.config/directories
bw ~/.config/bookmarks
cfa ~/.config/aliasrc
cfz ~/$ZDOTDIR/.zshrc
cfz $ZDOTDIR/.zshrc
cfv ~/.config/nvim/init.vim
cfm ~/.config/mutt/muttrc
cfd ~/.Xdefaults

View File

@ -15,7 +15,7 @@ cmd open ${{
text/troff) man ./ $f;;
text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;;
image/*) rotdir $f | setsid sxiv -aio 2>&1 | lf-select & ;;
image/*) rotdir $f | setsid sxiv -aio 2>/dev/null | lf-select & ;;
audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;;
video/*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f -quiet >/dev/null 2>&1 & ;;
application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;;
@ -49,6 +49,10 @@ cmd copyto ${{
notify-send "📋 File(s) copied." "File(s) copies to $dest."
}}
cmd bulkrename ${{
vidir
}}
# Bindings
map c $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)"
map <c-f> $lf -remote "send $id select '$(fzf)'"
@ -61,6 +65,7 @@ map M moveto
map a push %mkdir<space>
map r push :rename<space>
map R $lf -remote "send $id push :rename<space>$f"
map b bulkrename
map <c-r> reload
map <enter> shell
map x $$f

View File

@ -91,10 +91,6 @@ set clipboard+=unnamedplus
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
autocmd BufRead,BufNewFile *.tex set filetype=tex
" Copy selected text to system clipboard:
vnoremap <C-c> "+y
map <C-p> "+P
" Save file as sudo on files that require root permission
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!

413
.config/polybar/config Normal file
View File

@ -0,0 +1,413 @@
; vim:ft=dosini
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
black = ${xrdb:color0:#1d2021}
darkred = ${xrdb:color1:#cc241d}
darkgreen = ${xrdb:color2:#98971a}
darkyellow = ${xrdb:color3:#d79921}
darkblue = ${xrdb:color4:#458588}
darkmagenta = ${xrdb:color5:#b16286}
darkcyan = ${xrdb:color6:#689d6a}
lightgray = ${xrdb:color7:#a89984}
gray = ${xrdb:color8:#928374}
red = ${xrdb:color9:#fb4934}
green = ${xrdb:color10:#b8bb26}
yellow = ${xrdb:color11:#fabd2f}
blue = ${xrdb:color12:#83a598}
magenta = ${xrdb:color13:#d3869b}
cyan = ${xrdb:color14:#8ec07c}
white = ${xrdb:color15:#ebdbb2}
background = ${xrdb:color256:#1d2021}
foreground = ${xrdb:color257:#ebdbb2}
[bar/default]
;monitor = ${env:MONITOR:LVDS-1}
;monitor = ${env:MONITOR:HDMI-1}
enable-ipc = true
width = 100%
height = 24
;offset-x = 1%
;offset-y = 1%
;radius = 6.0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = {$xrdb:red}
border-size = 0
border-color = ${colors.white}
padding-left = 0
padding-right = 0
module-margin-left = 1
module-margin-right = 1
font-0 = mono:pixelsize=9;1
font-1 = Inconsolata Nerd Font:size=8;1
font-2 = Noto Color Emoji:scale=10:style=Regular;2
font-3 = Symbola:pixelsize=9;1
; Other modules: xkeyboard filesystem xbacklight backlight-acpi cpu memory temperature powermenu weather
modules-left = bspwm xwindow
;modules-center =
modules-right = mpd volume mutt-wizard wlan eth battery date
tray-position = right
tray-padding = 0
wm-restack = bspwm
;override-redirect = true
scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev
[module/mutt-wizard]
type = custom/script
exec = mailbox
interval = 5
format-prefix = " "
format-underline = ${colors.red}
click-left = st -e neomutt
[module/weather]
type = custom/script
exec = weather
interval = 5000
;format-underline =
[module/xwindow]
type = internal/xwindow
label = %title:0:45:...%
format-foreground = ${colors.blue}
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.gray}
format-prefix-underline = ${colors.darkmagenta}
label-layout = %layout%
label-layout-underline = ${colors.darkmagenta}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.darkmagenta}
label-indicator-underline = ${colors.darkmagenta}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
label-mounted-underline = ${colors.cyan}
label-mounted = /: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.gray}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-foreground = ${colors.black}
label-focused-background = ${colors.blue}
label-focused-underline= ${colors.yellow}
label-focused-padding = 1
label-occupied = %index%
label-occupied-underline = ${colors.blue}
label-occupied-padding = 1
label-urgent = %index%!
label-urgent-background = ${colors.red}
label-urgent-padding = 1
label-empty = %index%
label-empty-foreground = ${colors.lightgray}
label-empty-padding = 1
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = ${colors.white}
label-mode-background = ${colors.darkyellow}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors:black}
;label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
[module/mpd]
type = internal/mpd
format-online = <label-song> <label-time>
click-left = st -e ncmpcpp
click-right = mpc toggle
label-song = %artist% - %title%
label-song-maxlen = 70
label-song-ellipsis = true
format-paused-foreground = ${colors.gray}
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = ﯧ
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #ff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.gray}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "🌡 "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.red}
label = %percentage%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = "🧠 "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.darkcyan}
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0
format-connected = 直 <label-connected>
format-connected-underline = ${colors.darkmagenta}
label-connected = %essid%
;format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
label-disconnected = 睊no wifi
label-disconnected-foreground = ${colors.gray}
; <ramp-signal>
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.gray}
[module/eth]
type = internal/network
interface = enp0s25
interval = 3.0
format-connected-underline = ${colors.darkgreen}
;format-connected-underline = ${colors.green}
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.gray}
label-connected = %local_ip%
;format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected =  %ifname%
label-disconnected-foreground = ${colors.gray}
[module/date]
type = internal/date
interval = 60
date = "%Y %b %d (%a)"
time = "%I:%M%p"
# If you're not living in a country where AM and PM is used you can add -alt to the time above this line and comment it using ;, then you can remove the -alt to the time under this line and uncomment it.
;time-alt = " at %H:%M"
;time-alt = %H:%M:%S
;time-alt = %H:%M:%S
format-prefix = " "
format-prefix-foreground = ${colors.gray}
format-underline = ${colors.blue}
label = %date% %time%
[module/volume]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = 
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.gray}
label-muted = muted
bar-volume-width = 10
bar-volume-foreground-0 = ${colors.blue}
bar-volume-foreground-1 = ${colors.blue}
bar-volume-foreground-2 = ${colors.green}
bar-volume-foreground-3 = ${colors.green}
bar-volume-foreground-4 = ${colors.green}
bar-volume-foreground-5 = ${colors.yellow}
bar-volume-foreground-6 = ${colors.red}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = =
bar-volume-fill-font = 2
bar-volume-empty = =
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.gray}
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 98
;format-charging = Charging... <label-charging>
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.darkyellow}
;format-discharging = <label-discharging>
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.gray}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.gray}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.gray}
animation-charging-framerate = 500
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = ${colors.red}
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.darkmagenta}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 
ramp-foreground = ${colors.gray}
[module/powermenu]
type = custom/menu
format-spacing = 1
label-open = 
label-open-foreground = ${colors.darkmagenta}
label-close =  cancel
label-close-foreground = ${colors.darkmagenta}
label-separator = |
label-separator-foreground = ${colors.gray}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
[global/wm]
margin-top = 5
margin-bottom = 5

View File

@ -6,6 +6,7 @@
# You always need to import ranger.api.commands here to get the Command class:
from ranger.api.commands import *
from ranger.core.loader import CommandLoader
# A simple command for demonstration purposes follows.
#------------------------------------------------------------------------------
@ -88,6 +89,8 @@ class fzf_select(Command):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
# fzf_locate
class fzf_locate(Command):
"""
@ -114,6 +117,7 @@ class fzf_locate(Command):
else:
self.fm.select_file(fzf_file)
class fzf_bring(Command):
"""
:fzf_bring
@ -124,6 +128,7 @@ class fzf_bring(Command):
"""
def execute(self):
import subprocess
import shutil
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
@ -136,15 +141,9 @@ class fzf_bring(Command):
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
shutil.move(fzf_file, self.fm.thisdir.path)
import os
from ranger.core.loader import CommandLoader
class compress(Command):
def execute(self):
""" Compress marked files to current directory """
@ -176,11 +175,6 @@ class compress(Command):
return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension]
import os
from ranger.core.loader import CommandLoader
class extracthere(Command):
def execute(self):
""" Extract copied files to current directory """
@ -212,5 +206,3 @@ class extracthere(Command):
obj.signal_bind('after', refresh)
self.fm.loader.add(obj)

View File

@ -91,7 +91,7 @@ super + {_,shift +} bracketright
super + {_,shift +} bracketleft
mpc seek -{10,120}
# Increase volume
super + {equal,plus}
super {_,shift +} + plus
amixer sset Master {5,15}%+; pkill -RTMIN+10 $STATUSBAR
# Decrease volume
super {_,shift +} + minus

View File

@ -0,0 +1,33 @@
highlight clear
highlight Win cterm=none ctermfg=white ctermbg=black
highlight Directory cterm=bold ctermfg=cyan ctermbg=default
highlight Link cterm=bold ctermfg=blue ctermbg=default
highlight BrokenLink cterm=bold ctermfg=red ctermbg=default
highlight Socket cterm=bold ctermfg=magenta ctermbg=default
highlight Device cterm=bold ctermfg=red ctermbg=default
highlight Fifo cterm=bold ctermfg=cyan ctermbg=default
highlight Executable cterm=bold ctermfg=green ctermbg=default
highlight Selected cterm=bold ctermfg=magenta ctermbg=default
highlight CurrLine cterm=bold,reverse ctermfg=default ctermbg=default
highlight TopLine cterm=none ctermfg=black ctermbg=white
highlight TopLineSel cterm=bold ctermfg=black ctermbg=default
highlight StatusLine cterm=bold ctermfg=black ctermbg=blue
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Border cterm=none ctermfg=white ctermbg=black
highlight JobLine cterm=bold,reverse ctermfg=black ctermbg=white
highlight SuggestBox cterm=bold ctermfg=default ctermbg=default
highlight CmpMismatch cterm=bold ctermfg=white ctermbg=red
highlight AuxWin cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight TabLine cterm=none ctermfg=white ctermbg=black
highlight TabLineSel cterm=bold,reverse ctermfg=default ctermbg=default
highlight User1 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User2 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User3 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User4 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User5 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User6 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User7 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User8 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default
highlight User9 cterm=bold,underline,reverse,standout,italic ctermfg=default ctermbg=default

75
.config/vifm/vifmrc Normal file
View File

@ -0,0 +1,75 @@
" vim: filetype=vifm
source ~/.config/vifm/vifmshortcuts
set vicmd=$EDITOR
set syscalls
set nofollowlinks
set sortnumbers
set undolevels=100
set wildmenu
set wildstyle=popup
set scrolloff=4
set ignorecase
set smartcase
set nohlsearch
set incsearch
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
colorscheme luke
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <C-o> <C-w>o
map <C-s> <C-w>s
map <C-v> <C-w>v
map R :restart<CR>
map x :!sxiv -ft * 2>/dev/null &<CR>
nnoremap o :file &<cr>
map E :!$EDITOR %f<CR>
map mkd :mkdir<space>
map bg :!setbg %f &<CR>
map X :!ext %f &<CR>
nnoremap s :shell<cr>
nnoremap w :view<cr>
vnoremap w :view<cr>gv
nnoremap yd :!echo %d | xclip %i<cr>
nnoremap yf :!echo %c:p | xclip %i<cr>
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
nnoremap ,w :set wrap!<cr>
nmap <space> tj
nmap q ZQ
fileview */ tree %c -L 1 --dirsfirst
fileview ../ tree %c -L 1 --dirsfirst
fileviewer *.html w3m -dump %c
filextype *.html,*.htm firefox %f 2>/dev/null &
fileviewer *.docx docx2txt %c -
fileviewer *.odt odt2txt %c -
filetype *.csv,*.xlsx sc-im %c
fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c
filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu,*.epub zathura %f 2>/dev/null &,
fileviewer *.pdf pdftotext -l 1 -nopgbrk %c -
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.qt,*.divx,*.as[fx],*mp3,*.flac file
filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) %f 2>/dev/null &,
fileview *.zip,*.rar,*.tar.gz atool -l %f
filetype *.zip,*.rar,*.tar.gz ext %f
fileviewer *.[1-8] man ./%c | col -b
filetype *.[1-8] man ./%c
fileviewer *.jpg,*.jpeg,*.png,*.ico vifmimg draw %px %py %pw %ph %c %pc vifmimg clear
filextype *.bmp,*.jpg,*.jpeg,*.png,*.ico,*.gif,*.xpm rotdir %f 2>/dev/null | sxiv -ia 2>/dev/null &
filextype *.svg inkscape %f 2>/dev/null &
filextype *.xcf gimp %f 2>/dev/null &
set vifminfo=dhistory,chistory,tui,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks

View File

@ -26,7 +26,7 @@ case "$file" in
*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;;
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;;
*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;;
*\.rmd) echo "require(rmarkdown); rmarkdown::render('$file', quiet=TRUE)" | R -q --vanilla ;;
*\.tex) textype "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;;

11
.local/bin/launch_polybar Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env sh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done
for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done
echo "Bars launched..."

9
.local/bin/lf-select Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# Reads file names from stdin and selects them in lf.
while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
done

View File

@ -29,4 +29,4 @@ fi
[ "$status" = "Charging" ] && color="#ffffff"
printf "<span color='%s'>%s%s%s</span>\n" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/🔋/;s/Not Charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"
printf "<span color='%s'>%s%s%s</span>\n" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"

View File

@ -3,8 +3,8 @@
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e alsamixer & ;;
2) amixer sset Master toggle ;;
4) amixer sset Master 5%+ ;;
5) amixer sset Master 5%- ;;
4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
5) amixer sset Master 5%- >/dev/null 2>/dev/null ;;
3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute.
- Scroll to change."

13
.local/bin/vifmimg Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
[ -z "$FIFO_UEBERZUG" ] && exit
readonly ID_PREVIEW="preview"
if [ "$1" = "draw" ]; then
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="${PWD}/$6") > "$FIFO_UEBERZUG"
elif [ "$1" = "videopreview" ]; then
[ ! -f "/tmp/$6.png" ] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp/$6.png" -s 0 -q 10 &&
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="/tmp/$6.png") > "$FIFO_UEBERZUG"
else
declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") > "$FIFO_UEBERZUG"
fi

18
.local/bin/vu Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env sh
# This is a wrapper for vifm to allow ueberzug images.
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
cleanup() {
rm "$FIFO_UEBERZUG" 2>/dev/null
pkill -P $$ 2>/dev/null
}
rm "$FIFO_UEBERZUG" 2>/dev/null
mkfifo "$FIFO_UEBERZUG"
trap cleanup EXIT
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash &
vifm
cleanup

View File

@ -2,41 +2,6 @@
# xinitrc runs automatically when you run startx.
guesswm() {
# Here, LARBS decides whether to boot dwm or i3. It will boot what is manually
# set in ~/.local/share/larbs/wm, otherwise it will test to see if dwm is
# installed, in which case it will load dwm. It will assume i3 otherwise.
LARBSWM="$(cat ~/.local/share/larbs/wm 2>/dev/null)" ||
{ LARBSWM="$(type dwm >/dev/null 2>&1)" && LARBSWM="dwm" ;} ||
{ LARBSWM="$(type i3 >/dev/null 2>&1)" && LARBSWM="i3" ;}
# To be clear, you can run:
# echo dwm > ~/.local/share/larbs/wm
# to set dwm as your default LARBS WM (or echo i3 for i3).
# Here we start the window manager, whichever it's supposed to be.
# Note that we set the different status bar commands here too.
case "$LARBSWM" in
dwm)
export FILE="lf"
export STATUSBAR="dwmblocks"
startlarbs() { # The loop is just to enable dwm's "restart" feature (mod+F2).
while :; do
ssh-agent dwm || break
done ;}
;;
i3)
export FILE="ranger"
export STATUSBAR="i3blocks"
startlarbs() { exec i3 ;}
;;
*) echo "No valid LARBS window manager detected." ;;
esac ;}
guesswm
# There are some small but important commands that need to be run when we start
# the graphical environment. I keep those commands in ~/.xprofile because that
# file is run automatically if someone uses a display manager (login screen)
@ -45,4 +10,13 @@ guesswm
[ -f ~/.xprofile ] && . ~/.xprofile
startlarbs
# Your default LARBS WM is determined in your `~/.profile` on login. Here we
# run the proper command to run when the graphical environment starts.
case "$LARBSWM" in
dwm) while :; do
ssh-agent dwm || break
done ;;
i3) exec i3 ;;
*) echo "No valid LARBS window manager detected." ;;
esac

View File

@ -8,7 +8,7 @@ setbg & # set the background with the `setbg` script
xcompmgr & # xcompmgr for transparency
$STATUSBAR & # script for updating the status bar
dunst & # dunst for notifications
sxhkd & # Bind keys with sxhkd
sxhkd -m 1 & # Bind keys with sxhkd
xset r rate 300 50 & # Speed xrate up
unclutter & # Remove mouse when idle
mpd-module-update & # Check for when to update the mpd module

View File

@ -27,7 +27,7 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on [my
## Want even more?
My setup is pretty modular nowadays.
I use several suckless program that are meant to be configured and compiled by the user and I also have separate repos for some other things.
I use several suckless programs that are meant to be configured and compiled by the user and I also have separate repos for some other things.
Check out their links:
- [dwm](https://github.com/lukesmithxyz/dwm) (the window manager I usually use now which is fully compatible with this repo)