Browse Source
Wrote script to clean up LaTeX build files
Wrote script to clean up LaTeX build files
Used Shellcheck to change all my scripts to bash and lint them. Exported my scripts to $PATH. Fixed my liked Arch packages.red-hat-laptop
Kevin Mok
6 years ago
15 changed files with 149 additions and 168 deletions
-
7aliases/zsh_aliases
-
4configs/i3/config
-
29dotfiles/vimrc
-
2dotfiles/zshrc
-
3scripts/backup.sh
-
8scripts/change-sink
-
7scripts/install-arch-pkgs.sh
-
0scripts/sync-shortcuts
-
40scripts/texclear
-
26setup-root.sh
-
38setup.sh
-
2txt/pacman-pkgs/aur-pkgs.txt
-
24txt/pacman-pkgs/nzxt-pkgs.txt
-
104txt/pacman-pkgs/pacman-pkgs.txt
-
23txt/tex-build-files.txt
@ -1,18 +1,18 @@ |
|||
#!/bin/bash |
|||
|
|||
#Device name variable |
|||
if [ $1 = "dac" ]; then |
|||
if [ "$1" = "dac" ]; then |
|||
devicename="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo" |
|||
elif [ $1 = "line-out" ]; then |
|||
elif [ "$1" = "line-out" ]; then |
|||
devicename="alsa_output.pci-0000_00_14.2.analog-stereo" |
|||
fi |
|||
echo "$devicename" |
|||
|
|||
#change the default sink |
|||
pacmd "set-default-sink "$devicename"" |
|||
pacmd "set-default-sink $devicename" |
|||
|
|||
#move all inputs to the new sink |
|||
for app in $(pacmd list-sink-inputs | sed -n -e 's/index:[[:space:]]\([[:digit:]]\)/\1/p'); |
|||
do |
|||
pacmd "move-sink-input $app "$devicename"" |
|||
pacmd "move-sink-input $app $devicename" |
|||
done |
@ -1,4 +1,7 @@ |
|||
#!/bin/bash |
|||
|
|||
sudo pacman -Sy --needed - < ../txt/pacman-pkgs/pacman-pkgs.txt |
|||
sudo trizen -Sy --needed - < ../txt/pacman-pkgs/aur-pkgs.txt |
|||
# to-do: fix shellscript error? |
|||
pacman -Sy --needed - < ../txt/pacman-pkgs/pacman-pkgs.txt |
|||
trizen -Sy --needed - < ../txt/pacman-pkgs/aur-pkgs.txt |
|||
# sudo pacman -Sy --needed - < ../txt/pacman-pkgs/pacman-pkgs.txt |
|||
# sudo trizen -Sy --needed - < ../txt/pacman-pkgs/aur-pkgs.txt |
@ -0,0 +1,40 @@ |
|||
#!/bin/bash |
|||
|
|||
# Delete TeX build files when exiting from Vim or call on directory/directly to |
|||
# remove from there. |
|||
|
|||
ext_list="/home/kevin/linux-config/txt/tex-build-files.txt" |
|||
raw_exts="$(tr '\n' '|' < $ext_list)" |
|||
exts="(${raw_exts::-1})" |
|||
echo "$exts" |
|||
find_flags=(-maxdepth 1 -type f -regextype gnu-awk -regex) |
|||
|
|||
remove_build_files () { |
|||
regex=$2 |
|||
# echo find "$1" "${find_flags[@]}" "$regex" -delete -print |
|||
eval find "$1" "${find_flags[@]}" "$regex" -delete -print |
|||
} |
|||
|
|||
# when less than one argument, remove build files in current dir |
|||
if [[ "$#" -lt 1 ]]; then |
|||
regex=(\"^.*\\."$exts"$\") |
|||
remove_build_files . "${regex[0]}" |
|||
else |
|||
case "$1" in |
|||
# if tex file, remove only build files for that file |
|||
*.tex) |
|||
file=$(readlink -f "$1") |
|||
dir=$(dirname "$file") |
|||
base="${file%.*}" |
|||
regex=(\"^"$base"\\."$exts"$\") |
|||
remove_build_files "$dir" "${regex[0]}" ;; |
|||
# remove all build files in directory if given valid one |
|||
*) |
|||
if [[ -d "$1" ]]; then |
|||
regex=(\"^.*\\."$exts"$\") |
|||
remove_build_files "$1" "${regex[0]}" |
|||
else |
|||
printf "Give .tex file or directory as argument.\\n" |
|||
fi ;; |
|||
esac |
|||
fi |
@ -1,33 +1,15 @@ |
|||
#!/bin/zsh |
|||
|
|||
setup_marble=false |
|||
#!/bin/bash |
|||
|
|||
linux_config_dir=/home/kevin/linux-config |
|||
dot_dir=$linux_config_dir/dotfiles |
|||
pc=$(hostname) |
|||
|
|||
# Get directory variables from script. |
|||
# List of dotfiles I want to link to system. |
|||
dotfiles=(bashrc gitconfig inputrc imwheelrc vimrc Xmodmap Xresources zshrc) |
|||
cd $dot_dir |
|||
for dotfile in $dotfiles; do |
|||
dotfiles=(bashrc inputrc imwheelrc vimrc Xmodmap Xresources zshrc) |
|||
cd $dot_dir || exit |
|||
for dotfile in "${dotfiles[@]}"; do |
|||
# Remove system dotfile. |
|||
rm ~/."$dotfile" |
|||
# Link dotfile in repository to system dotfile. |
|||
cp "$dot_dir"/"$dotfile" ~/."$dotfile" |
|||
done |
|||
|
|||
# marble mouse {{{ # |
|||
|
|||
if [[ "$setup_marble" = true ]]; then |
|||
config_file_name="10-evdev.conf" |
|||
sys_layout_file="/etc/X11/xorg.conf.d/$config_file_name" |
|||
config_dir="$linux_config_dir/x/marble-mouse" |
|||
|
|||
# Remove system file. |
|||
sudo rm -rf "$sys_layout_file" |
|||
# Link config file in repository to system config location. |
|||
sudo cp "$config_dir"/"$config_file_name" "$sys_layout_file" |
|||
fi |
|||
|
|||
# }}} marble mouse # |
@ -1,3 +1,5 @@ |
|||
discord |
|||
texlive-localmanager-git |
|||
gscreenshot |
|||
rxvt-unicode-pixbuf |
|||
Hack NF |
|||
|
@ -0,0 +1,23 @@ |
|||
4tc |
|||
aux |
|||
bak |
|||
bbl |
|||
bcf |
|||
blg |
|||
fdb_latexmk |
|||
fls |
|||
lof |
|||
log |
|||
nav |
|||
out |
|||
pyc |
|||
pyo |
|||
run\\.xml |
|||
snm |
|||
swp |
|||
synctex\\(busy\\) |
|||
synctex\\.gz |
|||
tmp |
|||
toc |
|||
vrb |
|||
xref |
Write
Preview
Loading…
Cancel
Save
Reference in new issue