This commit is contained in:
drake-newell 2020-05-26 12:27:58 -07:00
commit 5cfc0b3318
83 changed files with 794 additions and 1009 deletions

View File

@ -1,21 +0,0 @@
# Find and use input "Microphone" for input
pcm.usb
{
type hw
card Microphone
}
pcm.!default
{
type asym
playback.pcm
{
# Use the dmix plug to allow multiple outputs.
type plug
slave.pcm "dmix"
}
capture.pcm
{
type plug
slave.pcm "usb"
}
}

View File

@ -1 +0,0 @@
../.config/wall.png

View File

@ -5,10 +5,9 @@ command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d"
# Verbosity and settings that you pretty much just always are going to want. # Verbosity and settings that you pretty much just always are going to want.
alias \ alias \
bat="cat /sys/class/power_supply/BAT?/capacity" \
cp="cp -iv" \ cp="cp -iv" \
mv="mv -iv" \ mv="mv -iv" \
rm="rm -v" \ rm="rm -vI" \
mkd="mkdir -pv" \ mkd="mkdir -pv" \
yt="youtube-dl --add-metadata -i" \ yt="youtube-dl --add-metadata -i" \
yta="yt -x -f bestaudio/best" \ yta="yt -x -f bestaudio/best" \
@ -34,13 +33,11 @@ alias \
p="sudo pacman" \ p="sudo pacman" \
xi="sudo xbps-install" \ xi="sudo xbps-install" \
xr="sudo xbps-remove -R" \ xr="sudo xbps-remove -R" \
xq="xbps-query" xq="xbps-query" \
z="zathura"
# This alias is important. It enables the `pauseallmpv` command.
alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)"
# Some other stuff
alias \ alias \
magit="nvim -c MagitOnly" \ magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ~/.config/shortcutrc" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" \
weath="less -S ~/.local/share/weatherreport" \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \
tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" \

View File

@ -5,6 +5,7 @@ D ~/Downloads
m ~/Music m ~/Music
pp ~/Pictures pp ~/Pictures
vv ~/Videos vv ~/Videos
cf ~/.config cf ${XDG_CONFIG_HOME:-$HOME/.config}
sc ~/.local/bin cac ${XDG_CACHE_HOME:-$HOME/.cache}
sc ~/.local/bin
mn /mnt mn /mnt

View File

