This commit is contained in:
Dr. Amr Osman 2019-03-29 17:23:04 +02:00
commit be6c4ed480
17 changed files with 163 additions and 2473 deletions

View File

@ -27,7 +27,4 @@ alias ka="killall" \
command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present.
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;}
sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;}
vf() { fzf | xargs -r -I % $EDITOR % ;}

View File

@ -15,3 +15,4 @@ cfn ~/.config/newsboat/config
cfmb ~/.config/ncmpcpp/bindings
cfmc ~/.config/ncmpcpp/config
er ~/Documents/referbib
cfB ~/.config/i3blocks/config

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,11 @@
let mapleader =","
if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree'
@ -14,6 +20,7 @@ Plug 'vifm/vifm.vim'
call plug#end()
set bg=light
set go=a
set mouse=a
set nohlsearch
set clipboard=unnamedplus
@ -216,4 +223,3 @@ set clipboard=unnamedplus
""".xml
autocmd FileType xml inoremap ,e <item><Enter><title><++></title><Enter><guid<space>isPermaLink="false"><++></guid><Enter><pubDate><Esc>:put<Space>=strftime('%a, %d %b %Y %H:%M:%S %z')<Enter>kJA</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>?<title><enter>cit
autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci"

View File

@ -41,6 +41,53 @@ set syscalls
set trash
" This is how many directories to store in the directory history.
set vicmd=$EDITOR
set syscalls
set nofollowlinks
set sortnumbers
set undolevels=100
set wildmenu
set wildstyle=popup
set scrolloff=4
set ignorecase
set smartcase
set nohlsearch
set incsearch
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
colorscheme luke
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <C-o> <C-w>o
map <C-s> <C-w>s
map <C-v> <C-w>v
map R :restart<CR>
map x :!sxiv -ft * 2>/dev/null &<CR>
nnoremap o :file &<cr>
map E :!$EDITOR %f<CR>
map mkd :mkdir<space>
map bg :!setbg %f &<CR>
map X :!ext %f &<CR>
nnoremap s :shell<cr>
nnoremap w :view<cr>
vnoremap w :view<cr>gv
nnoremap yd :!echo %d | xclip %i<cr>
nnoremap yf :!echo %c:p | xclip %i<cr>
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
nnoremap ,w :set wrap!<cr>
nmap <space> tj
nmap q ZQ
fileview */ tree %c -L 1 --dirsfirst
fileview ../ tree %c -L 1 --dirsfirst
fileviewer *.md,*.xml,*.css,*.py,*.c,*.h,*.sh,*.diff,*.tex,*.md,*.bib,*.sty,*.desktop highlight -O ansi %c
fileviewer *.html w3m -dump %c
filextype *.html,*.htm firefox %f 2>/dev/null &
set history=100
@ -244,7 +291,23 @@ filetype *.o nm %f | less
" Man page
filetype *.[1-8] man ./%c
filetype *.csv,*.xlsx sc-im %c
fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c
filextype *.pdf,*.ps,*.eps,*.ps.gz,*.djvu zathura %f 2>/dev/null &,
fileviewer *.pdf pdftotext -l 1 -nopgbrk %c -
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.qt,*.divx,*.as[fx],*mp3,*.flac mediafile %c
filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,*.as[fx] mpv --input-ipc-server=/tmp/mpvsoc$(date +%%s) %f 2>/dev/null &,
fileview *.zip,*.rar,*.tar.gz atool -l %f
filetype *.zip,*.rar,*.tar.gz ext %f
fileviewer *.[1-8] man ./%c | col -b
filetype *.[1-8] man ./%c
fileviewer *.jpg,*.jpeg,*.png,*.ico vifmimg draw %px %py %pw %ph %c %pc vifmimg clear
filextype *.bmp,*.jpg,*.jpeg,*.png,*.ico,*.gif,*.xpm rotdir %f 2>/dev/null | sxiv -ia 2>/dev/null &
" Images
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
@ -519,3 +582,7 @@ nnoremap bg : !setbg '%f' <cr>
" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
"
" let $VIFM_SERVER_NAME = v:servername
filextype *.svg inkscape %f 2>/dev/null &
filextype *.xcf gimp %f 2>/dev/null &
set vifminfo=dhistory,chistory,tui,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks

View File

@ -90,7 +90,7 @@ If you just want black and white icons, you should actually just be able to unin
.FOOTNOTE END
.PP
The i3blocks config is \f(CW~/.config/i3blocks/config\fP, which you can access by the
terminal shortcut \f(CWcfib\fP. Notice that the config file refers to several module
terminal shortcut \f(CWcfB\fP. Notice that the config file refers to several module
scripts in the \f(CW~/.scripts/\fP directory. You can read a summary of all of these
scripts in the file \f(CW~/.scripts/SCRIPTS.md\fP.
.HEADING 2 "Deeper Tutorials"
@ -163,7 +163,7 @@ This indicates the direction that the next window will spawn.
Naturally, you can use \f(CWyay\fP to look for and install any you want to add.
.LI
.ITEM
\f(CWMod+r\fP \(en ranger (file browser/manager)
\f(CWMod+r\fP \(en vifm (file browser/manager)
.ITEM
\f(CWMod+e\fP \(en mutt (email; not installed by default, see below)
.ITEM
@ -307,17 +307,17 @@ would expect.
.PP
Note the files \f(CW~/.config/bmdirs\fP and \f(CW~/.config/bmfiles\fP.
These files hold bookmarked directories and files respectively, along with shortcut keys to their left.
LARBS, specfically the \f(CWshortcuts\fP script, will automatically read these files and autogenerate aliases and shortcuts for bash/zsh and ranger from them.
LARBS, specfically the \f(CWshortcuts\fP script, will automatically read these files and autogenerate aliases and shortcuts for bash/zsh and vifm from them.
.PP
For example, by default, the shortcut key for \f(CW~/Documents\fP is simply \f(CWd\fP.
Thus, if you type and run \f(CWd\fP in bash, you will automatically \f(CWcd\fP to \f(CW~/Documents\fP.
It also generates four ranger shortcuts using the shortcut \f(CWd\fP:
It also generates four vifm shortcuts using the shortcut \f(CWd\fP:
.LI
.ITEM
\f(CWgd\fP \(en
Go to \f(CW~/Documents\fP
.ITEM
\f(CWmd\fP \(en
\f(CWMd\fP \(en
Move (mv) selected file(s) to \f(CW~/Documents\fP
.ITEM
\f(CWtd\fP \(en
@ -328,9 +328,9 @@ Copy/yank (cp) a copy of the selected file(s) to \f(CWDocuments\fP
.LIST OFF
Shortcuts like these are generated for all key sequence/directory pairs in \f(CW~/.config/bmdirs\fP.
Additionally, you may also add editable files to \f(CW~/.config/bmfiles\fP.
Each key sequence you pair with a file will become an alias to edit it in either bash or ranger.
Each key sequence you pair with a file will become an alias to edit it in either bash or vifm.
.PP
Whenever you edit and save one of the bookmark files, vim will automatically rerun the shortcut script, thus updating the shortcuts that will be used in new instances of bash and ranger.
Whenever you edit and save one of the bookmark files, vim will automatically rerun the shortcut script, thus updating the shortcuts that will be used in new instances of bash and vifm.
It just werks.
Note that it is your responsibility to ensure that none of the bindings you add conflict with another necessary function or command.
.HEADING 1 "Frequently Asked Questions (FAQs)"

View File

@ -1,9 +1,9 @@
#!/bin/sh
# Syncs repositories and downloads updates, meant to be run as a cronjob.
ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
ping -q -c 1 1.1.1.1 > /dev/null || exit
notify-send -i "$PIX/larbs.svg" "Checking for package updates..."
notify-send "📦 Checking for package updates..."
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
@ -12,7 +12,7 @@ pkill -RTMIN+8 i3blocks
if pacman -Qu | grep -v "\[ignored\]"
then
notify-send -i "$PIX/larbs.gif" "Package updates available. Click statusbar icon (📦) for update."
notify-send "🎁 Package updates available. Click statusbar icon (📦) for update."
else
notify-send -i "$PIX/larbs.gif" "Repository sync complete. No new packages for update."
notify-send "📦 Repository sync complete. No new packages for update."
fi

View File

@ -2,4 +2,4 @@
# Toggles all cronjobs off/on.
# Stores disabled crontabs in ~/.consaved until restored.
([ -f ~/.cronsaved ] && crontab - < ~/.cronsaved && rm ~/.cronsaved && notify-send "🕓 Cronjobs re-enabled.") || ( crontab -l > ~/.cronsaved && crontab -r && notify-send "🕓 Cronjobs saved and disabled.")
([ -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.")

View File

@ -2,9 +2,9 @@
# Set as a cron job to check for new RSS entries for newsboat.
# If newsboat is open, sends it an "R" key to refresh.
ping -q -t 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
ping -q -c 1 1.1.1.1 > /dev/null || exit
/usr/bin/notify-send -i "$PIX/rss.svg" "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
@ -13,4 +13,4 @@ pkill -RTMIN+6 i3blocks
/usr/bin/newsboat -x reload
rm -f /tmp/newsupdate
pkill -RTMIN+6 i3blocks
/usr/bin/notify-send -i "$PIX/rss.svg" "RSS feed update complete."
/usr/bin/notify-send "📰 RSS feed update complete."

View File

@ -17,21 +17,21 @@ getmount() { \
mountusb() { \
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
sudo -A mount "$chosen" && notify-send -i "$PIX/usb.svg" "$chosen mounted." && exit 0
sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0
getmount "/mnt /media /mount /home -maxdepth 5 -type d"
partitiontype="$(lsblk -no "fstype" "$chosen")"
case "$partitiontype" in
"vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;
*) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";;
esac
notify-send -i "$PIX/usb.svg" "$chosen mounted to $mp."
notify-send "$chosen mounted to $mp."
}
mountandroid() { \
chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1)
getmount "$HOME -maxdepth 3 -type d"
simple-mtpfs --device "$chosen" "$mp"
notify-send -i "$PIX/android.svg" "Android device mounted to $mp."
notify-send "Android device mounted to $mp."
}
asktype() { \

View File

@ -7,13 +7,13 @@ unmountusb() {
[ -z "$drives" ] && exit
chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}')
[ -z "$chosen" ] && exit
sudo -A umount "$chosen" && pgrep -x dunst && notify-send -i "$PIX/usb.svg" "$chosen unmounted."
sudo -A umount "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
}
unmountandroid() { \
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
[ -z "$chosen" ] && exit
sudo -A umount -l "$chosen" && pgrep -x dunst && notify-send -i "$PIX/android.svg" "$chosen unmounted."
sudo -A umount -l "$chosen" && pgrep -x dunst && notify-send "$chosen unmounted."
}
asktype() { \

View File

@ -2,9 +2,9 @@
# If transmission-daemon is running, will ask to kill, else will ask to start.
if pgrep -x transmission-da >/dev/null ;
then
[ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send -i "$PIX/torrent.svg" "transmission-daemon killed."
[ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed."
else
ifinstalled transmission-cli || exit
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send -i "$PIX/torrent.svg" "tranmission-daemon started."
[ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started."
fi
sleep 3 && pkill -RTMIN+7 i3blocks

View File

@ -1,6 +1,6 @@
#!/bin/sh
ifinstalled transmission-remote-cli transmission-cli || exit
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send -i "$PIX/torrent.svg" "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks
! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks
$TERMINAL -e transmission-remote-cli

View File

@ -2,7 +2,7 @@
[ "$(stat -c %y /tmp/weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast
case $BLOCK_BUTTON in
1) $TERMINAL -e less -S /tmp/weatherreport ;;
1) $TERMINAL -e less -S -R /tmp/weatherreport ;;
3) pgrep -x dunst >/dev/null && notify-send "<b>🌈 Weather module:</b>
- Click for wttr.in forecast.
☔: Chance of rain/snow

View File

@ -1,3 +1,8 @@
#!/bin/sh
# Give this script a filename argument. Returns PWD rotated with that file first.
ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$1$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }"
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
ed -s <<EOF
r !find "$PWD" -maxdepth 1
g/$1/m0
,p
Q
EOF

View File

@ -1,9 +1,9 @@
#!/bin/sh
! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null &&
notify-send -i "$PIX/rss.svg" "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"
if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then
notify-send -i "$PIX/rss.svg" "You already have this RSS feed."
notify-send "You already have this RSS feed."
else
echo "$1" >> "$RSSFILE" && notify-send -i "$PIX/rss.svg" "RSS feed added."
echo "$1" >> "$RSSFILE" && notify-send "RSS feed added."
fi

54
README.md Normal file
View File

@ -0,0 +1,54 @@
# Luke's GNU/Linux Dotfiles
These are my dotfiles! The name of the repo, "voidrice", came from the fact they were originally on my Void Linux machine, but these files are distro-independent. In fact, I now push changes from my X200 running Parabola or my X220 running Arch.
## Programs whose configs can be found here
+ i3 (i3-gaps)
+ Xresourses info used by [my st build](https://github.com/lukesmithxyz/st) as a terminal
+ vim
+ bash
+ vifm
+ ranger
+ ~~mutt/msmtp/offlineimap~~ Now moved to [LukeSmithxyz/mutt-wizard](https://github.com/LukeSmithxyz/mutt-wizard)
+ calcurse
+ ncmpcpp and mpd (my main music player)
+ mpv
+ neofetch
+ And many little scripts I use filed in the `~/.scripts/` directory
## More documentation
There's a full .pdf write-up of the repository [here: https://larbs.xyz/larbs_readme.pdf](https://larbs.xyz/larbs_readme.pdf).
Or, if you actually installed my dotfiles, you can just press `Super+F1` to
show the same document offline.
In the system, you can also press `Super+Shift+e` to watch tutorial videos on
different programs used. See [my YouTube channel](https://youtube.com/c/LukeSmithxyz) for more.
The command `getkeys` will also show basic key binds for different programs.
## Dynamic Configuration Files
Store your favorite or high-traffic directories in `~/.config/bmdirs` or your most
important config files in `~/.config/bmfiles` with keyboard shortcuts. When you add
things to theses files my vimrc will automatically run `shortcuts` which will
dynamically generate shortcuts for these in bash, ranger and optionally
qutebrowser and fish.
## Like my rice?
Feel free to add other suggestions and I may implement them.
I have a job, but every penny I get from followers or subscribers is more incentive to perfect what I'm doing.
You can donate to me at [https://paypal.me/LukeMSmith](https://paypal.me/LukeMSmith).
Donations are earmarked for whatever the donator wants, usually to go to funds for buying new equipment for the [YouTube channel](https://youtube.com/c/LukeSmithxyz).
# "Dependencies" and programs used
The programs I use here are always changing, but luckily you can just look at the installation list for [LARBS](http://larbs.xyz) here:
+ [List of programs installed by LARBS, including optional packages](https://github.com/LukeSmithxyz/LARBS/blob/master/progs.csv)
`A` marks programs in the AUR, `G` marks git repositories.