1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-06-04 05:51:07 +00:00

Move stuff to XDG_HOME and use fish aliases

This commit is contained in:
Phantop 2021-01-07 09:23:59 -05:00
parent 08f0dc08be
commit a34df85a19
46 changed files with 65 additions and 250 deletions

View file

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

View file

@ -1,3 +0,0 @@
function D -w cd
cd $D $argv
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.04LlD2/bax.fish @ line 1
function bax
source (which bax)
end

View file

@ -1,3 +1,3 @@
function cd -w cd
builtin cd (realpath $argv 2> /dev/null)
builtin cd (realpath $argv 2> /dev/null)
end

View file

@ -1,3 +0,0 @@
function compress -w 7z
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on (pwd)/(basename $argv | rev | cut -f 2- -d '.' | rev).7z $argv
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.YTcC09/cpugov.fish @ line 2
function cpugov
sudo cpupower frequency-set -g performance > /dev/null && echo Now in performance mode
end

View file

@ -1,3 +0,0 @@
function dirdl -w wget
wget -r -k -p --no-parent --no-clobber -e robots=off $argv
end

View file

@ -1,3 +0,0 @@
function dot -w cd
cd ~/.dotfiles $argv
end

View file

@ -1,3 +0,0 @@
function fe -w funced
funced $argv
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.jRV9Y0/ff.fish @ line 1
function ff --wraps=fd
fd -E sys -E caches -E cache -E .cache -E graphicPacks -E proc -E dosdevices -E .git -H -d 5 -L -i $argv
end

View file

@ -1,7 +1,6 @@
# Defined in /tmp/fish.tZFnQI/fish_user_key_bindings.fish @ line 2
function fish_user_key_bindings
bind \eo 'f'
bind \ed 'ncdu'
bind \et 'tmux'
bind \ef 'fzf | xclip -selection clipboard'
bind \eo 'ranger'
bind \ed 'ncdu'
bind \et 'tmux'
bind \ef 'fzf | xclip -selection clipboard'
end

View file

@ -1,3 +0,0 @@
function fs -w funcsave
funcsave $argv
end

View file

@ -1,3 +0,0 @@
function g -w git
git $argv
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.zBYqg4/giveme.fish @ line 2
function giveme -w chown
s chown $USER $argv
end

View file

@ -1,3 +0,0 @@
function hardinfo -w inxi
inxi -SPARM -GCDN -v1 -xGCRS -Fxz $argv
end

View file

@ -1,3 +0,0 @@
function l -w ls
ls $argv
end

View file

@ -1,3 +0,0 @@
function la -w ls
ls -a $argv
end

View file

@ -1,3 +0,0 @@
function launcher -w rofi
rofi -combi-modi "drun,run" -show combi -modi "combi,window" -drun-icon-theme Papirus $argv
end

View file

@ -1,3 +0,0 @@
function less -w eval
eval $PAGER $argv
end

View file

@ -1,3 +0,0 @@
function mpva -w mpv
mpv --no-video $argv
end

View file

@ -1,3 +0,0 @@
function off -w shutdown
sync; shutdown $argv; exit
end

View file

@ -1,3 +0,0 @@
function pagedl -w wget
wget -H -k -p --no-clobber -e robots=off $argv
end

View file

@ -1,5 +0,0 @@
# Defined in /tmp/fish.ijOPnW/qb.fish @ line 2
function qb --wraps=qutebrowser
qutebrowser $argv --target auto & disown
rm -r VideoDecodeStats
end

View file

@ -1,3 +0,0 @@
function re
sync; systemctl reboot -i
end

View file

@ -1,3 +0,0 @@
function s -w sudo
sudo $argv
end

View file

@ -1,3 +0,0 @@
function se -w eopkg
s eopkg $argv
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.N4oxkp/squash.fish @ line 2
function squash --wraps=mksquashfs
mksquashfs . ../(basename $PWD).squashfs -comp zstd -b 1M -Xcompression-level 22 $argv
end

View file

@ -1,3 +0,0 @@
function supath -w env
sudo env "PATH=$PATH" $argv
end

View file

@ -1,3 +0,0 @@
function up
se up --y
end

View file

@ -1,3 +0,0 @@
function v -w nvim
nvim $argv
end

View file

@ -1,3 +0,0 @@
function vi -w nvim
nvim $argv
end

View file

@ -1,3 +0,0 @@
function wallb -w wallo
wallo $argv -blur 0x8
end

View file

@ -1,3 +0,0 @@
function wallo -w convert
convert $argv -resize (xrandr | grep '*'| grep -o [0-9]\*x[0-9]\*) ~/.config/wall0
end

View file

@ -1,4 +1,3 @@
# Defined in /tmp/fish.UKii9e/wallp.fish @ line 2
function wallp --wraps=readlink
gsettings set org.gnome.desktop.background picture-uri file://(readlink -f $argv)
function wallp --wraps=realpath
gsettings set org.gnome.desktop.background picture-uri file://(realpath $argv)
end

View file