@ -1,15 +1,16 @@
bf ~/.config/files bf ${XDG_CONFIG_HOME:-$HOME/.config}/files
bd ~/.config/directories bd ${XDG_CONFIG_HOME:-$HOME/.config}/directories
bw ~/.config/bookmarks bw ${XDG_CONFIG_HOME:-$HOME/.config}/bookmarks
cfa ~/.config/aliasrc cfa ${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc
cfz $ZDOTDIR/.zshrc cfz $ZDOTDIR/.zshrc
cfv ~/.config/nvim/init.vim cfv ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/init.vim
cfm ~/.config/mutt/muttrc cft ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/.tmux.conf
cfd ~/.Xdefaults cfm ${XDG_CONFIG_HOME:-$HOME/.config}/mutt/muttrc
cfu ~/.config/newsboat/urls cfx ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources
cfn ~/.config/newsboat/config cfu ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls
cfmb ~/.config/ncmpcpp/bindings cfn ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/config
cfmc ~/.config/ncmpcpp/config cfmb ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/bindings
cfk ~/.config/sxhkd/sxhkdrc cfmc ${XDG_CONFIG_HOME:-$HOME/.config}/ncmpcpp/config
cfi ~/.config/i3/config cfk ${XDG_CONFIG_HOME:-$HOME/.config}/sxhkd/sxhkdrc
cfb ~/.config/i3blocks/config cfi ${XDG_CONFIG_HOME:-$HOME/.config}/i3/config
cfb ${XDG_CONFIG_HOME:-$HOME/.config}/i3blocks/config

View File

@ -28,10 +28,8 @@
<alias> <alias>
<family>monospace</family> <family>monospace</family>
<prefer> <prefer>
<family>Noto Sans Mono</family>
<family>Liberation Mono</family> <family>Liberation Mono</family>
<family>Inconsolata</family>
<family>Joy Pixels</family>
<family>Noto Color Emoji</family>
</prefer> </prefer>
</alias> </alias>
</fontconfig> </fontconfig>

View File

@ -59,7 +59,7 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode
##bindsym $mod+asciitilde ##bindsym $mod+asciitilde
#STOP/HIDE EVERYTHING: #STOP/HIDE EVERYTHING:
bindsym $mod+Shift+Delete exec --no-startup-id lmc mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf bindsym $mod+Shift+Delete exec --no-startup-id pulsemixer --mute ; exec --no-startup-id mpc pause && pkill -RTMIN+10 i3blocks ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e lf
# Show selection: # Show selection:
bindsym $mod+Insert exec --no-startup-id showclip bindsym $mod+Insert exec --no-startup-id showclip
@ -97,7 +97,7 @@ bindsym $mod+p exec --no-startup-id mpc toggle
bindsym $mod+Shift+p exec --no-startup-id mpc pause bindsym $mod+Shift+p exec --no-startup-id mpc pause
bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
bindsym $mod+Shift+a exec $term -e alsamixer bindsym $mod+Shift+a exec $term -e pulsemixer
bindsym $mod+s gaps inner current plus 5 bindsym $mod+s gaps inner current plus 5
bindsym $mod+Shift+s gaps inner current minus 5 bindsym $mod+Shift+s gaps inner current minus 5
@ -134,7 +134,7 @@ bindsym $mod+Ctrl+l move workspace to output right
bindsym $mod+z gaps outer current plus 5 bindsym $mod+z gaps outer current plus 5
bindsym $mod+Shift+z gaps outer current minus 5 bindsym $mod+Shift+z gaps outer current minus 5
bindsym $mod+x exec --no-startup-id mpc pause; exec --no-startup-id pauseallmpv ; exec --no-startup-id i3lock -e -f -c 1d2021 ; exec --no-startup-id xset dpms force off bindsym $mod+x exec --no-startup-id xset dpms force off && mpc pause && pauseallmpv && slock &
bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown" bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
bindsym $mod+c exec --no-startup-id cabl bindsym $mod+c exec --no-startup-id cabl
@ -150,7 +150,7 @@ bindsym $mod+n exec $term -e newsboat && pkill -RTMIN+6 i3blocks
bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right bindsym $mod+Shift+n floating toggle; sticky toggle; exec --no-startup-id hover right
bindsym $mod+m exec --no-startup-id $term -e ncmpcpp bindsym $mod+m exec --no-startup-id $term -e ncmpcpp
bindsym $mod+Shift+m exec --no-startup-id lmc toggle bindsym $mod+Shift+m exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks
# #---Workspace Bindings---# # # #---Workspace Bindings---# #
bindsym $mod+Home workspace $ws1 bindsym $mod+Home workspace $ws1
@ -222,7 +222,7 @@ for_window [title="mpvfloat"] border pixel 0
no_focus [title="mpvfloat"] no_focus [title="mpvfloat"]
# #---Function Buttons---# # # #---Function Buttons---# #
bindsym $mod+F1 exec --no-startup-id groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - bindsym $mod+F1 exec --no-startup-id groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura -
bindsym $mod+F2 restart bindsym $mod+F2 restart
bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F3 exec --no-startup-id displayselect
bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate"
@ -252,10 +252,10 @@ bindsym $mod+Ctrl+Right move workspace to output right
# #---Media Keys---# # # #---Media Keys---# #
# Volume keys # Volume keys
bindsym $mod+plus exec --no-startup-id lmc up bindsym $mod+plus exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks
bindsym $mod+Shift+plus exec --no-startup-id lmc up 15 bindsym $mod+Shift+plus exec --no-startup-id pulsemixer --change-volume +15 && pkill -RTMIN+10 i3blocks
bindsym $mod+minus exec --no-startup-id lmc down bindsym $mod+minus exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks
bindsym $mod+Shift+minus exec --no-startup-id lmc down 15 bindsym $mod+Shift+minus exec --no-startup-id pulsemixer --change-volume -15 && pkill -RTMIN+10 i3blocks
bindsym $mod+less exec --no-startup-id mpc prev bindsym $mod+less exec --no-startup-id mpc prev
bindsym $mod+Shift+less exec --no-startup-id mpc seek 0% bindsym $mod+Shift+less exec --no-startup-id mpc seek 0%
bindsym $mod+greater exec --no-startup-id mpc next bindsym $mod+greater exec --no-startup-id mpc next
@ -276,13 +276,13 @@ bindsym $mod+Delete exec $stoprec
bindsym XF86Launch1 exec --no-startup-id xset dpms force off bindsym XF86Launch1 exec --no-startup-id xset dpms force off
# #---Extra XF86 Keys---# # # #---Extra XF86 Keys---# #
bindsym XF86AudioMute exec --no-startup-id lmc toggle bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute && pkill -RTMIN+10 i3blocks
bindsym XF86AudioLowerVolume exec --no-startup-id lmc down bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 && pkill -RTMIN+10 i3blocks
bindsym Shift+XF86AudioLowerVolume exec --no-startup-id lmc down 10 bindsym Shift+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -10 && pkill -RTMIN+10 i3blocks
bindsym Control+XF86AudioLowerVolume exec --no-startup-id lmc down 1 bindsym Control+XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -1 && pkill -RTMIN+10 i3blocks
bindsym XF86AudioRaiseVolume exec --no-startup-id lmc up bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 && pkill -RTMIN+10 i3blocks
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id lmc up 10 bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +10 && pkill -RTMIN+10 i3blocks
bindsym Control+XF86AudioRaiseVolume exec --no-startup-id lmc up 1 bindsym Control+XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +1 && pkill -RTMIN+10 i3blocks
bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown" bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdown"
##bindsym XF86Copy exec ##bindsym XF86Copy exec
##bindsym XF86Open exec ##bindsym XF86Open exec

View File

@ -37,11 +37,9 @@ signal=12
#[memory] #[memory]
#interval=30 #interval=30
#label=🧠
#[cpu] #[cpu]
#interval=15 #interval=15
#label=💻
[volume] [volume]
interval=once interval=once
@ -53,7 +51,7 @@ signal=10
#[disk] #[disk]
#interval=60 #interval=60
#command=disk /home 🏠 #command=disk /home
[battery] [battery]
command=battery BAT0 command=battery BAT0
@ -66,5 +64,5 @@ interval=30
[internet] [internet]
interval=10 interval=10
[help] [help-icon]
interval=once interval=once

View File

@ -1,31 +1,36 @@
# Luke's lf settings # Luke's lf settings
# Basic vars # Basic vars
set shell sh set shell bash
set previewer ~/.config/lf/scope
set shellopts '-eu' set shellopts '-eu'
set ifs "\n" set ifs "\n"
set scrolloff 10 set scrolloff 10
set color256 set color256
set icons # Enable icons. Requires nerd fonts and LF_ICONS variable. set icons
set period 1
# Vars that depend on environmental variables
$lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
# cmds/functions # cmds/functions
cmd open ${{ cmd open ${{
case $(file --mime-type $f -b) in case $(file --mime-type $f -b) in
image/vnd.djvu|application/pdf|application/octet-stream) setsid zathura $fx >/dev/null 2>&1 & ;;
text/troff) man ./ $f;; text/troff) man ./ $f;;
text/*) $EDITOR $fx;; text/*) $EDITOR $fx;;
image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;; image/x-xcf|image/svg+xml) setsid gimp $f >/dev/null 2>&1 & ;;
image/*) rotdir $f | setsid sxiv -aio 2>/dev/null | lf-select & ;; image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\)\(_large\)*$" | setsid sxiv -aio 2>/dev/null | lf-select & ;;
audio/*) mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f ;; audio/*) mpv $f ;;
video/*) setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) $f -quiet >/dev/null 2>&1 & ;; video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;;
application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;; application/pdf) setsid zathura $fx >/dev/null 2>&1 & ;;
*) for f in $fx; do setsid $OPENER $f >/dev/null 2>&1 & done;; *) for f in $fx; do setsid $OPENER $f >/dev/null 2>&1 & done;;
esac esac
}} }}
cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
cmd delete ${{ cmd delete ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f set -f
printf "%s\n\t" "$fx" printf "%s\n\t" "$fx"
printf "delete?[y/N]" printf "delete?[y/N]"
@ -34,17 +39,19 @@ cmd delete ${{
}} }}
cmd moveto ${{ cmd moveto ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f set -f
clear; echo "Move to where?" clear; echo "Move to where?"
dest="$(cut -d' ' -f2- ~/.config/directories | fzf)" && dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" &&
eval mv -iv $fx $dest && eval mv -iv $fx $dest &&
notify-send "🚚 File(s) moved." "File(s) moved to $dest." notify-send "🚚 File(s) moved." "File(s) moved to $dest."
}} }}
cmd copyto ${{ cmd copyto ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f set -f
clear; echo "Copy to where?" clear; echo "Copy to where?"
dest="$(cut -d' ' -f2- ~/.config/directories | fzf)" && dest="$(cut -d' ' -f2- ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)" &&
eval cp -ivr $fx $dest && eval cp -ivr $fx $dest &&
notify-send "📋 File(s) copied." "File(s) copies to $dest." notify-send "📋 File(s) copied." "File(s) copies to $dest."
}} }}
@ -54,21 +61,28 @@ cmd bulkrename ${{
}} }}
# Bindings # Bindings
map c $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)"
map <c-f> $lf -remote "send $id select '$(fzf)'" map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(cut -d' ' -f2 ~/.config/directories | fzf)" map J $lf -remote "send $id cd $(cut -d' ' -f2 ${XDG_CONFIG_HOME:-$HOME/.config}/directories | fzf)"
map gh map gh
map g top map g top
map D delete map D delete
map C copyto map C copyto
map M moveto map M moveto
map a push %mkdir<space> map <c-n> 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 <c-r> reload
map <enter> shell map <enter> shell
map x $$f map x $$f
map X !$f map X !$f
map o &mimeopen "$f" map o &mimeopen $f
map O $mimeopen --ask "$f" map O $mimeopen --ask $f
map A rename # at the very end
map c push A<c-u> # new rename
map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extention
map a push A<a-b> # after extention
map b bulkrename
map <c-e> down
map <c-y> up
map V push :!nvim<space>

View File

@ -1,26 +1,21 @@
db_file "~/.config/mpd/database" music_directory "~/Music"
log_file "~/.config/mpd/log" playlist_directory "~/.config/mpd/playlists"
music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
pid_file "~/.config/mpd/pid"
state_file "~/.config/mpd/state"
sticker_file "~/.config/mpd/sticker.sql"
auto_update "yes" auto_update "yes"
bind_to_address "127.0.0.1" bind_to_address "127.0.0.1"
restore_paused "yes" restore_paused "yes"
max_output_buffer_size "16384" max_output_buffer_size "16384"
audio_output { audio_output {
type "alsa" type "pulse"
name "alsa for audio soundcard" name "pulse"
mixer_type "software" #type "alsa"
#name "ALSA"
} }
audio_output { audio_output {
type "fifo" type "fifo"
name "toggle_visualizer" name "Visualizer feed"
path "/tmp/mpd.fifo" path "/tmp/mpd.fifo"
format "44100:16:2" format "44100:16:2"
} }

View File

@ -0,0 +1,3 @@
local mpv_scripts_dir_path = os.getenv("HOME") .. "/.config/mpv/scripts/"
function load(relative_path) dofile(mpv_scripts_dir_path .. relative_path) end
load("mpvSockets/mpvSockets.lua")

@ -0,0 +1 @@
Subproject commit 8415a08d99a46213c918613cfe1e088071018db9

View File

@ -1,537 +1,32 @@
############################################################################## # vim: filetype=conf
## This is the example configuration file. Copy it to $HOME/.ncmpcpp/config ##
## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences. ## ncmpcpp_directory = "~/.config/ncmpcpp"
############################################################################## lyrics_directory = "~/.local/share/lyrics"
#
ncmpcpp_directory = ~/.config/ncmpcpp
#
##
## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other
## MPD clients (eg. ncmpc) also use that location.
##
#
lyrics_directory = ~/.local/share/lyrics
#
##### connection settings #####
#
#mpd_host = localhost
#
#mpd_port = 6600
#
#mpd_connection_timeout = 5
#
## Needed for tag editor and file operations to work.
##
mpd_music_dir = "~/Music" mpd_music_dir = "~/Music"
# message_delay_time = "1"
#mpd_crossfade_time = 5 visualizer_type = "spectrum"
#
##### music visualizer #####
##
## Note: In order to make music visualizer work you'll need to use mpd fifo
## output, whose format parameter has to be set to 44100:16:1 for mono
## visualization or 44100:16:2 for stereo visualization. Example configuration
## (it has to be put into mpd.conf):
##
## audio_output {
## type "fifo"
## name "Visualizer feed"
## path "/tmp/mpd.fifo"
## format "44100:16:2"
## }
##
#
#visualizer_fifo_path = /tmp/mpd.fifo
#
##
## Note: Below parameter is needed for ncmpcpp to determine which output
## provides data for visualizer and thus allow syncing between visualization and
## sound as currently there are some problems with it.
##
#
#visualizer_output_name = Visualizer feed
#
##
## If you set format to 44100:16:2, make it 'yes'.
##
#visualizer_in_stereo = yes
#
##
## Note: Below parameter defines how often ncmpcpp has to "synchronize"
## visualizer and audio outputs. 30 seconds is optimal value, but if you
## experience synchronization problems, set it to lower value. Keep in mind
## that sane values start with >=10.
##
#
#visualizer_sync_interval = 30
#
##
## Note: To enable spectrum frequency visualization you need to compile ncmpcpp
## with fftw3 support.
##
#
## Available values: spectrum, wave, wave_filled, ellipse.
##
visualizer_type = spectrum
#
#visualizer_look = ●卐
#visualizer_look = 卐
#
#visualizer_color = blue, cyan, green, yellow, magenta, red
#
## Alternative subset of 256 colors for terminals that support it.
##
#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
#
##### system encoding #####
##
## ncmpcpp should detect your charset encoding but if it failed to do so, you
## can specify charset encoding you are using here.
##
## Note: You can see whether your ncmpcpp build supports charset detection by
## checking output of `ncmpcpp --version`.
##
## Note: Since MPD uses UTF-8 by default, setting this option makes sense only
## if your encoding is different.
##
#
#system_encoding = ""
#
##### delays #####
#
## Time of inactivity (in seconds) after playlist highlighting will be disabled
## (0 = always on).
##
#playlist_disable_highlight_delay = 5
#
## Defines how long messages are supposed to be visible.
##
message_delay_time = 1
#
##### song format #####
##
## For a song format you can use:
##
## %l - length
## %f - filename
## %D - directory
## %a - artist
## %A - album artist
## %t - title
## %b - album
## %y - date
## %n - track number (01/12 -> 01)
## %N - full track info (01/12 -> 01/12)
## %g - genre
## %c - composer
## %p - performer
## %d - disc
## %C - comment
## %P - priority
## $R - begin right alignment
##
## If you want to make sure that a part of the format is displayed only when
## certain tags are present, you can archieve it by grouping them with brackets,
## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are
## present or '' otherwise. It is also possible to define a list of
## alternatives by providing several groups and separating them with '|',
## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is
## not present.
##
## Note: If you want to set limit on maximal length of a tag, just put the
## appropriate number between % and character that defines tag type, e.g. to
## make album take max. 20 terminal cells, use '%20b'.
##
## In addition, formats support markers used for text attributes. They are
## followed by character '$'. After that you can put:
##
## - 0 - default window color (discards all other colors)
## - 1 - black
## - 2 - red
## - 3 - green
## - 4 - yellow
## - 5 - blue
## - 6 - magenta
## - 7 - cyan
## - 8 - white
## - 9 - end of current color
## - b - bold text
## - u - underline text
## - r - reverse colors
## - a - use alternative character set
##
## If you don't want to use a non-color attribute anymore, just put it again,
## but this time insert character '/' between '$' and attribute character,
## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with
## reversed colors.
##
## If you want to use 256 colors and/or background colors in formats (the naming
## scheme is described below in section about color definitions), it can be done
## with the syntax $(COLOR), e.g. to set the artist tag to one of the
## non-standard colors and make it have yellow background, you need to write
## $(197_yellow)%a$(end). Note that for standard colors this is interchangable
## with attributes listed above.
##
## Note: colors can be nested.
##
#
song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9}
#
song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f} song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f}
#
song_library_format = {%n - }{%t}|{%f} song_library_format = {%n - }{%t}|{%f}
#
alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
#
alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
#
current_item_prefix = $(cyan)$r$b current_item_prefix = $(cyan)$r$b
#
current_item_suffix = $/r$(end)$/b current_item_suffix = $/r$(end)$/b
#
current_item_inactive_column_prefix = $(magenta)$r current_item_inactive_column_prefix = $(magenta)$r
#
current_item_inactive_column_suffix = $/r$(end) current_item_inactive_column_suffix = $/r$(end)
#
#now_playing_prefix = $b
#
#now_playing_suffix = $/b
#
#browser_playlist_prefix = "$2playlist$9 "
#
#selected_item_prefix = $6
#
#selected_item_suffix = $9
#
#modified_item_prefix = $3> $9
#
##
## Note: attributes are not supported for the following variables.
##
#song_window_title_format = {%a - }{%t}|{%f}
##
## Note: Below variables are used for sorting songs in browser. The sort mode
## determines how songs are sorted, and can be used in combination with a sort
## format to specify a custom sorting format. Available values for
## browser_sort_mode are "name", "mtime", "format" and "noop".
##
#
#browser_sort_mode = name
#
#browser_sort_format = {%a - }{%t}|{%f} {(%l)}
#
##### columns settings #####
##
## syntax of song columns list format is "column column etc."
##
## - syntax for each column is:
##
## (width of the column)[color of the column]{displayed tag}
##
## Note: Width is by default in %, if you want a column to have fixed size, add
## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of
## screen (so the real width will depend on actual screen size), whereas
## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen
## is.
##
## - color is optional (if you want the default one, leave the field empty).
##
## Note: You can give a column additional attributes by putting appropriate
## character after displayed tag character. Available attributes are:
##
## - r - column will be right aligned
## - E - if tag is empty, empty tag marker won't be displayed
##
## You can also:
##
## - give a column custom name by putting it after attributes, separated with
## character ':', e.g. {lr:Length} gives you right aligned column of lengths
## named "Length".
##
## - define sequence of tags, that have to be displayed in case predecessor is
## empty in a way similar to the one in classic song format, i.e. using '|'
## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to
## display artist tag and then composer and performer if previous ones are not
## available.
##
#
#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
#
##### various settings #####
#
##
## Note: Custom command that will be executed each time song changes. Useful for
## notifications etc.
##
#execute_on_song_change = ""
#
##
## Note: Custom command that will be executed each time player state
## changes. The environment variable MPD_PLAYER_STATE is set to the current
## state (either unknown, play, pause, or stop) for its duration.
##
#
#execute_on_player_state_change = ""
#
#playlist_show_mpd_host = no
#
#playlist_show_remaining_time = no
#
#playlist_shorten_total_times = no
#
#playlist_separate_albums = no
#
##
## Note: Possible display modes: classic, columns.
##
playlist_display_mode = columns playlist_display_mode = columns
#
browser_display_mode = columns browser_display_mode = columns
#
#search_engine_display_mode = classic
#
#playlist_editor_display_mode = classic
#
#discard_colors_if_item_is_selected = yes
#
#show_duplicate_tags = true
#
#incremental_seeking = yes
#
#seek_time = 1
#
#volume_change_step = 2
#
#autocenter_mode = no
#
#centered_cursor = no
#
##
## Note: You can specify third character which will be used to build 'empty'
## part of progressbar.
##
progressbar_look = -> progressbar_look = ->
#
## Available values: database, playlist.
##
#default_place_to_search_in = database
#
## Available values: classic, alternative.
##
#user_interface = classic
#
#data_fetching_delay = yes
#
## Available values: artist, album_artist, date, genre, composer, performer.
##
media_library_primary_tag = album_artist media_library_primary_tag = album_artist
#
media_library_albums_split_by_date = no media_library_albums_split_by_date = no
# startup_screen = "media_library"
## Available values: wrapped, normal.
##
#default_find_mode = wrapped
#
#default_tag_editor_pattern = %n - %t
#
#header_visibility = yes
#
#statusbar_visibility = yes
#
#titles_visibility = yes
#
#header_text_scrolling = yes
#
#cyclic_scrolling = no
#
#lines_scrolled = 2
#
#lyrics_fetchers = lyricwiki, azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet
#
#follow_now_playing_lyrics = no
#
#fetch_lyrics_for_current_song_in_background = no
#
#store_lyrics_in_song_dir = no
#
#generate_win32_compatible_filenames = yes
#
#allow_for_physical_item_deletion = no
#
##
## Note: If you set this variable, ncmpcpp will try to get info from last.fm in
## language you set and if it fails, it will fall back to english. Otherwise it
## will use english the first time.
##
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
##
#lastfm_preferred_language = en
#
#space_add_mode = add_remove
#
#show_hidden_files_in_local_browser = no
#
##
## How shall screen switcher work?
##
## - "previous" - switch between the current and previous screen.
## - "screen1,...,screenN" - switch between given sequence of screens.
##
## Screens available for use: help, playlist, browser, search_engine,
## media_library, playlist_editor, tag_editor, outputs, visualizer, clock,
## lyrics, last_fm.
##
#screen_switcher_mode = playlist, browser
#
##
## Note: You can define startup screen by choosing screen from the list above.
##
startup_screen = media_library
#
##
## Note: You can define startup slave screen by choosing screen from the list
## above or an empty value for no slave screen.
##
#startup_slave_screen = ""
#
#startup_slave_screen_focus = no
#
##
## Default width of locked screen (in %). Acceptable values are from 20 to 80.
##
#
#locked_screen_width_part = 50
#
#ask_for_locked_screen_width_part = yes
#
#jump_to_now_playing_song_at_start = yes
#
#ask_before_clearing_playlists = yes
#
#clock_display_seconds = no
#
display_volume_level = no display_volume_level = no
#
#display_bitrate = no
#
#display_remaining_time = no
#
## Available values: none, basic, extended, perl.
##
#regular_expressions = perl
#
##
## Note: if below is enabled, ncmpcpp will ignore leading "The" word while
## sorting items in browser, tags in media library, etc.
##
ignore_leading_the = yes ignore_leading_the = yes
# external_editor = nvim
##
## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and
## filtering lists. This takes an effect only if boost was compiled with ICU
## support.
##
#ignore_diacritics = no
#
#block_search_constraints_change_if_items_found = yes
#
#mouse_support = yes
#
#mouse_list_scroll_whole_page = yes
#
#empty_tag_marker = <empty>
#
#tags_separator = " | "
#
#tag_editor_extended_numeration = no
#
#media_library_sort_by_mtime = no
#
#enable_window_title = yes
#
##
## Note: You can choose default search mode for search engine. Available modes
## are:
##
## - 1 - use mpd built-in searching (no regexes, pattern matching)
##
## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but
## if your mpd is on a remote machine, downloading big database to process
## it can take a while
##
## - 3 - match only exact values (this mode uses mpd function for searching in
## database and local one for searching in current playlist)
##
#
#search_engine_default_search_mode = 1
#
external_editor = vim
#
## Note: set to yes if external editor is a console application.
##
use_console_editor = yes use_console_editor = yes
#
##### colors definitions #####
##
## It is possible to set a background color by setting a color value
## "<foreground>_<background>", e.g. red_black will set foregound color to red
## and background color to black.
##
## In addition, for terminals that support 256 colors it is possible to set one
## of them by using a number in range [1, 256] instead of color name,
## e.g. numerical value corresponding to red_black is 2_1. To find out if the
## terminal supports 256 colors, run ncmpcpp and check out the bottom of the
## help screen for list of available colors and their numerical values.
##
## What is more, there are two special values for the background color:
## "transparent" and "current". The first one explicitly sets the background to
## be transparent, while the second one allows you to preserve current
## background color and change only the foreground one. It's used implicitly
## when background color is not specified.
##
## Moreover, it is possible to attach format information to selected color
## variables by appending to their end a colon followed by one or more format
## flags, e.g. black:b or red:ur. The following variables support this syntax:
## visualizer_color, color1, color2, empty_tag_color, volume_color,
## state_line_color, state_flags_color, progressbar_color,
## progressbar_elapsed_color, player_state_color, statusbar_time_color,
## alternative_ui_separator_color.
##
## Note: due to technical limitations of older ncurses version, if 256 colors
## are used there is a possibility that you'll be able to use only colors with
## transparent background.
#
#colors_enabled = yes
#
empty_tag_color = magenta empty_tag_color = magenta
#
#header_window_color = magenta
#
#volume_color = default
#
#state_line_color = default
#
#state_flags_color = default:b
#
main_window_color = white main_window_color = white
#
#color1 = white
#
#color2 = green
#
progressbar_color = black:b progressbar_color = black:b
#
progressbar_elapsed_color = blue:b progressbar_elapsed_color = blue:b
#
statusbar_color = red statusbar_color = red
#
statusbar_time_color = cyan:b statusbar_time_color = cyan:b
#
#player_state_color = default:b
#
#alternative_ui_separator_color = black:b
#
#window_border_color = green
#
#active_window_border = red
#

View File

@ -27,13 +27,26 @@ color listfocus black yellow standout bold
color listnormal_unread blue default color listnormal_unread blue default
color listfocus_unread yellow default bold color listfocus_unread yellow default bold
color info red black bold color info red black bold
color article cyan default color article white default bold
browser linkhandler browser linkhandler
macro , open-in-browser macro , open-in-browser
macro t set browser "tsp youtube-dl --add-metadata -ic"; open-in-browser ; set browser linkhandler macro t set browser "qndl"; open-in-browser ; set browser linkhandler
macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best"; open-in-browser ; set browser linkhandler macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best"; open-in-browser ; set browser linkhandler
macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler
macro w set browser "w3m"; open-in-browser ; set browser linkhandler macro w set browser "lynx"; open-in-browser ; set browser linkhandler
macro p set browser "dmenuhandler"; open-in-browser ; set browser linkhandler macro p set browser "dmenuhandler"; open-in-browser ; set browser linkhandler
macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler
highlight all "---.*---" yellow
highlight feedlist ".*(0/0))" black
highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold
highlight article "(^Link:.*|^Date:.*)" default default
highlight article "https?://[^ ]+" green default
highlight article "^(Title):.*$" blue default
highlight article "\\[[0-9][0-9]*\\]" magenta default bold
highlight article "\\[image\\ [0-9]+\\]" green default bold
highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold
highlight article ":.*\\(link\\)$" cyan default
highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default

View File

@ -1,15 +1,15 @@
let mapleader ="," let mapleader =","
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..." echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload/ silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall autocmd VimEnter * PlugInstall
endif endif
call plug#begin('~/.config/nvim/plugged') call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree' Plug 'preservim/nerdtree'
Plug 'junegunn/goyo.vim' Plug 'junegunn/goyo.vim'
Plug 'PotatoesMaster/i3-vim-syntax' Plug 'PotatoesMaster/i3-vim-syntax'
Plug 'jreybert/vimagit' Plug 'jreybert/vimagit'
@ -18,6 +18,7 @@ Plug 'vimwiki/vimwiki'
Plug 'bling/vim-airline' Plug 'bling/vim-airline'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
Plug 'kovetskiy/sxhkd-vim' Plug 'kovetskiy/sxhkd-vim'
Plug 'ap/vim-css-color'
call plug#end() call plug#end()
set bg=light set bg=light
@ -50,6 +51,11 @@ set clipboard+=unnamedplus
" Nerd tree " Nerd tree
map <leader>n :NERDTreeToggle<CR> map <leader>n :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
if has('nvim')
let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
else
let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
endif
" vimling: " vimling:
nm <leader>d :call ToggleDeadKeys()<CR> nm <leader>d :call ToggleDeadKeys()<CR>
@ -103,8 +109,9 @@ set clipboard+=unnamedplus
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR> autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR> autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
" Automatically deletes all trailing whitespace on save. " Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e
" When shortcut files are updated, renew bash and ranger configs with new material: " When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost files,directories !shortcuts autocmd BufWritePost files,directories !shortcuts

View File

@ -38,7 +38,7 @@ class my_edit(Command):
# reference to the currently selected file. # reference to the currently selected file.
target_filename = self.fm.thisfile.path target_filename = self.fm.thisfile.path
# This is a generic function to print text in ranger. # This is a generic function to print text in ranger.
self.fm.notify("Let's edit the file " + target_filename + "!") self.fm.notify("Let's edit the file " + target_filename + "!")
# Using bad=True in fm.notify allows you to print error messages: # Using bad=True in fm.notify allows you to print error messages:

View File

@ -60,7 +60,7 @@ Press any "verb" followed by any "argument" to perform a folder operation. "gd"
+ Txs -- copy slideshow/beamer template to new file + Txs -- copy slideshow/beamer template to new file
+ Txh -- copy handout template to new file + Txh -- copy handout template to new file
+ Image commands: + Image commands:
+ bg -- (for i3 users) makes an image your background (assuming i3 is looking at ~/.config/wall.png for your background) + bg -- makes an image your background (assuming i3 is looking at ~/.local/share/bg for your background)
+ bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it. + bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it.
+ C -- rotates an image (requires imagemagick) + C -- rotates an image (requires imagemagick)
+ F -- flips an image (requires imagemagick) + F -- flips an image (requires imagemagick)

View File

@ -5,7 +5,6 @@ set column_ratios 1,3,4
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
set show_hidden false set show_hidden false
set confirm_on_delete multiple set confirm_on_delete multiple
set preview_script ~/.config/ranger/scope.sh
set use_preview_script true set use_preview_script true
set automatically_count_files true set automatically_count_files true
set open_all_images true set open_all_images true
@ -505,4 +504,5 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po
#Downloading #Downloading
map ytv console shell youtube-dl -ic%space map ytv console shell youtube-dl -ic%space
map yta console shell youtube-dl -xic%space map yta console shell youtube-dl -xic%space
source ~/.config/ranger/shortcuts.conf
eval cmd('source ' + fm.confpath('shortcuts.conf'))

View File

@ -101,7 +101,7 @@ ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1" ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1" ext exe = wine "$1"
name ^[mM]akefile$ = make name ^[mM]akefile$ = make
ext asf, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" ext asf, has mpv, X, flag f = mpv -- "$@"
#-------------------------------------------- #--------------------------------------------
# Code # Code
@ -118,11 +118,11 @@ ext php = php -- "$1"
#------------------------------------------- #-------------------------------------------
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|audio, has smplayer, X, flag f = smplayer "$@" mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-video -- "$@" mime ^video, has mpv, X, flag f = mpv --no-video -- "$@"
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --fs -- "$@" mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --loop -- "$@" mime ^video, has mpv, X, flag f = mpv --loop -- "$@"
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --title="obs" --autofit=1050x700 -- "$@" mime ^video, has mpv, X, flag f = mpv --title="obs" --autofit=1050x700 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video, has mplayer, X, flag f = mplayer -- "$@" mime ^video, has mplayer, X, flag f = mplayer -- "$@"
@ -135,16 +135,16 @@ mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
#------------------------------------------- #-------------------------------------------
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-audio-display -- "$@" mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@"
mime ^audio|ogg$ = tag "$@" mime ^audio|ogg$ = tag "$@"
mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
ext midi?, terminal, has wildmidi = wildmidi -- "$@" ext midi?, terminal, has wildmidi = wildmidi -- "$@"
#-------------------------------------------- #--------------------------------------------
# Video without X: # Video without X:
#------------------------------------------- #-------------------------------------------
mime ^video, terminal, !X, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" mime ^video, terminal, !X, has mpv = mpv -- "$@"
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
mime ^video, terminal, !X, has mplayer = mplayer -- "$@" mime ^video, terminal, !X, has mplayer = mplayer -- "$@"

View File

@ -15,7 +15,7 @@ super + d
super + r super + r
$TERMINAL -e $FILE $TERMINAL -e $FILE
super + e super + e
$TERMINAL -e neomutt; pkill -RTMIN+12 $STATUSBAR $TERMINAL -e neomutt; pkill -RTMIN+12 blocks
super + m super + m
$TERMINAL -e ncmpcpp $TERMINAL -e ncmpcpp
super + n super + n
@ -25,7 +25,7 @@ super + c
super + v super + v
$TERMINAL -e nvim -c VimwikiIndex $TERMINAL -e nvim -c VimwikiIndex
super + shift + a super + shift + a
$TERMINAL -e alsamixer; pkill -RTMIN+10 $STATUSBAR $TERMINAL -e alsamixer; pkill -RTMIN+10 blocks
super + shift + c super + shift + c
mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --title='mpvfloat' /dev/video0 mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --title='mpvfloat' /dev/video0
super + shift + e super + shift + e
@ -93,18 +93,18 @@ super + {_,shift +} bracketleft
mpc seek -{10,120} mpc seek -{10,120}
# Increase volume # Increase volume
super + {equal,plus} super + {equal,plus}
amixer sset Master {5,15}%+; pkill -RTMIN+10 $STATUSBAR amixer sset Master {5,15}%+; pkill -RTMIN+10 blocks
# Decrease volume # Decrease volume
super {_,shift +} + minus super {_,shift +} + minus
amixer sset Master {5,15}%-; pkill -RTMIN+10 $STATUSBAR amixer sset Master {5,15}%-; pkill -RTMIN+10 blocks
super + shift + m super + shift + m
amixer sset Master toggle; pkill -RTMIN+10 $STATUSBAR amixer sset Master toggle; pkill -RTMIN+10 blocks
# Audiokeys # Audiokeys
XF86AudioMute XF86AudioMute
amixer sset Master toggle; pkill -RTMIN+10 $STATUSBAR amixer sset Master toggle; pkill -RTMIN+10 blocks
XF86Audio{Raise,Lower}Volume XF86Audio{Raise,Lower}Volume
amixer sset Master 5%{+,-}; pkill -RTMIN+10 $STATUSBAR amixer sset Master 5%{+,-}; pkill -RTMIN+10 blocks
XF86Audio{Next,Prev} XF86Audio{Next,Prev}
mpc {next,prev} mpc {next,prev}
XF86Audio{Pause,Play,Stop} XF86Audio{Pause,Play,Stop}
@ -137,10 +137,10 @@ XF86MyComputer
# Function keys # Function keys
super + shift + F1 super + shift + F1
grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "$HOME/.local/share/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." ) grep LARBSWELCOME ~/.xprofile && ( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( echo "notify-send -i "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && notify-send "LARBS welcome message" "Welcome message re-enabled." )
# Show readme # Show readme
super + F1 super + F1
groff -mom $HOME/.local/share/larbs/readme.mom -Tpdf | zathura - groff -mom ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom -Tpdf | zathura -
# F2 restarts either dwm or i3 and is bound in each. # F2 restarts either dwm or i3 and is bound in each.
# Change display # Change display
super + F3 super + F3

View File

@ -4,13 +4,15 @@ do
case "$1" in case "$1" in
"w") setbg "$file" & ;; "w") setbg "$file" & ;;
"c") "c")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit [ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
;; ;;
"m") "m")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/directories | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit [ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;; ;;
"r") "r")

View File

@ -1,5 +1,5 @@
" vim: filetype=vifm " vim: filetype=vifm
source ~/.config/vifm/vifmshortcuts source ${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts
set vicmd=$EDITOR set vicmd=$EDITOR
set syscalls set syscalls
@ -54,11 +54,11 @@ fileviewer *.odt odt2txt %c -
filetype *.csv,*.xlsx sc-im %c filetype *.csv,*.xlsx sc-im %c
fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw 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 filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display %c
filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu,*.epub,*.cbz,*.cbr,*.cb7 zathura %f 2>/dev/null &, filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu,*.epub,*.cbz,*.cbr,*.cb7 zathura %f 2>/dev/null &,
fileviewer *.pdf pdftotext -l 1 -nopgbrk %c - 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 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 &, 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 %f 2>/dev/null &,
fileview *.tar.gz atool -l --format=tar %f 2>/dev/null | awk '{$1=$2=$3=$4=$5=""; print $0}' fileview *.tar.gz atool -l --format=tar %f 2>/dev/null | awk '{$1=$2=$3=$4=$5=""; print $0}'
fileview *.zip,*.cbz atool -l --format=zip %f 2>/dev/null | tail +4 | awk '{$1=$2=$3=""; print $0}' fileview *.zip,*.cbz atool -l --format=zip %f 2>/dev/null | tail +4 | awk '{$1=$2=$3=""; print $0}'

View File

@ -24,7 +24,4 @@ done
fix_sequences <"${HOME}/.cache/wal/sequences" fix_sequences <"${HOME}/.cache/wal/sequences"
xsetroot -name "fsignal:xrdb" pkill dunst; dunst &
pkill dunst
dunst-theme
dunst &

21
.config/xinitrc Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# xinitrc runs automatically when you run startx.
# There are some small but important commands that need to be run when we start
# the graphical environment. I keep those commands in ~/config/xprofile because
# that file is run automatically if someone uses a display manager (login
# screen) and so they are needed there. To prevent doubling up commands, I
# source them here with the line below.
# export STATUSBAR="i3blocks" # Uncomment this line when using i3.
. ~/.xprofile
# Your default LARBS WM is determined in your `~/.profile` on login. Here we
# run the proper command to run when the graphical environment starts.
# Comment/uncomment these lines depending on what wm you want to use. Also
# check the i3blocks line above.
ssh-agent dwm
# ssh-agent i3

View File

@ -1,19 +1,31 @@
# Luke's config for the Zoomer Shell # Luke's config for the Zoomer Shell
autoload -U colors && colors # Enable colors and change prompt:
autoload -U colors && colors # Load colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
setopt autocd # Automatically cd into typed directory.
stty stop undef # Disable ctrl-s to freeze terminal.
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
# Load aliases and shortcuts if existent. # Load aliases and shortcuts if existent.
[ -f "$HOME/.config/shortcutrc" ] && source "$HOME/.config/shortcutrc" [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc"
[ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc" [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc"
# Basic auto/tab complete:
autoload -U compinit autoload -U compinit
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
zmodload zsh/complist zmodload zsh/complist
compinit compinit
_comp_options+=(globdots) # Include hidden files.
# Include hidden files in autocomplete: # vi mode
_comp_options+=(globdots) bindkey -v
export KEYTIMEOUT=1
# Use vim keys in tab complete menu: # Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char bindkey -M menuselect 'h' vi-backward-char
@ -22,14 +34,11 @@ bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char bindkey -v '^?' backward-delete-char
export KEYTIMEOUT=1
# Change cursor shape for different vi modes. # Change cursor shape for different vi modes.
function zle-keymap-select { function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] || if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then [[ $1 = 'block' ]]; then
echo -ne '\e[1 q' echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] || elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] || [[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] || [[ ${KEYMAP} = '' ]] ||
@ -38,17 +47,13 @@ function zle-keymap-select {
fi fi
} }
zle -N zle-keymap-select zle -N zle-keymap-select
zle-line-init() { zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q" echo -ne "\e[5 q"
} }
zle -N zle-line-init zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
# Use beam shape cursor on startup. preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
echo -ne '\e[5 q'
# Use beam shape cursor for each new prompt.
preexec() { echo -ne '\e[5 q' ;}
# Use lf to switch directories and bind it to ctrl-o # Use lf to switch directories and bind it to ctrl-o
lfcd () { lfcd () {
@ -56,16 +61,21 @@ lfcd () {
lf -last-dir-path="$tmp" "$@" lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then if [ -f "$tmp" ]; then
dir="$(cat "$tmp")" dir="$(cat "$tmp")"
rm -f "$tmp" rm -f "$tmp" >/dev/null
if [ -d "$dir" ]; then [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
if [ "$dir" != "$(pwd)" ]; then
cd "$dir"
fi
fi
fi fi
} }
bindkey -s '^o' 'lfcd\n'
bindkey -s '^o' 'lfcd\n' # zsh bindkey -s '^a' 'bc -l\n'
# Load zsh-syntax-highlighting; should be last. bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
bindkey '^[[P' delete-char
# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
# Load syntax highlighting; should be last.
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule ".config/mpv/scripts/mpvSockets"]
path = .config/mpv/scripts/mpvSockets
url = https://github.com/wis/mpvSockets.git

View File

@ -20,18 +20,20 @@ textype() { \
biber --input-directory "$dir" "$base" && biber --input-directory "$dir" "$base" &&
$command --output-directory="$dir" "$base" && $command --output-directory="$dir" "$base" &&
$command --output-directory="$dir" "$base" $command --output-directory="$dir" "$base"
} }
case "$file" in case "$file" in
*\.ms) refer -PS -e "$file" | groff -me -ms -kept -T pdf > "$base".pdf ;; *\.ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf > "$base".pdf ;;
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;; *\.mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;; *\.[0-9]) preconv "$file" | refer -PS -e | groff -mandoc -T pdf > "$base".pdf ;;
*\.[rR]md) Rscript -e "require(rmarkdown); rmarkdown::render('$file', quiet=TRUE)" ;; *\.[rR]md) Rscript -e "rmarkdown::render('$file', quiet=TRUE)" ;;
*\.tex) textype "$file" ;; *\.tex) textype "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;; *config.h) sudo make install ;;
*\.c) cc "$file" -o "$base" && "$base" ;; *\.c) cc "$file" -o "$base" && "$base" ;;
*\.py) python "$file" ;; *\.py) python "$file" ;;
*\.m) octave "$file" ;;
*\.scad) openscad -o "$base".stl "$file" ;;
*\.go) go run "$file" ;; *\.go) go run "$file" ;;
*\.sent) setsid sent "$file" 2>/dev/null & ;; *\.sent) setsid sent "$file" 2>/dev/null & ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;

View File

@ -9,7 +9,7 @@ notify-send "📦 Repository Sync" "Checking for package updates..."
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates. sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
Check your internet connection, if pacman is already running, or run update manually to see errors." Check your internet connection, if pacman is already running, or run update manually to see errors."
pkill -RTMIN+8 "${STATUSBAR:?}" pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
if pacman -Qu | grep -v "\[ignored\]" if pacman -Qu | grep -v "\[ignored\]"
then then

View File

@ -3,4 +3,4 @@
# Toggles all cronjobs off/on. # Toggles all cronjobs off/on.
# Stores disabled crontabs in ~/.consaved until restored. # Stores disabled crontabs in ~/.consaved until restored.
([ -f ~/.config/cronsaved ] && crontab - < ~/.config/cronsaved && rm ~/.config/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ~/.config/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.") ([ -f ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved ] && crontab - < ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && rm ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ${XDG_CONFIG_HOME:-$HOME/.config}/cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.")

View File

@ -7,11 +7,11 @@ ping -q -c 1 1.1.1.1 > /dev/null || exit
/usr/bin/notify-send "📰 Updating RSS feeds..." /usr/bin/notify-send "📰 Updating RSS feeds..."
pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit ps ax | grep -q newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
echo 🔃 > /tmp/newsupdate echo 🔃 > /tmp/newsupdate
pkill -RTMIN+6 "${STATUSBAR:?}" pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
/usr/bin/newsboat -x reload /usr/bin/newsboat -x reload
rm -f /tmp/newsupdate rm -f /tmp/newsupdate
pkill -RTMIN+6 "${STATUSBAR:?}" pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}"
/usr/bin/notify-send "📰 RSS feed update complete." /usr/bin/notify-send "📰 RSS feed update complete."

View File

@ -48,25 +48,36 @@ morescreen() { # If multi-monitor is selected and there are more than two screen
multimon() { # Multi-monitor handler. multimon() { # Multi-monitor handler.
case "$(echo "$screens" | wc -l)" in case "$(echo "$screens" | wc -l)" in
1) xrandr $(echo "$allposs" | grep -v "$screens" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;
2) twoscreen ;; 2) twoscreen ;;
*) morescreen ;; *) morescreen ;;
esac ;} esac ;}
onescreen() { # If only one output available or chosen.
xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ')
}
postrun() { # Stuff to run to clean up.
setbg # Fix background if screen size/arangement has changed.
remaps # Re-remap keys if keyboard added (for laptop bases)
{ killall dunst ; setsid dunst & } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen
}
# Get all possible displays # Get all possible displays
allposs=$(xrandr -q | grep "connected") allposs=$(xrandr -q | grep "connected")
# Get all connected screens. # Get all connected screens.
screens=$(echo "$allposs" | grep " connected" | awk '{print $1}') screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
# If there's only one screen
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
{ onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;}
# Get user choice including multi-monitor and manual selection: # Get user choice including multi-monitor and manual selection:
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
case "$chosen" in case "$chosen" in
"manual selection") arandr ; exit ;; "manual selection") arandr ; exit ;;
"multi-monitor") multimon ;; "multi-monitor") multimon ;;
*) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; *) onescreen "$chosen" ;;
esac esac
setbg # Fix background if screen size/arangement has changed. postrun
remaps # Re-remap keys if keyboard added (for laptop bases)
pgrep -x dunst >/dev/null && killall dunst && setsid dunst & # Restart dunst to ensure proper location on screen

View File

@ -6,11 +6,11 @@
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in
"copy url") echo "$1" | xclip -selection clipboard ;; "copy url") echo "$1" | xclip -selection clipboard ;;
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
"mpv (loop)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet --loop "$1" >/dev/null 2>&1 & ;; "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;;
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;; browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;;
feh) setsid feh "$1" >/dev/null 2>&1 & ;; feh) setsid feh "$1" >/dev/null 2>&1 & ;;
w3m) w3m "$1" >/dev/null 2>&1 ;; w3m) w3m "$1" >/dev/null 2>&1 ;;
"mpv (float)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;
esac esac

View File

@ -7,18 +7,20 @@
getmount() { \ getmount() { \
[ -z "$chosen" ] && exit 1 [ -z "$chosen" ] && exit 1
mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" # shellcheck disable=SC2086
mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1
[ "$mp" = "" ] && exit 1 [ "$mp" = "" ] && exit 1
if [ ! -d "$mp" ]; then if [ ! -d "$mp" ]; then
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")
fi fi
} }
mountusb() { \ mountusb() { \
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1
chosen="$(echo "$chosen" | awk '{print $1}')"
sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0 sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0
alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \\( -path *%s -prune \\) \\ \n",$3}') alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}')
getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted"
partitiontype="$(lsblk -no "fstype" "$chosen")" partitiontype="$(lsblk -no "fstype" "$chosen")"
case "$partitiontype" in case "$partitiontype" in
@ -29,23 +31,25 @@ mountusb() { \
} }
mountandroid() { \ mountandroid() { \
chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1) chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1
chosen="$(echo "$chosen" | cut -d : -f 1)"
getmount "$HOME -maxdepth 3 -type d" getmount "$HOME -maxdepth 3 -type d"
simple-mtpfs --device "$chosen" "$mp" simple-mtpfs --device "$chosen" "$mp"
echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1
simple-mtpfs --device "$chosen" "$mp" simple-mtpfs --device "$chosen" "$mp"
notify-send "🤖 Android Mounting" "Android device mounted to $mp." notify-send "🤖 Android Mounting" "Android device mounted to $mp."
} }
asktype() { \ asktype() { \
case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1
case $choice in
USB) mountusb ;; USB) mountusb ;;
Android) mountandroid ;; Android) mountandroid ;;
esac esac
} }
anddrives=$(simple-mtpfs -l 2>/dev/null) anddrives=$(simple-mtpfs -l 2>/dev/null)
usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}')" usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$4==""{printf "%s (%s)\n",$1,$3}')"
if [ -z "$usbdrives" ]; then if [ -z "$usbdrives" ]; then
[ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit

View File

@ -3,4 +3,4 @@
# This script is the SUDO_ASKPASS variable, meaning that it will be used as a # This script is the SUDO_ASKPASS variable, meaning that it will be used as a
# password prompt if needed. # password prompt if needed.
dmenu -fn Monospace-18 -sb "#d79921" -sf "#1d2021" -nf "#000000" -nb "#000000" -p "$1" <&- && echo dmenu -fn Monospace-18 -P -p "$1" <&- && echo

View File

@ -11,7 +11,7 @@
updateicon() { \ updateicon() { \
echo "$1" > /tmp/recordingicon echo "$1" > /tmp/recordingicon
pkill -RTMIN+9 "${STATUSBAR:?}" pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
} }
killrecording() { killrecording() {
@ -20,7 +20,7 @@ killrecording() {
kill -15 "$recpid" kill -15 "$recpid"
rm -f /tmp/recordingpid rm -f /tmp/recordingpid
updateicon "" updateicon ""
pkill -RTMIN+9 "${STATUSBAR:?}" pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}"
# even after SIGTERM, ffmpeg may still run, so SIGKILL it. # even after SIGTERM, ffmpeg may still run, so SIGKILL it.
sleep 3 sleep 3
kill -9 "$recpid" kill -9 "$recpid"
@ -31,20 +31,20 @@ screencast() { \
ffmpeg -y \ ffmpeg -y \
-f x11grab \ -f x11grab \
-framerate 60 \ -framerate 60 \
-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \
-i $DISPLAY \ -i "$DISPLAY" \
-f alsa -i default \ -f alsa -i default \
-r 30 \ -r 30 \
-c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ -c:v h264 -crf 0 -preset ultrafast -c:a aac \
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" &
echo $! > /tmp/recordingpid echo $! > /tmp/recordingpid
updateicon "⏺️🎙️" updateicon "⏺️🎙️"
} }
video() { ffmpeg \ video() { ffmpeg \
-f x11grab \ -f x11grab \
-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ -s "$(xdpyinfo | grep dimensions | awk '{print $2;}')" \
-i $DISPLAY \ -i "$DISPLAY" \
-c:v libx264 -qp 0 -r 30 \ -c:v libx264 -qp 0 -r 30 \
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
echo $! > /tmp/recordingpid echo $! > /tmp/recordingpid

View File

@ -6,25 +6,27 @@
unmountusb() { unmountusb() {
[ -z "$drives" ] && exit [ -z "$drives" ] && exit
chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1
chosen="$(echo "$chosen" | awk '{print $1}')"
[ -z "$chosen" ] && exit [ -z "$chosen" ] && exit
sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted." sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted."
} }
unmountandroid() { \ unmountandroid() { \
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?") chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1
[ -z "$chosen" ] && exit [ -z "$chosen" ] && exit
sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted." sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted."
} }
asktype() { \ asktype() { \
case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1
case "$choice" in
USB) unmountusb ;; USB) unmountusb ;;
Android) unmountandroid ;; Android) unmountandroid ;;
esac esac
} }
drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
if ! grep simple-mtpfs /etc/mtab; then if ! grep simple-mtpfs /etc/mtab; then
[ -z "$drives" ] && echo "No drives to unmount." && exit [ -z "$drives" ] && echo "No drives to unmount." && exit

View File

@ -2,16 +2,16 @@
# The famous "get a menu of emojis to copy" script. # The famous "get a menu of emojis to copy" script.
# Must have xclip installed to even show menu. # Get user selection via dmenu from emoji file.
xclip -h 2>/dev/null || exit 1 chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*//")
chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//") # Exit if none chosen.
[ -z "$chosen" ] && exit
[ "$chosen" != "" ] || exit # If you run this command with an argument, it will automatically insert the
# character. Otherwise, show a message that the emoji has been copied.
# If you run this command with an argument, it will automatically insert the character.
if [ -n "$1" ]; then if [ -n "$1" ]; then
xdotool key Shift+Insert xdotool type "$chosen"
else else
echo "$chosen" | tr -d '\n' | xclip -selection clipboard echo "$chosen" | tr -d '\n' | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." & notify-send "'$chosen' copied to clipboard." &

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
cat ~/.local/share/larbs/getkeys/"$1" 2>/dev/null && exit cat ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys/"$1" 2>/dev/null && exit
echo "Run command with one of the following arguments for info about that program:" echo "Run command with one of the following arguments for info about that program:"
ls ~/.local/share/larbs/getkeys ls ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/getkeys

View File

@ -2,9 +2,9 @@
# Toggles the LARBS welcome message. # Toggles the LARBS welcome message.
PIC="$HOME/.local/share/larbs/larbs.png" PIC="${XDG_DATA_HOME:-$HOME/.local/share}/larbs/larbs.png"
grep LARBSWELCOME "$HOME/.xprofile" && grep LARBSWELCOME "$XDG_CONFIG_HOME/xprofile" &&
( sed -i "/LARBSWELCOME/d" ~/.xprofile && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) || ( sed -i "/LARBSWELCOME/d" "$XDG_CONFIG_HOME/xprofile" && notify-send -i "$PIC" "LARBS welcome message" "Welcome message disabled. Press Super+Shift+F1 again to reverse." ) ||
( echo "notify-send -i \"$PIC\" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> ~/.xprofile && ( echo "notify-send -i \"$PIC\" \"Welcome to LARBS\" \"Press super+F1 for the help menu.\" # LARBSWELCOME" >> "$XDG_CONFIG_HOME/xprofile" &&
notify-send -i "$PIC" "LARBS welcome message" "Welcome message re-enabled." ) notify-send -i "$PIC" "LARBS welcome message" "Welcome message re-enabled." )

View File

@ -1,4 +1,8 @@
#!/bin/sh #!/bin/sh
# If $1 command is not available, error code and notify. # Some optional functions in LARBS require programs not installed by default. I
command -v "$1" >/dev/null || { notify-send "📦 $1" "must be installed for this function." && exit 1 ;} # use this little script to check to see if a command exists and if it doesn't
# it informs the user that they need that command to continue. This is used in
# various other scripts for clarity's sake.
pacman -Qq "$1" >/dev/null || { notify-send "📦 $1" "must be installed for this function." && exit 1 ;}

View File

@ -4,8 +4,6 @@
killall -q polybar killall -q polybar
# Wait until the processes have been shut down # Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done while pidof polybar >/dev/null; do sleep 1; done
for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar default & done
echo "Bars launched..."

View File

@ -11,7 +11,7 @@
case "$1" in case "$1" in
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*) *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*)
setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
*png|*jpg|*jpe|*jpeg|*gif) *png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
*mp3|*flac|*opus|*mp3?source*) *mp3|*flac|*opus|*mp3?source*)

