@@ -58,10 +58,13 @@ When a file is opened with prompt open, it moves to the top of the home list | |||||
#### COMMMAND | #### COMMMAND | ||||
- init | - init | ||||
- update | - update | ||||
- updatedirs | |||||
- output | - output | ||||
- list | - list | ||||
- insert [ FILE ] | - insert [ FILE ] | ||||
### Get Started | |||||
`mru init; mru update; mru updatedirs` | |||||
#### Notes | #### Notes | ||||
- by default, it ignores hidden directories | - by default, it ignores hidden directories | ||||
- If no cache is specified, it assumes 'home' | - If no cache is specified, it assumes 'home' | ||||
@@ -71,14 +74,17 @@ When a file is opened with prompt open, it moves to the top of the home list | |||||
- If if the file passed to `mru insert` does not exist, it is removed from the cache | - If if the file passed to `mru insert` does not exist, it is removed from the cache | ||||
- You may want to run mru update at startup to add new files and cleanup hidden | - You may want to run mru update at startup to add new files and cleanup hidden | ||||
files in .cache/mru | files in .cache/mru | ||||
- You don't need to install jump or some other hack to switch directories | |||||
quickly. Use this alias: | |||||
`alias cdz='cd $((mru listdirs | fzf --height=50%) || printf ".")'` | |||||
### Initializing | ### Initializing | ||||
mru init | mru init | ||||
## pages | ## pages | ||||
pages is a command for viewing /tmp/pages-{number} files with less or zathura. | |||||
pages is a command for viewing /tmp/pages-{number} files with st or zathura. | |||||
The files are the result of prompt commands like `prompt search` -> Go page or | The files are the result of prompt commands like `prompt search` -> Go page or | ||||
can be created from your own tools. I use it for viewing local documentation | |||||
can be created from your own scripts. I use it for viewing local documentation | |||||
quickly. | quickly. | ||||
### Usage | ### Usage | ||||
@@ -90,9 +96,10 @@ exists. | |||||
#### Notes | #### Notes | ||||
* Page names don't have to be numbers, here is an example vim Ex mode command I | * Page names don't have to be numbers, here is an example vim Ex mode command I | ||||
use to convert a markdown file to html and open it in a browser: `:!markdown | |||||
% | pages send 1.html | pages browser 1.html` This could then be given it's | |||||
own keybinding. | |||||
use to convert a markdown file to html and open it in a browser: | |||||
`:!markdown | |||||
% | pages send 1.html | pages browser 1.html` | |||||
This could be given it's own keybinding. | |||||
#### TODO | #### TODO | ||||
- Finish vpn and networking stuff after ini script is finished, then make sure | - Finish vpn and networking stuff after ini script is finished, then make sure | ||||
@@ -1,12 +1,13 @@ | |||||
#!/bin/sh | |||||
#!/bin/bash | |||||
setxkbmap -option caps:swapescape | setxkbmap -option caps:swapescape | ||||
source ~/.profile | |||||
picom -b | picom -b | ||||
~/.fehbg | ~/.fehbg | ||||
xbindkeys -f $HOME/backups/configs/xbindkeysrc | xbindkeys -f $HOME/backups/configs/xbindkeysrc | ||||
( mru update; mru updatedirs ) & | ( mru update; mru updatedirs ) & | ||||
# relaunch DWM if the binary changes, otherwise bail | # relaunch DWM if the binary changes, otherwise bail | ||||
csum=$(sha1sum $(which dwm.winkey)) | |||||
csum=$(sha1sum $(which dwm)) | |||||
new_csum="" | new_csum="" | ||||
while true | while true | ||||
do | do | ||||
@@ -18,6 +19,6 @@ do | |||||
else | else | ||||
exit 0 | exit 0 | ||||
fi | fi | ||||
new_csum=$(sha1sum $(which dwm.winkey)) | |||||
new_csum=$(sha1sum $(which dwm)) | |||||
sleep 0.5 | sleep 0.5 | ||||
done | done |
@@ -3,9 +3,11 @@ | |||||
if ! { [ "$TERM" = "tmux-256color" ] && [ -n "$TMUX" ]; } then | if ! { [ "$TERM" = "tmux-256color" ] && [ -n "$TMUX" ]; } then | ||||
# Remove option --tab for new window | # Remove option --tab for new window | ||||
st -e vim $* | |||||
st -e vim "$@" | |||||
else | else | ||||
# tmux session running | # tmux session running | ||||
vim $* #tmux -u split-window "vim \"$*\"" | |||||
# tmux -u split-window vim "$@" | |||||
# wait $! | |||||
vim "$@" | |||||
fi | fi | ||||
@@ -3,8 +3,6 @@ | |||||
#To add more caches, add a newline to this string and follow the existing name:path format | #To add more caches, add a newline to this string and follow the existing name:path format | ||||
#Edit create_new to change find behaviour | #Edit create_new to change find behaviour | ||||
cache_info="home:$HOME" | cache_info="home:$HOME" | ||||
HOME=/home/immanuel | |||||
XDG_CACHE_HOME="$HOME/.cache" | |||||
init() { | init() { | ||||
mkdir -p $XDG_CACHE_HOME/mru | mkdir -p $XDG_CACHE_HOME/mru | ||||
@@ -68,7 +66,8 @@ output() { | |||||
file1="$XDG_CACHE_HOME/mru/$1.recent"; file2="$XDG_CACHE_HOME/mru/$1" | file1="$XDG_CACHE_HOME/mru/$1.recent"; file2="$XDG_CACHE_HOME/mru/$1" | ||||
fi | fi | ||||
cat $file1; printf "\n"; cat $file2 | |||||
if [ -s $file1 ]; then cat $file1; printf "\n"; fi | |||||
cat $file2 | |||||
} | } | ||||
list() { | list() { | ||||
@@ -0,0 +1,14 @@ | |||||
#!/bin/sh | |||||
for f in "$@"; do | |||||
# mpc insert $HOME/music/$f | |||||
mpc insert "$(realpath "$f")" | |||||
done | |||||
if [ -z $(mpc current) ]; then | |||||
mpc play | |||||
else | |||||
mpc next | |||||
fi | |||||
# mpc single on |
@@ -22,6 +22,7 @@ launch() { | |||||
Page | Page | ||||
Go page | Go page | ||||
Package info | Package info | ||||
Images | |||||
Play clipboard | Play clipboard | ||||
Play downloads | Play downloads | ||||
Processes" | tr -d '\t' | | Processes" | tr -d '\t' | | ||||
@@ -45,6 +46,7 @@ launch() { | |||||
Browser) $browser_cmd;; | Browser) $browser_cmd;; | ||||
'Hidden browser') $browser_cmd --incognito;; | 'Hidden browser') $browser_cmd --incognito;; | ||||
Email) $browser_cmd mail.protonmail.com/login;; | Email) $browser_cmd mail.protonmail.com/login;; | ||||
Images) view_images;; | |||||
'Play clipboard') mpv "$(xclip -o -selection clipboard)";; | 'Play clipboard') mpv "$(xclip -o -selection clipboard)";; | ||||
'Play downloads') mpv "$HOME/downloads/tmp/$(ls ~/downloads/tmp/ | dmenu -i -l 10 -p 'play')";; | 'Play downloads') mpv "$HOME/downloads/tmp/$(ls ~/downloads/tmp/ | dmenu -i -l 10 -p 'play')";; | ||||
Processes) st -t "Processes" -e htop;; | Processes) st -t "Processes" -e htop;; | ||||
@@ -55,6 +57,7 @@ action() { | |||||
action=$(printf "Toggle Music | action=$(printf "Toggle Music | ||||
Pause Music | Pause Music | ||||
Play Music | Play Music | ||||
Single on | |||||
Command | Command | ||||
Command to clipboard | Command to clipboard | ||||
Select VPN | Select VPN | ||||
@@ -76,7 +79,8 @@ action() { | |||||
case $action in | case $action in | ||||
'Play Music') mpc play ;; | 'Play Music') mpc play ;; | ||||
'Pause Music') mpc pause ;; | 'Pause Music') mpc pause ;; | ||||
'Toggle Music') mpc toggle ;; | |||||
'Toggle Music') mpc toggle;; | |||||
'Single on') mpc toggle;; | |||||
'Rebind Keys') setup-xbindkeys;; | 'Rebind Keys') setup-xbindkeys;; | ||||
'Disable Bar') tmux set -g status off;; | 'Disable Bar') tmux set -g status off;; | ||||
'Enable Bar') tmux set -g status on;; | 'Enable Bar') tmux set -g status on;; | ||||
@@ -129,19 +133,26 @@ do_search() { | |||||
} | } | ||||
download() { | download() { | ||||
youtube-dl --no-progress -o "$HOME/downloads/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
youtube-dl --add-metadata --no-progress -o "$HOME/downloads/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
notify-send -u low -t 3000 "Download complete" | notify-send -u low -t 3000 "Download complete" | ||||
} | } | ||||
download_music() { | download_music() { | ||||
youtube-dl --no-progress -f bestaudio -o \ | |||||
"$HOME/downloads/music/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \ | |||||
"$HOME/music/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
if [ ! $? ]; then | if [ ! $? ]; then | ||||
youtube-dl --no-progress -f bestaudio -o \ | |||||
"$HOME/downloads/music/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
youtube-dl -x --no-progress --audio-format mp3 -o \ | |||||
"$HOME/music/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" | |||||
fi | fi | ||||
notify-send -u low -t 3000 "Download complete" | notify-send -u low -t 3000 "Download complete" | ||||
} | } | ||||
view_images() { | |||||
d=$(mru listdirs | dmenu -l 20 -i -p 'where?') | |||||
if [ -z "$d" ]; then exit; fi | |||||
sxiv -r "$d" | |||||
} | |||||
package() { | package() { | ||||
type=$(printf "search\ninfo" | dmenu -p 'package') | type=$(printf "search\ninfo" | dmenu -p 'package') | ||||
if [ -z "$type" ]; then | if [ -z "$type" ]; then | ||||
@@ -1,7 +0,0 @@ | |||||
#!/bin/sh | |||||
method=$(printf "clipboard\nfile\nboth" | dmenu -l 3) | |||||
if test $method = "file"; then | |||||
scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'" -s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png | |||||
fi |
@@ -1,24 +0,0 @@ | |||||
REMOTE_USER="immanuel" | |||||
REMOTE_DIRECTORY="/home/immanuel/Dropoff/" | |||||
LOCAL_DIR=$HOME/Dropoff | |||||
pull () { | |||||
rsync -aP "$REMOTE_USER@$1:$REMOTE_DIRECTORY " "$LOCAL_DIR" | |||||
} | |||||
push () { | |||||
rsync -a "$LOCAL_DIR" "ssh://$REMOTE_USER@$1:$REMOTE_DIRECTORY" | |||||
} | |||||
while getopts a:u: option | |||||
do | |||||
case "${option}" in | |||||
a) destination=$OPTARG | |||||
echo $destination | |||||
pull $destination;; | |||||
u) destination=$OPTARG | |||||
push $destination;; | |||||
esac | |||||
done | |||||
@@ -1,3 +0,0 @@ | |||||
#!/bin/sh | |||||
st -t 'Editor' -e vim $* |
@@ -0,0 +1,8 @@ | |||||
#!/bin/sh | |||||
if [ "$TERM" = "tmux-256color" ]; then | |||||
tmux -u split-window vim "$@" | |||||
else | |||||
st -t "Editor" -e vim "$@" & | |||||
fi |
@@ -1,5 +1,5 @@ | |||||
#!/bin/sh | #!/bin/sh | ||||
BACKUPS_PATH=$HOME/Backups | |||||
#A file for managing git tar/git backups | |||||
gitcmd() { | gitcmd() { | ||||
#First arg should be the name of the subdirectory, second arg should be command | #First arg should be the name of the subdirectory, second arg should be command | ||||
check_args $# 2 | check_args $# 2 | ||||
@@ -1,2 +0,0 @@ | |||||
#!/bin/sh | |||||