@ -1,4 +0,0 @@
# Defined in /tmp/fish.L1Go55/ydl.fish @ line 2
function ydl --wraps=youtube-dl --wraps=youtube-dlc
youtube-dlc --continue --ignore-errors --no-overwrites --write-auto-sub --write-sub --embed-subs --sub-lang=en -o '%(title)s.%(ext)s' $argv
end

View file

@ -2,7 +2,7 @@
email = phantop@tuta.io
name = Phantop
[credential]
helper = store
helper = libsecret
[core]
quotepath = false
commitGraph = true
@ -17,7 +17,7 @@
required = true
[url "https://aur.archlinux.org/"]
insteadOf = "aur:"
[url "http://dev.getsol.us/source/"]
[url "https://dev.getsol.us/source/"]
insteadOf = "solus:"
insteadOf = "sol:"
[url "https://github.com/"]
@ -29,7 +29,7 @@
insteadOf = "lab:"
insteadOf = "gl:"
[url "https://git.sr.ht"]
insteadof = "https://sr.ht"
insteadOf = "https://sr.ht"
[color]
ui = auto
[alias]

View file

@ -1,7 +1,4 @@
font_family Ubuntu Mono
bold_font Ubuntu Mono Bold
italic_font Ubuntu Mono
bold_italic_font Ubuntu Mono Bold
font_size 11.75
foreground #f8f8f2
@ -38,7 +35,7 @@ color19 #4d4f68
color20 #62d6e8
color21 #f1f2f8
background_image ~/.config/wall0
background_image ~/.config/kitty/wall.png
remember_window_size no
close_on_child_death yes

BIN
.config/kitty/wall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

0
.config/mpv/mpv.conf Executable file → Normal file
View file

39
.local/bin/aliases Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/fish
alias a 'alias -s'
a D 'cd $D'
a aliases 'v (which aliases)'
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 cpugov 's cpupower frequency-set -g performance > /dev/null && echo Now in performance mode'
a dirdl 'wget -r -k -p --no-parent --no-clobber -e robots=off'
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 g git
a giveme 's chown $USER'
a hardinfo 'inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
a l ls
a la 'l -a'
a launcher 'rofi -combi-modi "drun,run" -show combi -modi "combi,window" -drun-icon-theme Papirus'
a less 'eval $PAGER'
a off shutdown
a open xdg-open
a pagedl 'wget -H -k -p --no-clobber -e robots=off'
a qb 'qutebrowser --target auto'
a re 'systemctl reboot -i'
a s sudo
a se 's eopkg'
a squash 'mksquashfs . (realpath .).squashfs -comp zstd -b 1M -Xcompression-level 22'
a supath 's env "PATH=$PATH"'
a up 'se up --y'
a v vi
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'"
for i in (cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1)
a $i "qb / \":quickmark-load $i\""
end
for i in mcross soundscrape speedtest-cli thonny
a $i "pipx run $i"
end

View file