View File

@ -10,11 +10,13 @@ if [ "$PULSE" ]; then
mute() { pulsemixer --mute ;} mute() { pulsemixer --mute ;}
up() { pulsemixer --change-volume +"$NUM" ;} up() { pulsemixer --change-volume +"$NUM" ;}
down() { pulsemixer --change-volume -"$NUM" ;} down() { pulsemixer --change-volume -"$NUM" ;}
control() { pulsemixer ;}
else else
toggle() { amixer sset Master toggle ;} toggle() { amixer sset Master toggle ;}
mute() { amixer sset Master mute ;} mute() { amixer sset Master mute ;}
up() { amixer sset Master "$NUM"%+ ;} up() { amixer sset Master "$NUM"%+ ;}
down() { amixer sset Master "$NUM"%- ;} down() { amixer sset Master "$NUM"%- ;}
control() { alsamixer ;}
fi fi
case "$1" in case "$1" in
@ -22,6 +24,5 @@ case "$1" in
mute) mute ;; mute) mute ;;
up) up ;; up) up ;;
down) down ;; down) down ;;
esac >/dev/null control) control ;;
esac
pkill -RTMIN+10 "${STATUSBAR:?}" &

View File

@ -5,6 +5,6 @@
# every single one of them with one command! This is bound to super + shift + p # every single one of them with one command! This is bound to super + shift + p
# (with other things) by default and is used in some other places. # (with other things) by default and is used in some other places.
for i in $(ls /tmp/mpvsoc*); do for i in $(ls /tmp/mpvSockets/*); do
echo '{ "command": ["set_property", "pause", true] }' | socat - $i; echo '{ "command": ["set_property", "pause", true] }' | socat - $i;
done done

View File

@ -4,4 +4,4 @@
[ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit [ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit
echo ~/.local/share/newsboat/queue | entr -p queueandnotify 2>/dev/null echo ${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue | entr -p queueandnotify 2>/dev/null

View File

@ -3,7 +3,7 @@
# Podboat sucks. This script replaces it. # Podboat sucks. This script replaces it.
# It reads the newsboat queue, queuing downloads with taskspooler. # It reads the newsboat queue, queuing downloads with taskspooler.
# It also removes the junk from extentions. # It also removes the junk from extentions.
queuefile="$HOME/.local/share/newsboat/queue" queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue"
while read -r line; do while read -r line; do
[ -z "$line" ] && continue [ -z "$line" ] && continue

View File

@ -2,7 +2,7 @@
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && ! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
notify-send "That doesn't look like a full URL." && exit notify-send "That doesn't look like a full URL." && exit
RSSFILE="$HOME/.config/newsboat/urls" RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls"
if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then
notify-send "You already have this RSS feed." notify-send "You already have this RSS feed."
else else

View File

@ -4,16 +4,17 @@
# Run by itself, set the wallpaper (at X start). # Run by itself, set the wallpaper (at X start).
# If given a file, set that as the new wallpaper. # If given a file, set that as the new wallpaper.
# If given a directory, choose random file in it. # If given a directory, choose random file in it.
# If wal is installed, also generate a colorscheme. # If wal is installed, also generates a colorscheme.
# Location of link to wallpaper link. # Location of link to wallpaper link.
bgloc="${XDG_CACHE_HOME:-$HOME/.cache/}/bg" bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." [ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..."
[ -d "$1" ] && ln -sf "$(find "$(readlink -f "$1")" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." [ -d "$1" ] && ln -sf "$(find "$(readlink -f "$1")" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen."
# If pywal is installed, use it. # If pywal is installed, use it.
wal -s -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 wal -i "$(readlink -f "$bgloc")" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1
pidof dwm >/dev/null && xdotool key super+F12
xwallpaper --zoom "$bgloc" xwallpaper --zoom "$bgloc"

View File

@ -1,27 +1,29 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Output locations. Unactivated progs should go to /dev/null. # Output locations. Unactivated progs should go to /dev/null.
shell_shortcuts="$HOME/.config/shortcutrc" shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc"
ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc"
ranger_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/ranger/shortcuts.conf"
qute_shortcuts="/dev/null" qute_shortcuts="/dev/null"
fish_shortcuts="/dev/null" fish_shortcuts="/dev/null"
vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts" vifm_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/vifm/vifmshortcuts"
# Remove, prepare files # Remove, prepare files
rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null rm -f "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" 2>/dev/null
printf "# vim: filetype=sh\\n" > "$fish_shortcuts" printf "# vim: filetype=sh\\n" > "$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs. # Format the `directories` file in the correct syntax and sent it to all three configs.
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/directories" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \
>(awk '{print "hash -d "$1"="$2}' >> "$zsh_named_dirs") \
>(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \
>(awk '{print "map g" $1, ":cd", $2 "<CR>\nmap t" $1, "<tab>:cd", $2 "<CR><tab>\nmap M" $1, "<tab>:cd", $2 "<CR><tab>:mo<CR>\nmap Y" $1, "<tab>:cd", $2 "<CR><tab>:co<CR>" }' >> "$vifm_shortcuts") \ >(awk '{print "map g" $1, ":cd", $2 "<CR>\nmap t" $1, "<tab>:cd", $2 "<CR><tab>\nmap M" $1, "<tab>:cd", $2 "<CR><tab>:mo<CR>\nmap Y" $1, "<tab>:cd", $2 "<CR><tab>:co<CR>" }' >> "$vifm_shortcuts") \
>(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \
| awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts"
# Format the `files` file in the correct syntax and sent it to both configs. # Format the `files` file in the correct syntax and sent it to both configs.
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ sed "s/\s*#.*$//;/^\s*$/d" "${XDG_CONFIG_HOME:-$HOME/.config}/files" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \
>(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \
>(awk '{print "map", $1, ":e", $2 "<CR>" }' >> "$vifm_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "<CR>" }' >> "$vifm_shortcuts") \
| awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"

View File

@ -1,30 +1,31 @@
#!/bin/sh #!/bin/sh
# Prints all batteries, their percentage remaining and an emoji corresponding # Prints all batteries, their percentage remaining and an emoji corresponding
# to charge status (🔌 for pluged up, 🔋 for discharging on battery, etc.). # to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
3) pgrep -x dunst >/dev/null && notify-send "🔋 Battery module" "🔋: discharging 3) notify-send "🔋 Battery module" "🔋: discharging
🛑: not charging 🛑: not charging
♻: stagnant charge ♻: stagnant charge
🔌: charging 🔌: charging
⚡: charged ⚡: charged
❗: battery very low!" ;; ❗: battery very low!" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
# acpi alternative
# acpi | sed "s/Battery [0-9]: //;s/[Dd]ischarging, /🔋/;s/[Nn]ot charging, /🛑/;s/[Cc]harging, /🔌/;s/[Uu]nknown, /♻️/;s/[Ff]ull, /⚡/;s/ \(remaining\|until charged\)//"; exit
# Loop through all attached batteries. # Loop through all attached batteries.
for battery in /sys/class/power_supply/BAT? for battery in /sys/class/power_supply/BAT?
do do
# Get its remaining capacity and charge status. # Get its remaining capacity and charge status.
capacity=$(cat "$battery"/capacity) || exit capacity=$(cat "$battery"/capacity) || break
status=$(cat "$battery"/status) status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/⚡/" "$battery"/status)
# If it is discharging and 25% or less, we will add a ❗ as a warning. # If it is discharging and 25% or less, we will add a ❗ as a warning.
[ "$status" = "Discharging" ] && [ "$capacity" -le 25 ] && warn="❗" [ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
# Print the battery status (replaced by a cooresponding emoji with printf "%s%s%s%% " "$status" "$warn" "$capacity"
# sed), the percentage left and the warning if there is one.
printf "%s%s%s\n" "$(echo "$status" | sed "s/,//;s/Discharging/🔋/;s/Not charging/🛑/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"
unset warn unset warn
done done | sed 's/ *$//'

View File

@ -1,10 +1,29 @@
#!/bin/sh #!/bin/sh
date '+%Y %b %d (%a) %I:%M%p' clock=$(date '+%I')
case "$clock" in
"00") icon="🕛" ;;
"01") icon="🕐" ;;
"02") icon="🕑" ;;
"03") icon="🕒" ;;
"04") icon="🕓" ;;
"05") icon="🕔" ;;
"06") icon="🕕" ;;
"07") icon="🕖" ;;
"08") icon="🕗" ;;
"09") icon="🕘" ;;
"10") icon="🕙" ;;
"11") icon="🕚" ;;
"12") icon="🕛" ;;
esac
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;;
2) $TERMINAL -e calcurse -D ~/.config/calcurse ;; 2) setsid "$TERMINAL" -e calcurse -D ~/.config/calcurse & ;;
3) pgrep -x dunst >/dev/null && notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` 3) notify-send "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\`
- Middle click opens calcurse if installed" ;; - Middle click opens calcurse if installed" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
date "+%Y %b %d (%a) $icon%I:%M%p"

View File

@ -1,10 +1,12 @@
#!/bin/sh #!/bin/sh
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; 1) notify-send "🖥 CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)\\n(100% per core)" ;;
2) setsid "$TERMINAL" -e htop & ;;
3) notify-send "🖥 CPU module " "\- Shows CPU temperature. 3) notify-send "🖥 CPU module " "\- Shows CPU temperature.
- Click to show intensive processes. - Click to show intensive processes.
- % is of single core." ;; - Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
sensors | awk '/Core 0/ {print $3}' sensors | awk '/Core 0/ {print "🌡" $3}'

54
.local/bin/statusbar/crypto Executable file
View File

@ -0,0 +1,54 @@
#!/bin/sh
# Shows the price for desired cryptocurrencies. Module updates automatically
# every calendar day, but can also be updated with a middle click.
# Currencies should be ;-separated:
# human-readable name;urlname;icon
coins="Bitcoin;btc;💰
Etherium;eth;🍸
Basic Attention Token;bat;🦁
LBC;lbc;📚"
# Directory where currency info is stored.
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
getprices() { # The command to get the desired prices
printf "🔃 "; printprices
{ rm -rf "${dir:?}/*"
echo "$coins" | while IFS=';' read -r human web icon; do
val="$(curl -s "rate.sx/1$web")" &&
echo "$icon;$val;$human" > "$dir/$web"
done; [ -d "$dir" ] && touch "$dir"
pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" ;} &
exit
}
printprices() { # Print/format all prices
for x in "$dir"/*; do
[ -f "$x" ] || break
info="$(cut -d';' -f-2 --output-delimiter=' ' "$x")"
printf "%s$%0.2f " $info
done | sed 's/ $/\n/'
}
[ ! -d "$dir" ] && mkdir -p "$dir" && { getprices; exit ;}
# If currencies haven't been updated today, try to update them.
[ "$(stat -c %x "$HOME/.local/share/crypto-prices" | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
{ ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && getprices || exit ;}
case $BLOCK_BUTTON in
1) uptime="$(date -d "$(stat -c %x "$dir")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
notify-send "Exact prices in USD" "$(awk -F';' '{print $1, $3 ":\n\t$" $2}' "$dir"/*)
<b>Last updated:</b>
$uptime" ;;
2) getprices ;;
3) notify-send "💸 Crypto-currency module" "\- Left click for exact prices.
- Middle click to update.
- Shows 🔃 if updating prices.
- Manually add/remove currencies to list in the script." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
printprices

View File

@ -1,18 +1,23 @@
#!/bin/sh #!/bin/sh
# Status bar module for disk space # Status bar module for disk space
# $1 should be drive mountpoint # $1 should be drive mountpoint, otherwise assumed /.
# $2 is optional icon, otherwise mountpoint will displayed
[ -z "$1" ] && exit location=${1:-/}
icon="$2" [ -d "$location" ] || exit
[ -z "$2" ] && icon="$1"
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) pgrep -x dunst >/dev/null && notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;;
3) pgrep -x dunst >/dev/null && notify-send "💽 Disk module" "\- Shows used hard drive space. 3) notify-send "💽 Disk module" "\- Shows used hard drive space.
- Click to show all disk info." ;; - Click to show all disk info." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
printf "%s: %s\n" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" case "$location" in
"/home"* ) icon="🏠" ;;
"/mnt"* ) icon="💾" ;;
*) icon="🖥";;
esac
printf "%s: %s\n" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')"

View File

@ -1,8 +0,0 @@
#!/bin/sh
case $BLOCK_BUTTON in
1) groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - ;;
2) i3 restart ;;
3) pgrep -x dunst >/dev/null && notify-send "❓ Help module" "\- Left click to open LARBS guide.
- Middle click to refresh i3.";;
esac; echo "❓"

17
.local/bin/statusbar/help-icon Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# The clickable help menu. Middle click to restart wm.
# If dwm is running, use dwm's readme and restart.
ps ax | grep -q "\sdwm$" &&
READMEFILE=/usr/local/share/dwm/larbs.mom
restartwm() { pkill -HUP dwm ;} ||
restartwm() { i3 restart ;}
case $BLOCK_BUTTON in
1) groff -mom "${READMEFILE:-${XDG_DATA_HOME:-$HOME/.local/share}/larbs/readme.mom}" -Tpdf | zathura - ;;
2) restartwm ;;
3) notify-send "❓ Help module" "\- Left click to open LARBS guide.
- Middle click to refresh window manager." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac; echo "❓"

View File

@ -1,16 +1,22 @@
#!/bin/sh #!/bin/sh
# Show wifi 📶 and percent strength or 📡 if none.
# Show 🌐 if connected to ethernet or ❎ if none.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e nmtui ;; 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
3) pgrep -x dunst >/dev/null && notify-send "🌐 Internet module" "\- Click to connect 3) notify-send "🌐 Internet module" "\- Click to connect
📡: no wifi connection 📡: no wifi connection
📶: wifi connection with quality 📶: wifi connection with quality
❎: no ethernet ❎: no ethernet
🌐: ethernet working 🌐: ethernet working
" ;; " ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" || case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') down) wifiicon="📡 " ;;
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
esac
printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)"

View File

@ -4,6 +4,7 @@
# displays that information in the statusbar # displays that information in the statusbar
# #
# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ # https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/
ifinstalled "geoiplookup" || exit
ifinstalled "geoip" || exit
addr="$(curl ifconfig.me 2>/dev/null)" || exit addr="$(curl ifconfig.me 2>/dev/null)" || exit
grep "flag: " ~/.config/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" grep "flag: " "${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji" | grep "$(geoiplookup "$addr" | sed 's/.*, //')" | sed "s/flag: //;s/;.*//"

View File

@ -1,20 +1,20 @@
#!/bin/sh #!/bin/sh
# i3blocks mail module.
# Displays number of unread mail and an loading icon if updating. # Displays number of unread mail and an loading icon if updating.
# When clicked, brings up `neomutt`. # When clicked, brings up `neomutt`.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) "$TERMINAL" -e neomutt ;; 1) setsid "$TERMINAL" -e neomutt & ;;
2) setsid mailsync >/dev/null & ;; 2) setsid mailsync >/dev/null & ;;
3) pgrep -x dunst >/dev/null && notify-send "📬 Mail module" "\- Shows unread mail 3) notify-send "📬 Mail module" "\- Shows unread mail
- Shows 🔃 if syncing mail - Shows 🔃 if syncing mail
- Left click opens neomutt - Left click opens neomutt
- Middle click syncs mail" ;; - Middle click syncs mail" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
unread="$(find ~/.local/share/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
icon="$(cat "/tmp/imapsyncicon_$USER")" pidof mbsync >/dev/null 2>&1 && icon="🔃"
[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" [ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬$unread$icon"

View File

@ -2,8 +2,11 @@
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; 1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
2) setsid "$TERMINAL" -e htop & ;;
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total. 3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs." ;; - Click to show memory hogs.
- Middle click to open htop." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
free -h | awk '/^Mem:/ {print $3 "/" $2}' free --mebi | sed -n '2{p;q}' | awk '{printf ("🧠%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}'

