Merge pull request #1 from LukeSmithxyz/master

update fork
This commit is contained in:
skrrtskrrtman 2021-03-25 16:21:49 +08:00 committed by GitHub
commit 263a3c5da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 38 additions and 272 deletions

View File

@ -1,25 +0,0 @@
appearance.calendarview=monthly
appearance.compactpanels=no
appearance.defaultpanel=calendar
appearance.layout=1
appearance.notifybar=yes
appearance.sidebarwidth=1
appearance.theme=red on default
appearance.todoview=show-completed
daemon.enable=no
daemon.log=no
format.inputdate=1
format.notifydate=%a %F
format.notifytime=%T
format.outputdate=%D
general.autogc=no
general.autosave=yes
general.confirmdelete=yes
general.confirmquit=no
general.firstdayofweek=sunday
general.periodicsave=0
general.progressbar=yes
general.systemdialogs=no
notification.command=printf '\a'
notification.notifyall=flagged-only
notification.warning=300

View File

@ -1,47 +0,0 @@
generic-cancel ESC
generic-select SPC
generic-credits @
generic-help ?
generic-quit q Q
generic-save s S ^S
generic-reload R
generic-copy c
generic-paste p ^V
generic-change-view TAB
generic-import i I
generic-export x X
generic-goto g G
generic-other-cmd o O
generic-config-menu C
generic-redraw ^R
generic-add-appt ^A
generic-add-todo ^T
generic-prev-day T ^H
generic-next-day t ^L
generic-prev-week W ^K
generic-next-week w ^J
generic-prev-month M
generic-next-month m
generic-prev-year Y
generic-next-year y
generic-scroll-down ^N
generic-scroll-up ^P
generic-goto-today ^G
generic-command :
move-right l L RGT
move-left h H LFT
move-down j J DWN
move-up k K UP
start-of-week 0
end-of-week $
add-item a A
del-item d D
edit-item e E
view-item v V
pipe-item |
flag-item !
repeat r
edit-note n N
view-note >
raise-priority +
lower-priority -

View File

@ -1,4 +1,4 @@
http://lukesmith.xyz/rss.xml
https://lukesmith.xyz/rss.xml
https://notrelated.libsyn.com/rss
https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Luke Smith (YouTube)"
https://www.archlinux.org/feeds/news/ "tech"

View File

@ -113,13 +113,13 @@ set noshowcmd
" Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e
" When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost bm-files,bm-dirs !shortcuts
" Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufRead,BufNewFile xresources,xdefaults set filetype=xdefaults
autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults
autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb %
" Recompile dwmblocks on config edit.
autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks }

View File

@ -3,11 +3,20 @@
# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
# sudo not required for some system commands
for x in mount umount sv pacman updatedb su ; do
alias $x="sudo $x"
done
# Verbosity and settings that you pretty much just always are going to want.
alias \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
yt="youtube-dl --add-metadata -i" \
yta="yt -x -f bestaudio/best" \
@ -27,7 +36,6 @@ alias \
trem="transmission-remote" \
YT="youtube-viewer" \
sdn="sudo shutdown -h now" \
f="$FILE" \
e="$EDITOR" \
v="$EDITOR" \
p="sudo pacman" \
@ -40,4 +48,3 @@ alias \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/zshnameddirrc" \
weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \
tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf" \

View File

@ -19,7 +19,7 @@ export BROWSER="brave"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
#export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
export XINITRC="${XDG_CONFIG_HOME:-$HOME/.config}/x11/xinitrc"
#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"
@ -40,6 +40,8 @@ export ANSIBLE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/ansible/ansible.cfg"
export UNISON="${XDG_DATA_HOME:-$HOME/.local/share}/unison"
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history"
export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat"
export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config"
export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum"
# Other program settings:
export DICS="/usr/share/stardict/dic/"
@ -142,7 +144,7 @@ ex=🎯:\
if pacman -Qs libxft-bgra >/dev/null 2>&1; then
# Start graphical server on user's current tty if not already running.
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
else
echo "\033[31mIMPORTANT\033[0m: Note that \033[32m\`libxft-bgra\`\033[0m must be installed for this build of dwm.
Please run:

View File

@ -1,58 +0,0 @@
set -g prefix C-a
setw -g mode-keys vi
setw -g mode-style bg=black
set-option -g default-terminal "xterm-256color"
set-option -g pane-active-border-style fg=green
set-window-option -g xterm-keys on # for vim
set-window-option -g mode-keys vi # vi key
set-window-option -g monitor-activity on
set-window-option -g window-status-current-style fg=white
setw -g window-status-current-style reverse
setw -g automatic-rename
set -g mouse on
set -g history-limit 30000
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -sg escape-time 20 # faster escape delay time
set-option -g status-justify right
set-option -g status-bg black # colour213 # pink
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g status-left-length 30
set-option -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]'
set-option -g status-right '#[fg=red,bold][[ #(git branch) branch ]] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
set-option -g visual-activity on
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
unbind j
unbind C-b # unbind default leader key
unbind '"' # unbind horizontal split
unbind % # unbind vertical split
bind-key r source-file ~/.config/tmux/tmux.conf
bind-key c split-window -v # split pane horizontally
bind-key v split-window -h # split pane vertically
bind-key Space list-panes
bind-key Enter break-pane
bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split
bind-key -n C-up prev
bind-key -n C-left prev
bind-key -n C-right next
bind-key -n C-down next
set-window-option -g window-status-current-style bg=red
bind C-c new-window
bind C-j previous-window
bind C-k next-window
#bind-key C-a last-window # C-a C-a for last active window
bind A command-prompt "rename-window %%"
setw -g aggressive-resize on
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h resize-pane -L
bind-key -r C-j resize-pane -D
bind-key -r C-k resize-pane -U
bind-key -r C-l resize-pane -R
bind o select-layout "active-only"
bind M-- select-layout "even-vertical"
bind M-| select-layout "even-horizontal"
bind M-r rotate-window

View File

@ -2,6 +2,7 @@ set sandbox none
set statusbar-h-padding 0
set statusbar-v-padding 0
set page-padding 1
set selection-clipboard clipboard
map u scroll half-up
map d scroll half-down
map D toggle_page_mode

View File

@ -3,10 +3,10 @@
# This file runs when a DM logs you into a graphical session.
# If you use startx/xinit like a Chad, this file will also be sourced.
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
setbg & # set the background with the `setbg` script
#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup
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
xcompmgr & # xcompmgr for transparency
dunst & # dunst for notifications
xset r rate 300 50 & # Speed xrate up

View File

@ -12,3 +12,4 @@ map K zoom in
map J zoom out
map i recolor
map p print
map g goto top

View File

@ -1,9 +0,0 @@
#!/bin/sh
# Notify me with notify-send if my battery is below 25%.
# You can set this to run via cron.
[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit
[ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] &&
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u $USER)/bus &&
notify-send -u critical "Battery critically low."

View File

@ -13,6 +13,6 @@ chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*
if [ -n "$1" ]; then
xdotool type "$chosen"
else
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
printf "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi

View File

@ -27,6 +27,7 @@ if [ -f "$archive" ] ; then
*.tar.bz2|*.tbz2) tar xvjf "$archive" ;;
*.tar.xz) tar -xf "$archive" ;;
*.tar.gz|*.tgz) tar xvzf "$archive" ;;
*.tar.zst) tar -I zstd -xf "$archive" ;;
*.lzma) unlzma "$archive" ;;
*.bz2) bunzip2 "$archive" ;;
*.rar) unrar x -ad "$archive" ;;

View File

@ -16,15 +16,12 @@ case $BLOCK_BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
# Check if battery directories are detected
[ ! -e /sys/class/power_supply/BAT?* ] && echo "No battery found" && exit 1
# Loop through all attached batteries and format the info
for battery in /sys/class/power_supply/BAT?*
do
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
status=$(cat "$battery/status")
case "$status" in
case "$(cat "$battery/status")" in
"Full") status="⚡" ;;
"Discharging") status="🔋" ;;
"Charging") status="🔌" ;;
@ -35,5 +32,5 @@ do
# Will make a warn variable if discharging and low
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
# Prints the info
printf "%s%s%d%%\n" "$status" "$warn" "$capacity"; unset warn
done && return 0
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
done && exit 0