@ -12,5 +12,5 @@ bleachbit -c `bleachbit -l|grep -Ev 'system.free_disk_space|transmission|system.
sudo bleachbit -c `bleachbit -l|grep -Ev 'system.free_disk_space|transmission|system.memory|firefox'`
rm -r ~/.cache/*
sudo solbuild delete-cache
docker system prune
docker system prune -f
sudo sync

View file

@ -1,115 +1,12 @@
#!/usr/bin/python3
#!/usr/bin/fish
set HIFI ~/Music/HiFi
set LOFI ~/Music/LoFi
# Original source at: https://github.com/dserv01/SyncLosslessToLossyMusicLibrary
if not test -d $LOFI
cd $HIFI
fd -t d -x mkdir -p $LOFI/{}
fd -e flac -x opusenc --bitrate 72 {} $LOFI/{.}.opus
end
import os
import subprocess
##### CONFIGURATION #######################################
# This is the path of your lossless libray, e.g. '/home/YOURNAME/Music/'
FROM_PATH = '/home/glados/Music/HiFi/'
# This is the path of your lossy library, e.g. /mnt/SDCARD0/Music/'
TO_PATH = '/home/glados/Music/LoFi/'
# [INPUT] and [OUTPUT] will be replaced by the full path without the extension
COMMANDS = [['flac', 'opus', 'opusenc --bitrate 72 [INPUT].flac [OUTPUT].opus'],
['mp3', 'opus', 'ffmpeg -i [INPUT].mp3 -c:v copy -f flac - | opusenc --bitrate 72 - [OUTPUT].opus'],
['m4a', 'opus', 'ffmpeg -i [INPUT].m4a -c:v copy -f flac - | opusenc --bitrate 72 - [OUTPUT].opus'],
['opus', 'opus', 'ffmpeg -i [INPUT].opus -c:v copy -f flac - | opusenc --bitrate 72 - [OUTPUT].opus'],
['jpg', 'jpg', 'cp [INPUT].jpg [OUTPUT].jpg'],
['png', 'jpg', 'convert [INPUT].png [OUTPUT].jpg']
]
SYNC_DELETIONS = True
ASK_BEFORE_DELETE = False
##########################################################
# Check path format
if (FROM_PATH[-1] != '/' or TO_PATH[-1] != '/'):
exit(1)
# Create library paths if not existence
try:
if (not os.path.exists(TO_PATH)):
os.makedirs(TO_PATH)
elif (os.path.isfile(TO_PATH)):
raise Exception("Directory is file?!")
except Exception as e:
exit(1)
# Create folders if not existing
def createFolder(subpath):
if (os.path.exists(TO_PATH + subpath) and os.path.isdir(TO_PATH + subpath)):
return True
try:
os.makedirs(TO_PATH + subpath)
return True
except Exception as e:
return False
# Escape the paths for the os.system
def escapePath(s):
return s.replace(" ", "\ ").replace(")", "\)").replace("(", "\(").replace("&", "\&").replace("'", "\\\'")
# Go through all files and convert
for root, dirs, files in os.walk(FROM_PATH, topdown=False):
subpath = root[len(FROM_PATH):] + "/"
if (createFolder(subpath)):
for name in files:
filename_without_extension = os.path.splitext(name)[0]
file_extension = os.path.splitext(name)[1][1:]
source_path_without_extension = FROM_PATH + subpath + filename_without_extension
converted_path_without_extension = TO_PATH + subpath + filename_without_extension
# Get command tripple - sure you can do this more efficient with a hashmap but there will only be a few entries
command_tripple = None
for tripple in COMMANDS:
if (tripple[0] == file_extension):
command_tripple = tripple
break
if (not command_tripple):
continue
source_path = source_path_without_extension + "." + command_tripple[0]
goal_path = converted_path_without_extension + "." + command_tripple[1]
if (os.path.isfile(source_path)):
# If goal file does not exists or is older than source
if (not os.path.exists(goal_path) or os.path.getctime(source_path) > os.path.getctime(goal_path)):
os.system(command_tripple[2].replace("[INPUT]", escapePath(source_path_without_extension)).replace(
"[OUTPUT]", escapePath(converted_path_without_extension)))
# Remove old files
if (SYNC_DELETIONS):
for root, dirs, files in os.walk(TO_PATH, topdown=False):
subpath = root[len(TO_PATH):] + "/"
for name in files:
filename_without_extension = os.path.splitext(name)[0]
file_extension = os.path.splitext(name)[1][1:]
source_path_without_extension = FROM_PATH + subpath + filename_without_extension
converted_path_without_extension = TO_PATH + subpath + filename_without_extension
original_exists = False
for tripple in COMMANDS:
if (tripple[1] == file_extension and os.path.exists(source_path_without_extension + "." + tripple[0])):
original_exists = True
break
if (not original_exists):
filepath_to_delete = escapePath(converted_path_without_extension) + "." + file_extension
os.system("rm " + ("-i " if ASK_BEFORE_DELETE else "") + filepath_to_delete)
# Remove old empty folders
for folder in dirs:
subpath = root[len(TO_PATH):] + "/"
if not os.path.exists(FROM_PATH + subpath + folder):
os.system("rmdir " + escapePath(TO_PATH + subpath + folder))
set args -s $HIFI -d $LOFI -o opus -q 72 --clean
acxi $args $argv || wget https://github.com/smxi/acxi/raw/stable/acxi -O- -o/dev/null | perl -- - $args $argv

View file

@ -1,15 +0,0 @@
#!/bin/sh
cd $D/Games/Minecraft
rm `fd -e log`
bin/MultiMC -d . $@
rm functions/*
for i in `ls -d instances/*/ | grep -v _MMC_TEMP | xargs -n1 basename`
do
echo > functions/$i.fish "function $i
minecraft -l $i; end"
done
for i in `cat ~/.config/qutebrowser/quickmarks | cut -d ' ' -f1`
do
echo > functions/$i.fish function $i"
qb / \":quickmark-load $i\"; end"
done

5
.setup
View file

@ -9,7 +9,7 @@ dev="ccache docker-compose git-extras neovim openssh-server parallel solbuild ti
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 ripgrep rsync tmux"
term="advancecomp aria2 autojump fd fish fzf innoextract most ncdu p7zip ranger ripgrep rsync tmux"
sudo eopkg it $audio $dev $gui $media $rice $term
sudo eopkg rm --ignore-dependency tracker
@ -25,6 +25,7 @@ stow .
mkdir -p ~/.config/mpv/shaders && cd ~/.config/mpv/shaders && rm *
curl https://api.github.com/repos/bloc97/Anime4K/releases/latest | grep -wo http.\*zip | aria2c -i-; unzip *; rm *zip
rm ~/.config/nvim/autoload/plug.vim
aria2c https://github.com/junegunn/vim-plug/raw/master/plug.vim -d ~/.config/nvim/autoload
nvim +PlugUpdate +q +q
@ -40,4 +41,4 @@ git g gh:Phantop/haiku-icons ~/.local/share/icons/haiku
cd ~/.solus && git update-index --assume-unchanged packager
~/.solus/build
fish -c "invidious;clean"
fish -c "aliases;invid;clean"