View File

@ -1,17 +1,37 @@
#!/bin/sh #!/bin/sh
mnphs=$(pom $1 | grep -o 'New\|Waxing Crescent\|First Quarter\|Waxing Gibbous\|Full\|Waning Gibbous\|Last Quarter\|Waning Crescent' | grep -m1 '.') # Shows the current moon phase.
prcnt=$(pom $1 | grep -o '[[:digit:]]*%')
case "$mnphs" in moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
"New") icon="🌑" prcnt="0%" ;;
"Waxing Crescent") icon="🌒" ;; [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
"First Quarter") icon="🌓" prcnt="50%" ;; { curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
"Waxing Gibbous") icon="🌔" ;;
"Full") icon="🌕" prcnt="100%" ;; icon="$(cat "$moonfile")"
"Waning Gibbous") icon="🌖" ;;
"Last Quarter") icon="🌗" prcnt="50%" ;; case "$icon" in
"Waning Crescent") icon="🌘" ;; 🌑) name="New" ;;
*) echo errorrrr ;; 🌒) name="Waxing Crescent" ;;
🌓) name="First Quarter" ;;
🌔) name="Waxing Gibbous" ;;
🌕) name="Full" ;;
🌖) name="Waning Gibbous" ;;
🌗) name="Last Quarter" ;;
🌘) name="Waning Crescent" ;;
*) exit 1 ;;
esac esac
printf "%s %s\\n" "$icon" "$prcnt" echo "${icon-?}"
case $BLOCK_BUTTON in
3) notify-send "🌜 Moon phase module" "Displays current moon phase.
- 🌑: New
- 🌒: Waxing Crescent
- 🌓: First Quarter
- 🌔: Waxing Gibbous
- 🌕: Full
- 🌖: Waning Gibbous
- 🌗: Last Quarter
- 🌘: Waning Crescent" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -2,6 +2,7 @@
# This loop will update the mpd statusbar module whenever a command changes the # This loop will update the mpd statusbar module whenever a command changes the
# music player's status. mpd must be running on X's start for this to work. # music player's status. mpd must be running on X's start for this to work.
while : ; do while : ; do
mpc idle >/dev/null && pkill -RTMIN+11 "${STATUSBAR:?}" || break mpc idle >/dev/null && kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" || break
done done