View File

@ -1,54 +0,0 @@
#!/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 example.org >/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

@ -14,7 +14,7 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;}
# display them with coresponding emojis.
showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" |
grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')"
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;}
case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;;

View File

@ -21,7 +21,7 @@ updateprice() { ping -q -c 1 example.org >/dev/null 2>&1 &&
updateprice "$1"
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e less -Sf "$chartfile" ;;
1) setsid "$TERMINAL" -e less -Srf "$chartfile" ;;
2) notify-send -u low "$3 Updating..." "Updating $2 price..."
updateprice "$1" && notify-send "$3 Update complete." "$2 price is now
\$$(cat "$pricefile")" ;;

View File

@ -8,7 +8,9 @@ case "$1" in
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete
rm -rdf "$dir/_minted-$(basename -- $base)"
;;
*) printf "Give .tex file as argument.\\n" ;;
esac

View File

@ -21,5 +21,6 @@ calcurse (calendar) https://www.youtube.com/watch?v=hvc-pHjbhdE
urlview https://www.youtube.com/watch?v=IgzpAjFgbCw
colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE
vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E
pass (password manager) https://www.youtube.com/watch?v=sVkURNfxPd4
"
echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 20 | awk '{print $1}')\s" | sed 's/.*\t//' | xargs -r mpv

View File

@ -1,48 +0,0 @@
_ _____
(_)___ /
| | |_ \
| |___) |
|_|____/
i3 is the window manager.
For a full readme, press super+F1.
This is a partial key list.
esc left workspace exit i3
tab last workspace
- - vol -- vol
_ - vol -- vol
= + vol ++ vol
+ + vol ++ vol
q kill win kill win
w nmtui (wlan) browser
e neomutt tutorials
r ranger winresize
t toggle hor/vert gaps=15px
y calcurse resize left
u dropdown term resize down
i htop resize up
o sticky win resize right
p pause music pause A/V
[ back 10 secs back 2 min
] forward 10 secs forward 2 min
\ last workspace
a calculator audio control
s + inner gaps - inner gaps
d dmenu remove gaps
f fullscreen freeze mode
g left workspace GIMP
h focus left move win left
j focus down move win down
k focus up move win up
l focus right move win right
; right workspace
' fast right win
z + outer gaps - outer gaps
x lock screen shutdown
c webcam
v open Vimwiki
b bar on/off stick/float win (left)
n newsboat stick/float win (right)
m ncmpcpp mute audio
, < previous song restart song
. > next song
/ ? fast win below kill win

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

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

View File

@ -1,3 +1,2 @@
custom: ["https://lukesmith.xyz/donate.html"]
github: lukesmithxyz
custom: ["https://lukesmith.xyz/donate", "https://paypal.me/lukemsmith", "https://lukesmith.xyz/crypto"]
patreon: lukesmith

View File

@ -7,20 +7,17 @@ These are the dotfiles deployed by [LARBS](https://larbs.xyz) and as seen on
- Settings for:
- vim/nvim (text editor)
- zsh (shell)
- sxhkd (general key binder)
- lf (file manager)
- mpd/ncmpcpp (music)
- sxiv (image/gif viewer)
- mpv (video player)
- calcurse (calendar program)
- tmux
- other stuff like xdg default programs, inputrc and more, etc.
- I try to minimize what's directly in `~` so:
- All configs that can be in `~/.config/` are.
- Some environmental variables have been set in `~/.zprofile` to move configs into `~/.config/`
- Bookmarks in text files used by various scripts (like `~/.local/bin/shortcuts`)
- File bookmarks in `~/.config/files`
- Directory bookmarks in `~/.config/directories`
- File bookmarks in `~/.config/shell/bm-files`
- Directory bookmarks in `~/.config/shell/bm-dirs`
## Usage