1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-07-01 06:46:28 +00:00

Large general cleanup of bin, functions, configs

This commit is contained in:
Phantop 2021-01-24 00:49:08 -05:00
parent 3c857c5d5d
commit 7da33d7301
25 changed files with 97 additions and 182 deletions

24
.bashrc
View file

@ -1,10 +1,8 @@
eval "$(starship init bash)" eval "$(starship init bash)"
source /usr/share/autojump/autojump.bash source /usr/share/autojump/autojump.bash
source /usr/share/defaults/etc/profile
# Sensible Bash - An attempt at saner Bash defaults # Sensible Bash: https://github.com/mrzool/bash-sensible
# Maintainer: mrzool <http://mrzool.cc>
# Repository: https://github.com/mrzool/bash-sensible
# Version: 0.2.2
## GENERAL OPTIONS ## ## GENERAL OPTIONS ##
@ -64,6 +62,7 @@ export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
# %F equivalent to %Y-%m-%d # %F equivalent to %Y-%m-%d
# %T equivalent to %H:%M:%S (24-hours format) # %T equivalent to %H:%M:%S (24-hours format)
HISTTIMEFORMAT='%F %T ' HISTTIMEFORMAT='%F %T '
# Version: 0.2.2
# Enable incremental history search with up/down arrows (also Readline goodness) # Enable incremental history search with up/down arrows (also Readline goodness)
# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/ # Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/
@ -87,23 +86,17 @@ shopt -s cdable_vars
#aliases #aliases
alias cd='cd -P' alias cd='cd -P'
alias caddy='python3 -m http.server' alias cpugov='sudo cpupower frequency-set -g performance'
alias cpugov='sudo cpupower frequency-set -g performance > /dev/null && echo Now in performance mode'
alias dirdl='wget -r -k -p --no-parent --no-clobber -e robots=off' alias dirdl='wget -r -k -p --no-parent --no-clobber -e robots=off'
alias dot='cd ~/.dotfiles' alias dot='cd ~/.dotfiles'
alias D='cd $D' alias D='cd $D'
alias ff='fd -E sys -E caches -E cache -E .cache -E graphicPacks -E proc -E dosdevices -E .git -H -d 5 -L -i' alias ff='fd -HILi -Edosdevices -E.git'
alias ffd='ff -t d'
alias flacc='flac -f -8 -V'
alias g=git alias g=git
alias giveme='s chown $USER' alias giveme='s chown $USER'
alias hardinfo='inxi -SPARM -GCDN -v1 -xGCRS -Fxz' alias hardinfo='inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
alias kj='kill -9 $(jobs -p | grep -v Process)'
alias l=ls alias l=ls
alias launcher='rofi -combi-modi "drun,run" -show combi -modi "combi,window" -drun-icon-theme Papirus' alias launcher='rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
alias la='l -a' alias la='l -a'
alias mpva='mpv --no-video'
alias murder='killall -s SIGKILL'
alias off=shutdown alias off=shutdown
alias open=xdg-open alias open=xdg-open
alias pagedl='wget -H -k -p --no-clobber -e robots=off' alias pagedl='wget -H -k -p --no-clobber -e robots=off'
@ -117,12 +110,11 @@ alias ta='tmux attach -t'
alias up='se up --y' alias up='se up --y'
alias vi=nvim alias vi=nvim
alias v=vi alias v=vi
alias ydl="youtube-dlc --continue --ignore-errors --no-overwrites --write-sub --embed-subs -o '%(title)s.%(ext)s'" alias ydl="youtube-dlc -ciw --write-sub --write-auto-sub --embed-subs --sub-lang=en -o '%(title)s.%(ext)s'"
alias ydl4='ydl --format mp4'
#functions #functions
dl(){ dl(){
[[ "$#" -ge 1 ]] && aria2c --file-allocation=none -c -x 16 -s 16 $argv || cd ~/Downloads/ [[ "$#" -ge 1 ]] && aria2c -c -x16 -s16 $argv || cd ~/Downloads/
} }
qb(){ qb(){
qutebrowser $@ --target auto & disown qutebrowser $@ --target auto & disown

View file

@ -2,4 +2,4 @@
Type=Application Type=Application
Name=Invidious Name=Invidious
Description= Description=
Exec=fish -c invidious Exec=fish -c invid

View file

@ -7,17 +7,3 @@ if (get_application_name()=="Steam") then
set_window_workspace(2) set_window_workspace(2)
minimize() minimize()
end end
if (get_window_name()=="Information") then
make_always_on_top()
end
if (get_window_name()=="mpv-wallpaper") then
pin_window()
set_window_below()
set_skip_pager(true)
set_skip_tasklist(true)
stick_window()
undecorate_window()
set_window_type("WINDOW_TYPE_DESKTOP")
end

View file

@ -1,6 +1,2 @@
test (hostname) = aperture && set -gx D /mnt/LocalDiskD || set -gx D ~
set fish_user_paths ~/.local/bin /usr/lib/ccache/bin
export EDITOR=nvim PAGER=most export EDITOR=nvim PAGER=most
tty -s && starship init fish | source && source /usr/share/autojump/autojump.fish tty -s && starship init fish | source && source /usr/share/autojump/autojump.fish

View file

@ -1,5 +1,6 @@
# This file contains fish universal variable definitions. # This file contains fish universal variable definitions.
# VERSION: 3.0 # VERSION: 3.0
SETUVAR D:/mnt/LocalDiskD
SETUVAR __fish_init_2_39_8:\x1d SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d SETUVAR __fish_init_2_3_0:\x1d
SETUVAR __fish_init_3_x:\x1d SETUVAR __fish_init_3_x:\x1d
@ -34,3 +35,4 @@ SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_user_paths:/home/glados/\x2elocal/bin\x1e/usr/lib/ccache/bin

View file

@ -1,3 +1,3 @@
function dl -w aria2c function dl -w aria2c
test $argv && aria2c --file-allocation=none -c -x 16 -s 16 $argv || cd ~/Downloads/ test "$argv" && aria2c -c -x16 -s16 $argv || cd ~/Downloads
end end

View file

@ -1,3 +1,3 @@
function ta -w math function ta -w math
tmux attach -t (math 0 + "0$argv") tmux a -t (math 0 + "0$argv")
end end

View file

@ -1,49 +1,30 @@
input-ipc-server=/tmp/mpvsocket hwdec = yes
cache=yes save-position-on-quit = yes
gapless-audio=yes screenshot-format = png
save-position-on-quit=yes gapless-audio = yes
screenshot-format=png volume-max = 1000
screenshot-png-compression=8
volume-max=1000
demuxer-max-bytes=2147483647
demuxer-max-back-bytes=2147483647
hwdec=yes
audio-file-auto=exact cache = yes
audio-file-paths=../Custom Tracks:./Custom Tracks:../Audio:./Audio demuxer-max-bytes = 2147483647
sub-file-paths=../Subtitles:./Subtitles:../Subs:./Subs demuxer-max-back-bytes = 2147483647
audio-file-auto = exact
audio-file-paths = ../Custom Tracks:./Custom Tracks:../Audio:./Audio
sub-file-paths = ../Subtitles:./Subtitles:../Subs:./Subs
use-filedir-conf use-filedir-conf
sub-font=Funimitation sub-font = Funimitation
sub-font-size=36 sub-font-size = 36
hls-bitrate=max scale = spline36
profile-desc=cond:dedicated_gpu() cscale = spline36
dscale = spline36
scale=spline36
cscale=spline36
dscale=mitchell
scale-antiring=0
cscale-antiring=0
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes
[wallpaper] [wallpaper]
title=mpv-wallpaper loop
geometry=100%x100% aid = no
border=no sid = no
no-window-dragging start = 0
x11-name=mpv-wallpaper panscan = 1
loop-file=yes load-scripts = no
idle=no
aid=no
sid=no
load-scripts=no
no-input-default-bindings
no-stop-screensaver no-stop-screensaver
on-all-workspaces
start=0:00
panscan=1
osc=no

View file

@ -47,7 +47,7 @@ map r "_d
se background=dark se background=dark
colorscheme dracula colorscheme dracula
se termguicolors " Enable GUI colors for the terminal to get truecolor se termguicolors
autocmd FileType * se tw=0 autocmd FileType * se tw=0

View file

@ -1,6 +1,7 @@
docs https://docs.google.com/document/u/0/ docs https://docs.google.com
class https://classroom.google.com/u/0/ class https://classroom.google.com
drive https://drive.google.com/drive/u/0/ drive https://drive.google.com
tuta https://mail.tutanota.com/ tuta https://mail.tutanota.com
discord https://discord.com/channels/@me discord https://discord.com/app
hn https://news.ycombinator.com/ hn https://news.ycombinator.com
drop https://drop.lol

View file

@ -1,4 +1,3 @@
# Don't print a new line at the start of the prompt
add_newline = false add_newline = false
[git_branch] [git_branch]
@ -9,7 +8,7 @@ success_symbol = "[](bright-purple)"
[directory] [directory]
style = "bold blue" style = "bold blue"
truncation_length = 0 fish_style_pwd_dir_length = 3
truncate_to_repo = false truncate_to_repo = false
[cmd_duration] [cmd_duration]

View file

@ -2,19 +2,20 @@
alias a 'alias -s' alias a 'alias -s'
a D 'cd $D' a D 'cd $D'
a aliases 'v (which aliases)' a aliases 'v (which aliases); command aliases'
a bax 'source (which bax) && bax' a bax 'source (which bax) && bax'
a compress '7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on (realpath $argv).7z' a compress '7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on (realpath $argv).7z'
a cpugov 's cpupower frequency-set -g performance > /dev/null && echo Now in performance mode' a cpugov 's cpupower frequency-set -g performance'
a dirdl 'wget -r -k -p --no-parent --no-clobber -e robots=off' a dirdl 'wget -r -k -p --no-parent --no-clobber -e robots=off'
a dot 'cd ~/.dotfiles' a dot 'cd ~/.dotfiles'
a ff 'fd -E sys -E caches -E cache -E .cache -E graphicPacks -E proc -E dosdevices -E .git -H -d 5 -L -i' a dwarf 'mkdwarfs -i . -o $PWD.dwarfs'
a ff 'fd -HILi -Edosdevices -E.git'
a g git a g git
a giveme 's chown $USER' a giveme 's chown $USER'
a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz' a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
a l ls a l ls
a la 'l -a' a la 'l -a'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window" -drun-icon-theme Papirus' a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
a less 'eval $PAGER' a less 'eval $PAGER'
a off shutdown a off shutdown
a open xdg-open a open xdg-open
@ -23,17 +24,17 @@ a qb 'qutebrowser --target auto'
a re 'systemctl reboot -i' a re 'systemctl reboot -i'
a s sudo a s sudo
a se 's eopkg' a se 's eopkg'
a squash 'mksquashfs . (realpath .).squashfs -comp zstd -b 1M -Xcompression-level 22' a squash 'mksquashfs . $PWD.squashfs -comp zstd -b 1M -Xcompression-level 22'
a supath 's env "PATH=$PATH"' a supath 's env "PATH=$PATH"'
a up 'se up --y' a up 'se up --y'
a v vi a v vi
a vi nvim a vi nvim
a ydl "youtube-dlc --continue --ignore-errors --no-overwrites --write-auto-sub --write-sub --embed-subs --sub-lang=en -o '%(title)s.%(ext)s'" a ydl "youtube-dlc -ciw --write-sub --write-auto-sub --embed-subs --sub-lang=en -o '%(title)s.%(ext)s'"
for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1) for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1)
a $i "qb / \":quickmark-load $i\"" a $i "qb / \":quickmark-load $i\""
end end
for i in mcross soundscrape speedtest-cli thonny for i in mcross thonny
a $i "pipx run $i" a $i "pipx run $i"
end end