View File

@ -1,18 +1,19 @@
#!/bin/sh #!/bin/sh
filter() { filter() { mpc | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/⏸/g;/\\[playing\\].*/d" | paste -sd ' ';}
sed "/^volume:/d" | tac | sed -e "s/\\&/&amp;/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>\n/g"
} pidof -x mpdup >/dev/null 2>&1 || mpdup &
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause 1) mpc status | filter ; setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause
2) mpc toggle | filter ;; # right click, pause/unpause 2) mpc toggle | filter ;; # right click, pause/unpause
3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "🎵 Music module" "\- Shows mpd song playing. 3) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing.
- Italic when paused. - Italic when paused.
- Left click opens ncmpcpp. - Left click opens ncmpcpp.
- Middle click pauses. - Middle click pauses.
- Scroll changes track.";; # right click, pause/unpause - Scroll changes track.";; # right click, pause/unpause
4) mpc prev | filter ;; # scroll up, previous 4) mpc prev | filter ;; # scroll up, previous
5) mpc next | filter ;; # scroll down, next 5) mpc next | filter ;; # scroll down, next
*) mpc status | filter ;; 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;;
esac; exit *) mpc status | filter ;;
esac

25
.local/bin/statusbar/nettraf Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# Module showing network traffic. Shows how much data has been received (RX) or
# transmitted (TX) since the previous time this script ran. So if run every
# second, gives network traffic per second.
case "$BLOCK_BUTTON" in
3) notify-send "🌐 Network traffic module" "🔻: Traffic received
🔺: Traffic transmitted" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
rxfile="${XDG_CACHE_HOME:-$HOME/.cache}/rxlog"
txfile="${XDG_CACHE_HOME:-$HOME/.cache}/txlog"
rxcurrent="$(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+' | bc)"
txcurrent="$(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+' | bc)"
printf "🔻%sKiB 🔺%sKiB\\n" \
"$(printf -- "(%s-%s)/1024\\n" "$rxcurrent" "$(cat "$rxfile")" | bc)" \
"$(printf -- "(%s-%s)/1024\\n" "$txcurrent" "$(cat "$txfile")" | bc)"
# Log the current values for next run.
echo "$rxcurrent" > "$rxfile"
echo "$txcurrent" > "$txfile"

