🔧 Various reconfiguration/scripting
This commit is contained in:
parent
8860d36d1b
commit
921f082ffa
4 changed files with 47 additions and 3 deletions
|
|
@ -180,3 +180,10 @@ vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
|
||||||
-- vim.api.nvim_set_keymap("n", "p", "o<Esc>p", { noremap = true, silent = true })
|
-- vim.api.nvim_set_keymap("n", "p", "o<Esc>p", { noremap = true, silent = true })
|
||||||
-- above
|
-- above
|
||||||
-- vim.api.nvim_set_keymap("n", "P", "O<Esc>P", { noremap = true, silent = true })
|
-- vim.api.nvim_set_keymap("n", "P", "O<Esc>P", { noremap = true, silent = true })
|
||||||
|
--
|
||||||
|
|
||||||
|
-- sets 'gx' to open with default browser
|
||||||
|
vim.keymap.set("n", "gx", function()
|
||||||
|
local url = vim.fn.expand("<cfile>")
|
||||||
|
vim.system({ "librewolf", url }, { detach = true })
|
||||||
|
end, { silent = true })
|
||||||
|
|
|
||||||
6
aliases
6
aliases
|
|
@ -29,8 +29,8 @@ alias config="cd ~/.config && ls"
|
||||||
alias cache="cd ~/.cache && ls"
|
alias cache="cd ~/.cache && ls"
|
||||||
alias svs="cd /etc/runit/sv && ls"
|
alias svs="cd /etc/runit/sv && ls"
|
||||||
alias offline="cd ~/Documents/offline_notes && ls"
|
alias offline="cd ~/Documents/offline_notes && ls"
|
||||||
alias vpnup="doas sv up wireguard"
|
# alias vpnup="doas sv up wireguard"
|
||||||
alias vpndown="doas sv down wireguard"
|
# alias vpndown="doas sv down wireguard"
|
||||||
alias pihole="docker exec -it pihole-unbound pihole"
|
alias pihole="docker exec -it pihole-unbound pihole"
|
||||||
alias Code="cd ~/Documents/Code && ls"
|
alias Code="cd ~/Documents/Code && ls"
|
||||||
alias graphics="cd ~/Documents/Graphic_Design && ls"
|
alias graphics="cd ~/Documents/Graphic_Design && ls"
|
||||||
|
|
@ -195,7 +195,7 @@ alias {mu,mt,mute}="pamixer -t"
|
||||||
# laptop only currently, records video/audio, simply name filename .mp4 after command:
|
# laptop only currently, records video/audio, simply name filename .mp4 after command:
|
||||||
alias r_vid="ffmpeg -f v4l2 -framerate 24 -video_size 640x480 -i /dev/video0 -itsoffset 00:00:01.0 -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac"
|
alias r_vid="ffmpeg -f v4l2 -framerate 24 -video_size 640x480 -i /dev/video0 -itsoffset 00:00:01.0 -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac"
|
||||||
# for smaller downloads
|
# for smaller downloads
|
||||||
alias ytdl='yt-dlp --sponsorblock-remove all --write-auto-sub -f "bestvideo\*+bestaudio[ext=m4a]/best" -f mp4'
|
alias ytdl='yt-dlp --sponsorblock-remove all --write-auto-sub -t mp4'
|
||||||
alias ytdl-w='yt-dlp "best*" --sponsorblock-remove all --write-auto-sub'
|
alias ytdl-w='yt-dlp "best*" --sponsorblock-remove all --write-auto-sub'
|
||||||
# for better resolutions
|
# for better resolutions
|
||||||
# alias ytdl-w='yt-dlp -f webm "bestvideo\*+bestaudio" --sponsorblock-remove all --write-auto-sub'
|
# alias ytdl-w='yt-dlp -f webm "bestvideo\*+bestaudio" --sponsorblock-remove all --write-auto-sub'
|
||||||
|
|
|
||||||
22
scripts/vpndown
Executable file
22
scripts/vpndown
Executable file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
|
echo "This script must be run as root!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
set +o noclobber
|
||||||
|
sv stop wireguard
|
||||||
|
cat <<EOF >/etc/resolv.conf
|
||||||
|
nameserver ::1
|
||||||
|
nameserver 127.0.0.1
|
||||||
|
options trust-ad
|
||||||
|
EOF
|
||||||
|
chattr +i /etc/resolv.conf
|
||||||
|
docker container start pihole-unbound
|
||||||
|
sv restart NetworkManager
|
||||||
|
set -o noclobber
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
15
scripts/vpnup
Executable file
15
scripts/vpnup
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
|
echo "This script must be run as root!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
docker container stop pihole-unbound
|
||||||
|
chattr -i /etc/resolv.conf 2>/dev/null
|
||||||
|
sv restart NetworkManager
|
||||||
|
sv start wireguard
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
Loading…
Add table
Add a link
Reference in a new issue