View file

@ -1,5 +1,3 @@
#!/bin/sh #!/bin/bash
for i in $(grep works/[0-9]\* $@ -o | uniq | sed 's/works\///g' | sed '/^$/d') list=$(grep works/[0-9]\* $@ -o | uniq | grep -o [0-9]\* | tr '\n' , | sed s/.$//)
do eval aria2c -Z https://download.archiveofourown.org/downloads/{$list}/\*.epub -d ao3
aria2c https://download.archiveofourown.org/downloads/$i/\*.epub -d ao3
done

View file

@ -1 +0,0 @@
ao3

View file

@ -3,12 +3,9 @@ if [[ "$#" -ge 1 ]]; then
rm ~/Pictures/.wallp rm ~/Pictures/.wallp
ln -s ~/Pictures/Awall/$@* ~/Pictures/.wallp ln -s ~/Pictures/Awall/$@* ~/Pictures/.wallp
fi fi
kill $(pgrep -f "mpv.*wallpaper") pkill -f "mpv.*wallpaper"
mpv --profile=wallpaper ~/Pictures/.wallp & disown xwinwrap -ni -fdt -fs -- mpv -wid WID ~/Pictures/.wallp --profile=wallpaper & disown
if [[ "$#" -ge 1 ]]; then if [[ "$#" -ge 1 ]]; then
ffmpeg -i ~/Pictures/Awall/$@* -vframes 1 -y ~/Pictures/Awall/wall.png ffmpeg -i ~/Pictures/.wallp -vframes 1 -y ~/Pictures/Awall/wall.png
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/Pictures/Awall/wall.png" gsettings set org.gnome.desktop.background picture-uri "file://$HOME/Pictures/Awall/wall.png"
else
sleep 5
fi fi
budgie-panel --replace & disown

View file

@ -1,14 +0,0 @@
#!/bin/sh
sudo printf ''
git pull
./autogen.sh --prefix=/usr
./configure --prefix=/usr
cmake -DCMAKE_INSTALL_PREFIX=/usr .
sudo printf ''
make -j8
sudo make install
meson --prefix=/usr build
sudo printf ''
ninja -C build
sudo ninja -C build install
sudo solbuild build package.yml -d

View file

@ -1,16 +1,14 @@
#!/bin/sh #!/bin/sh
sudo eopkg up --y sudo eopkg up -y
fc-cache -f -v
sudo sync
fish -c "j --purge"
sudo eopkg clean -y
sudo eopkg dc -y sudo eopkg dc -y
sudo eopkg rmo -y sudo eopkg rmo -y
sudo eopkg rdb -y sudo eopkg rdb -y
sudo journalctl --vacuum-size=1K sudo eopkg clean -y
bleachbit -c `bleachbit -l|grep -Ev 'system.free_disk_space|transmission|system.memory|firefox'` fc-cache -f
sudo bleachbit -c `bleachbit -l|grep -Ev 'system.free_disk_space|transmission|system.memory|firefox'` rm -r ~/.cache
rm -r ~/.cache/* fish -c "j --purge"
sudo solbuild delete-cache
docker system prune -f docker system prune -f
sudo sync sudo solbuild delete-cache
sudo journalctl --vacuum-size=1K
bleachbit -c `bleachbit -l|rg -v 'system.free_disk_space|transmission|system.memory|cookies'`
sudo bleachbit -c `bleachbit -l|rg -v 'system.free_disk_space|system.memory'`

View file

@ -1,2 +0,0 @@
#!/bin/sh
optiflac -af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16 $@

View file

@ -1 +0,0 @@
invidious

2
.local/bin/invid Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
tmux new -s 0 -d 'cd ~/.invid; git pull; docker-compose up --build'

View file

@ -1,2 +0,0 @@
#!/bin/sh
tmux new -s 0 -d 'cd ~/.invid; git pull; docker-compose up --build'

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
fd -e pdf -x cpdfsqueeze {} {} fd -e pdf -x cpdfsqueeze {} {}
fd -e png -x oxipng {} fd -e png -x oxipng
fd -e epub -e zip -x advzip -z4 {} fd -e epub -e zip -x advzip -z4
fd -e jpg -e jpeg -x jpegoptim {} fd -e jpg -e jpeg -x jpegoptim

View file

@ -1,23 +1,22 @@
#!/bin/sh #!/bin/sh
compare() { compare() {
for i in * cd out
do for i in *; do
if [ `du "$i" | cut -f1` -lt `du ../"$i" | cut -f1` ] if [ `du "$i" | cut -f1` -lt `du ../"$i" | cut -f1` ]; then
then
echo $i echo $i
mv "$i" ../"$i" mv "$i" ../"$i"
fi fi
done done
cd ..
} }
mkdir out mkdir out
ls *.flac | parallel ffmpeg -hide_banner -i {} -c:v copy -c:a flac -compression_level 12 $@ out/{}
cd out args="-af aresample=resampler=soxr:precision=32:dither_method=triangular -sample_fmt s16"
fd -e flac -d1 -x ffmpeg -hide_banner -i {} -c:v copy -c:a flac -compression_level 12 $args $@ out/{}
compare compare
cd ..
cp *.flac out fd -e flac -d1 -x flac -f8 {} -o out/{}
cd out
ls | parallel flac -f -8 -V {}
compare compare
cd ..
rm -r out rm -r out

View file

@ -1,24 +1,6 @@
#!/usr/bin/fish #!/usr/bin/fish
for i in Documents Music Pictures Videos for i in Documents Music Pictures Videos
rm ~/$i
rmdir ~/$i rmdir ~/$i
ln -s $D/$i ~/$i ln -s $D/$i ~/$i
end end
for i in '# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line youre
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_DOCUMENTS_DIR="/mnt/LocalDiskD/Documents"
XDG_MUSIC_DIR="/mnt/LocalDiskD/Music"
XDG_PICTURES_DIR="/mnt/LocalDiskD/Pictures"
XDG_VIDEOS_DIR="/mnt/LocalDiskD/Videos"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"'
echo $i > ~/.config/user-dirs.dir
end

25
.setup
View file

@ -1,25 +1,26 @@
#!/bin/bash #!/bin/bash
sudo eopkg up
sudo eopkg it -c system.devel
gnome=$(eval echo eog evolution-data-server file-roller gnome-{calendar,photos,mpv,terminal} nautilus onboard rhythmbox) gnome=$(eval echo eog evolution-data-server file-roller gnome-{calendar,photos,mpv,terminal} nautilus onboard rhythmbox)
sudo eopkg rm celluloid firefox $gnome hexchat libreoffice-common thunderbird transmission sudo eopkg rm celluloid firefox $gnome hexchat libreoffice-common thunderbird transmission
audio="audacious audacious-plugins audacity opus-tools quodlibet spek" sudo eopkg up
dev="ccache docker-compose git-extras neovim openssh-server parallel solbuild tig tor upx" sudo eopkg it -c system.devel
gui="bleachbit caja engrampa goverlay keepassx kitty qutebrowser vorta"
media="feh gmic-gimp jpegoptim mpv playerctl usbmuxd rsync viewnior zathura-poppler"
rice="adapta-gtk-theme ant-dracula-gtk-theme devilspie2 font-ubuntu-ttf rofi starship stow"
term="advancecomp aria2 autojump fd fish fzf innoextract most ncdu p7zip ranger ripgrep rsync tmux"
sudo eopkg it $audio $dev $gui $media $rice $term audio="audacious audacious-plugins audacity opus-tools quodlibet spek"
dev="ccache docker-compose git-extras neovim parallel solbuild tig tor upx"
gui="bleachbit caja engrampa goverlay keepassx kitty vorta"
media="feh gaupol gmic-gimp jpegoptim mpv playerctl usbmuxd rsync viewnior zathura-poppler"
rice="adapta-gtk-theme ant-dracula-gtk-theme devilspie2 font-ubuntu-ttf rofi starship stow"
term="advancecomp autojump fd fish fzf innoextract most ncdu p7zip ranger ripgrep rsync tmux"
web="arcanist aria2 deluge qutebrowser openssh-server speedtest-cli subliminal"
sudo eopkg it $audio $dev $gui $media $rice $term $web
sudo eopkg rm --ignore-dependency tracker sudo eopkg rm --ignore-dependency tracker
pip3 install --user adblock pipipxx readability-lxml sh pip3 install --user adblock pipipxx readability-lxml sh
parallel pipx install ::: deemix soundscrape tldr
rm ~/.bashrc rm ~/.bashrc
cd ~/.dotfiles cd ~/.dotfiles
for i in `fd -E .git -t d -H`; do fd -E .git -t d -H -x mkdir -p ~/{}
mkdir -p ~/$i
done
stow . stow .
mkdir -p ~/.config/mpv/shaders && cd ~/.config/mpv/shaders && rm * mkdir -p ~/.config/mpv/shaders && cd ~/.config/mpv/shaders && rm *