View File

@ -1,17 +1,17 @@
#!/bin/sh #!/bin/sh
# i3blocks newsboat module.
# Displays number of unread news items and an loading icon if updating. # Displays number of unread news items and an loading icon if updating.
# When clicked, brings up `newsboat`. # When clicked, brings up `newsboat`.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e newsboat ;; 1) setsid "$TERMINAL" -e newsboat ;;
2) setsid newsup >/dev/null & exit ;; 2) setsid newsup >/dev/null & exit ;;
3) pgrep -x dunst >/dev/null && notify-send "📰 News module" "\- Shows unread news items 3) notify-send "📰 News module" "\- Shows unread news items
- Shows 🔃 if updating with \`newsup\` - Shows 🔃 if updating with \`newsup\`
- Left click opens newsboat - Left click opens newsboat
- Middle click syncs RSS feeds - Middle click syncs RSS feeds
<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; <b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰" $1}' | sed 's/^📰 0$//g')$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/.update 2>/dev/null)"

View File

@ -15,14 +15,15 @@
# [Action] # [Action]
# Description = Updating statusbar... # Description = Updating statusbar...
# When = PostTransaction # When = PostTransaction
# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e popupgrade ;; 1) setsid "$TERMINAL" -e popupgrade & ;;
2) notify-send "$(/usr/bin/pacman -Qu)" ;; 2) notify-send "$(/usr/bin/pacman -Qu)" ;;
3) pgrep -x dunst >/dev/null && notify-send "Upgrade module" "📦: number of upgradable packages 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages
- Left click to upgrade packages - Left click to upgrade packages
- Middle click to show upgradable packages" ;; - Middle click to show upgradable packages" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
pacman -Qu | grep -v "\[ignored\]" | wc -l | sed "s/^/📦/;s/^📦0$//g" pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g"

View File

@ -3,7 +3,7 @@
printf "Beginning upgrade.\\n" printf "Beginning upgrade.\\n"
yay -Syu yay -Syu
pkill -RTMIN+8 "${STATUSBAR:?}" pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}"
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
read -r read -r

34
.local/bin/statusbar/price Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# Usage:
# price <url> <Name of currency> <icon>
# price bat "Basic Attention Token" 🦁
# When the name of the currency is multi-word, put it in quotes.
[ -z "$3" ] && exit 1
interval="@7d" # History contained in chart preceded by '@' (7d = 7 days)
dir="${XDG_DATA_HOME:-$HOME/.local/share}/crypto-prices"
pricefile="$dir/$1"
chartfile="$dir/$1-chart"
[ -d "$dir" ] || mkdir -p "$dir"
[ "$(stat -c %x "$pricefile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
{ ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/1$1" > "$pricefile" || exit ;}
printf "$3$%0.2f" "$(cat "$pricefile")"
[ "$(stat -c %x "$chartfile" 2>/dev/null | cut -d' ' -f1)" != "$(date '+%Y-%m-%d')" ] &&
{ ping -q -c 1 1.1.1.1 >/dev/null 2>&1 && curl -s "rate.sx/$1$interval" > "$chartfile" || exit ;}
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;;
3) uptime="$(date -d "$(stat -c %x "$pricefile")" '+%D at %T' | sed "s|$(date '+%D')|Today|")"
notify-send "$3 $2 module" "\- <b>Exact price: \$$(cat "$pricefile")</b>
- Left click for chart of changes.
- Middle click to update.
- Shows 🔃 if updating prices.
- <b>Last updated:
$uptime</b>" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

View File

@ -10,18 +10,24 @@ transmission-remote -l | grep % |
s/.*%.*/M/g" | s/.*%.*/M/g" |
sort -h | uniq -c | sed " # Now we replace the standin letters with icons. sort -h | uniq -c | sed " # Now we replace the standin letters with icons.
s/A/🛑/g; s/A/🛑/g;
s/B/⌛️/g; s/B/🕰/g;
s/L/🔼/g; s/L/🔼/g;
s/M/🔽/g; s/M/🔽/g;
s/N/✅/g; s/N/✅/g;
s/Z/🌱/g" | awk '{print $2, $1}' | sed -e "s/ $//g" | tr '\n' ' ' s/Z/🌱/g" | awk '{print $2 $1}' | paste -sd ' '
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e transmission-remote-cli ;; 1) setsid "$TERMINAL" -e tremc & ;;
3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "🛑: paused 2) td-toggle ;;
⏳: idle (seeds needed) 3) notify-send "🌱 Torrent module" "\- Left click to open tremc.
- Middle click to toggle transmission.
- Shift click to edit script.
Module shows number of torrents:
🛑: paused
🕰: idle (seeds needed)
🔼: uploading (unfinished) 🔼: uploading (unfinished)
🔽: downloading 🔽: downloading
✅: done ✅: done
🌱: done and seeding" ;; 🌱: done and seeding" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac

View File

@ -1,20 +1,31 @@
#!/bin/sh #!/bin/sh
# Prints the current volume or 🔇 if muted. Uses PulseAudio by default,
# uncomment the ALSA lines if you remove PulseAudio.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e alsamixer & ;; # 1) setsid "$TERMINAL" -e alsamixer & ;;
2) amixer sset Master toggle ;; # 2) amixer sset Master toggle ;;
4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;; # 4) amixer sset Master 5%+ >/dev/null 2>/dev/null ;;
5) 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. 1) setsid "$TERMINAL" -e pulsemixer & ;;
2) pamixer -t ;;
4) pamixer --allow-boost -i 1 ;;
5) pamixer --allow-boost -d 1 ;;
3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
- Middle click to mute. - Middle click to mute.
- Scroll to change." - Scroll to change." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
volstat="$(amixer get Master)" volstat="$(pactl list sinks)"
# volstat="$(amixer get Master)" # ALSA only equivalent.
echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit echo "$volstat" | grep -q "Mute: yes" && printf "🔇\\n" && exit
# echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit # ALSA
vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") vol="$(echo "$volstat" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")"
# vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed "s/[^0-9]*//g;1q") # ALSA
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
icon="🔊" icon="🔊"
@ -24,4 +35,4 @@ else
icon="🔉" icon="🔉"
fi fi
printf "%s %s%%\\n" "$icon" "$vol" printf "%s%s%%\\n" "$icon" "$vol"

View File

@ -1,22 +1,34 @@
#!/bin/sh #!/bin/sh
getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 # Displays todays precipication chance (☔) and daily low (🥶) and high (🌞).
curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} # Usually intended for the statusbar.
showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" # If we have internet, get a weather report from wttr.in and store it locally.
sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-+\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # You could set up a shell alias to view the full file in a pager in the
# terminal if desired. This function will only be run once a day when needed.
getforecast() { curl -sf "wttr.in/$LOCATION" > "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" || exit 1 ;}
# Some very particular and terse stream manipulation. We get the maximum
# precipication chance and the daily high and low from the downloaded file and
# display them with coresponding emojis.
showweather() { printf "%s" "$(sed '16q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" |
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
sed '13q;d' "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) $TERMINAL -e less -Srf "$HOME/.local/share/weatherreport" ;; 1) setsid "$TERMINAL" -e less -Srf "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" & ;;
2) getforecast && showweather ;; 2) getforecast && showweather ;;
3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module" "\- Left click for full forecast. 3) notify-send "🌈 Weather module" "\- Left click for full forecast.
- Middle click to update forecast. - Middle click to update forecast.
☔: Chance of rain/snow ☔: Chance of rain/snow
❄: Daily low 🥶: Daily low
🌞: Daily high" ;; 🌞: Daily high" ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac esac
if [ "$(stat -c %y "$HOME/.local/share/weatherreport" 2>/dev/null | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] # The test if our forcecast is updated to the day. If it isn't download a new
then getforecast && showweather # weather report from wttr.in with the above function.
else showweather [ "$(stat -c %y "${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
fi getforecast
showweather

21
.local/bin/sysact Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# A dmenu wrapper script for system functions.
# For non-systemd init systems.
case "$(readlink -f /sbin/init)" in
*runit*) hib="sudo -A zzz" ;;
*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p" ;;
esac
cmds="\
🔒 lock slock
🚪 leave dwm kill -TERM $(pidof -s dwm)
♻ renew dwm kill -HUP $(pidof -s dwm)
🐻 hibernate ${hib:-sudo -A systemctl suspend-then-hibernate}
🔃 reboot ${reb:-sudo -A reboot}
🖥 shutdown ${shut:-sudo -A shutdown -h now}"
choice="$(echo "$cmds" | cut -d' ' -f 1 | dmenu)" || exit 1
`echo "$cmds" | grep "^$choice " | cut -d ' ' -f2-`

View File

@ -1,11 +1,12 @@
#!/bin/sh #!/bin/sh
# If transmission-daemon is running, will ask to kill, else will ask to start. # If transmission-daemon is running, will ask to kill, else will ask to start.
if pgrep -x transmission-da >/dev/null ;
if pidof transmission-daemon >/dev/null ;
then then
[ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed." [ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon disabled."
else else
ifinstalled transmission-cli || exit ifinstalled transmission-cli || exit
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started." [ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon enabled."
fi fi
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}" sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
ifinstalled tremc transmission-cli || exit ifinstalled tremc-git transmission-cli || exit
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}" ! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..."
$TERMINAL -e tremc $TERMINAL -e tremc; pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"

View File

@ -2,8 +2,8 @@
# Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running. # Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running.
# transmission-daemon sometimes fails to take remote requests in its first moments. # transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep.
pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:?}") pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}")
transmission-remote -a "$@" && notify-send "🔽 Torrent added." transmission-remote -a "$@" && notify-send "🔽 Torrent added."

View File

@ -1,4 +1,4 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=Image viewer Name=Image viewer
Exec=/usr/bin/sxiv -a %u Exec=/usr/bin/sxiv -a %f

1
.local/share/bg Symbolic link
View File

@ -0,0 +1 @@
../../.config/wall.png

View File

@ -137,7 +137,7 @@ Naturally, you can use \f(CWyay\fP to look for and install any you want to add.
.ITEM .ITEM
\f(CWMod+n\fP \(en newsboat (RSS feed reader) \f(CWMod+n\fP \(en newsboat (RSS feed reader)
.ITEM .ITEM
\f(CWMod+A\fP \(en alsa (audio system control) \f(CWMod+A\fP \(en pulsemixer (audio system control)
.ITEM .ITEM
\f(CWMod+w\fP \(en Web Browser (Brave) \f(CWMod+w\fP \(en Web Browser (Brave)
.ITEM .ITEM
@ -209,7 +209,7 @@ I use ncmpcpp as a music player, which is a front end for mpd.
.ITEM .ITEM
\f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount) \f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount)
.ITEM .ITEM
\f(CWMod+A\fP \(en alsamixer (general volume sink/source control) \f(CWMod+A\fP \(en pulsemixer (general volume sink/source control)
.LIST OFF .LIST OFF
.HEADING 2 "Workspaces" .HEADING 2 "Workspaces"
.PP .PP
@ -266,9 +266,7 @@ These settings may override your preferred settings, so you should open this fil
.PP .PP
On fresh install, the Linux audio system (ALSA) often mutes outputs. On fresh install, the Linux audio system (ALSA) often mutes outputs.
You may want to unbind You may want to unbind
You may also need to set your preferred default output sink which you can do by the command line, or by selecting one with \f(CWalsamixer\fP (\f(CWmod+A\fP). You may also need to set your preferred default output sink which you can do by the command line, or by selecting one with \f(CWpulsemixer\fP (\f(CWmod+A\fP).
If you have a more complex audio setup and can't be bothered to figure out ALSA, you might want to install and enable PulseAudio, which general "just werks".
.HEADING 2 "How do I copy and paste?" .HEADING 2 "How do I copy and paste?"
.PP .PP
Copying and pasting is always program-specific on any system. Copying and pasting is always program-specific on any system.

View File

@ -1,46 +0,0 @@
# Profile file. Runs on login. Environmental variables are set here.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
# Get default LARBS WM from ~/.local/share/larbs/wm
export LARBSWM="$(cat ~/.local/share/larbs/wm 2>/dev/null)" &&
[ "$LARBSWM" = "dwm" ] || export LARBSWM="i3"
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="brave"
export READER="zathura"
export STATUSBAR="${LARBSWM}blocks"
# ~/ Clean-up:
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="$HOME/.config/notmuch-config"
export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="$HOME/.config/wget/wgetrc"
export INPUTRC="$HOME/.config/inputrc"
export ZDOTDIR="$HOME/.config/zsh"
export PASSWORD_STORE_DIR="$HOME/.local/share/password-store"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
[ ! -f ~/.config/shortcutrc ] && shortcuts >/dev/null 2>&1
# Start graphical server on tty1 if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx
# Switch escape and caps if tty and no passwd required:
sudo -n loadkeys ~/.local/share/larbs/ttymaps.kmap 2>/dev/null

1
.profile Symbolic link
View File

@ -0,0 +1 @@
.zprofile

View File

@ -1,22 +0,0 @@
#!/bin/sh
# xinitrc runs automatically when you run startx.
# 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)
# and so they are needed there. To prevent doubling up commands, I source them
# here with the line below.
[ -f ~/.xprofile ] && . ~/.xprofile
# 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

1
.xinitrc Symbolic link
View File

@ -0,0 +1 @@
.config/xinitrc

66
.xprofile Normal file → Executable file
View File

@ -10,72 +10,8 @@ dbus-update-activation-environment --systemd DBUS_SESSION_BUS_ADDRESS DISPLAY XA
mpd & # music player daemon-you might prefer it as a service though mpd & # music player daemon-you might prefer it as a service though
remaps & # run the remaps script, switching caps/esc and more; check it for more info remaps & # run the remaps script, switching caps/esc and more; check it for more info
setbg & # set the background with the `setbg` script setbg & # set the background with the `setbg` script
#xrdb ~/.config/Xresources & # Uncomment to use Xresources colors/settings on startup #xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources & # Uncomment to use Xresources colors/settings on startup
xcompmgr & # xcompmgr for transparency xcompmgr & # xcompmgr for transparency
$STATUSBAR & # start the statusbar
dunst & # dunst for notifications dunst & # dunst for notifications
xset r rate 300 50 & # Speed xrate up xset r rate 300 50 & # Speed xrate up
unclutter & # Remove mouse when idle unclutter & # Remove mouse when idle
mpd-module-update & # Check for when to update the mpd module
# This is the list for lf icons:
export LF_ICONS="di=📁:\
fi=📃:\
tw=🤝:\
ow=📂:\
ln=⛓:\
or=❌:\
ex=🎯:\
*.txt=✍:\
*.mom=✍:\
*.me=✍:\
*.ms=✍:\
*.png=🖼:\
*.ico=🖼:\
*.jpg=📸:\
*.jpeg=📸:\
*.gif=🖼:\
*.svg=🗺:\
*.xcf=🖌:\
*.html=🌎:\
*.xml=📰:\
*.gpg=🔒:\
*.css=🎨:\
*.pdf=📚:\
*.djvu=📚:\
*.epub=📚:\
*.csv=📓:\
*.xlsx=📓:\
*.tex=📜:\
*.md=📘:\
*.r=📊:\
*.R=📊:\
*.rmd=📊:\
*.Rmd=📊:\
*.mp3=🎵:\
*.opus=🎵:\
*.ogg=🎵:\
*.m4a=🎵:\
*.flac=🎼:\
*.mkv=🎥:\
*.mp4=🎥:\
*.webm=🎥:\
*.mpeg=🎥:\
*.zip=📦:\
*.rar=📦:\
*.7z=📦:\
*.tar.gz=📦:\
*.z64=🎮:\
*.v64=🎮:\
*.n64=🎮:\
*.1=:\
*.nfo=:\
*.info=:\
*.log=📙:\
*.iso=📀:\
*.img=📀:\
*.bib=🎓:\
*.ged=👪:\
*.part=💔:\
*.torrent=🔽:\
"

View File

@ -1 +0,0 @@
.profile

125
.zprofile Normal file
View File

@ -0,0 +1,125 @@
#!/bin/zsh
# zsh profile file. Runs on login. Environmental variables are set here.
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
# to clean up.
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')"
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="brave"
export READER="zathura"
# ~/ Clean-up:
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export LESSHISTFILE="-"
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/inputrc"
export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
#export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export WINEPREFIX="${XDG_DATA_HOME:-$HOME/.local/share}/wineprefixes/default"
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/password-store"
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '')"
export LESS_TERMCAP_md="$(printf '%b' '')"
export LESS_TERMCAP_me="$(printf '%b' '')"
export LESS_TERMCAP_so="$(printf '%b' '')"
export LESS_TERMCAP_se="$(printf '%b' '')"
export LESS_TERMCAP_us="$(printf '%b' '')"
export LESS_TERMCAP_ue="$(printf '%b' '')"
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme.
export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads.
export AWT_TOOLKIT="MToolkit wmname LG3D" #May have to install wmname
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm
# This is the list for lf icons:
export LF_ICONS="di=📁:\
fi=📃:\
tw=🤝:\
ow=📂:\
ln=⛓:\
or=❌:\
ex=🎯:\
*.txt=✍:\
*.mom=✍:\
*.me=✍:\
*.ms=✍:\
*.png=🖼:\
*.ico=🖼:\
*.jpg=📸:\
*.jpeg=📸:\
*.gif=🖼:\
*.svg=🗺:\
*.xcf=🖌:\
*.html=🌎:\
*.xml=📰:\
*.gpg=🔒:\
*.css=🎨:\
*.pdf=📚:\
*.djvu=📚:\
*.epub=📚:\
*.csv=📓:\
*.xlsx=📓:\
*.tex=📜:\
*.md=📘:\
*.r=📊:\
*.R=📊:\
*.rmd=📊:\
*.Rmd=📊:\
*.mp3=🎵:\
*.opus=🎵:\
*.ogg=🎵:\
*.m4a=🎵:\
*.flac=🎼:\
*.mkv=🎥:\
*.mp4=🎥:\
*.webm=🎥:\
*.mpeg=🎥:\
*.avi=🎥:\
*.zip=📦:\
*.rar=📦:\
*.7z=📦:\
*.tar.gz=📦:\
*.z64=🎮:\
*.v64=🎮:\
*.n64=🎮:\
*.1=:\
*.nfo=:\
*.info=:\
*.log=📙:\
*.iso=📀:\
*.img=📀:\
*.bib=🎓:\
*.ged=👪:\
*.part=💔:\
*.torrent=🔽:\
"
[ ! -f ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ] && shortcuts >/dev/null 2>&1 &
# Start graphical server on tty1 if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! ps -e | grep -qw Xorg && exec startx
# Switch escape and caps if tty and no passwd required:
sudo -n loadkeys ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/ttymaps.kmap 2>/dev/null