2023-08-23 05:35:23 -04:00
|
|
|
#
|
|
|
|
# ~/.bashrc
|
|
|
|
#
|
|
|
|
|
2024-12-11 01:09:51 -05:00
|
|
|
# $HOME/Syncthing/Scripts/Bash/quotes-parser/parse_quotes.sh
|
2023-08-23 05:35:23 -04:00
|
|
|
|
|
|
|
## Save history of multiple terminal windows
|
|
|
|
#-https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows
|
|
|
|
# Avoid duplicates
|
|
|
|
# borked, doesn't save in correct order and inserts random entries
|
|
|
|
# HISTCONTROL=ignoredups:erasedups
|
|
|
|
# # When the shell exits, append to the history file instead of overwriting it
|
|
|
|
# shopt -s histappend
|
|
|
|
|
|
|
|
# # After each command, append to the history file and reread it
|
|
|
|
# PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
|
|
|
|
|
|
|
|
|
|
|
|
# Softlink ~ config file to syncthing config fodler
|
|
|
|
# ln -s /home/yuriy/Syncthing/Configurations/Linux.config/.bashrc /home/yuriy/.bashrc
|
|
|
|
|
|
|
|
|
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen
|
|
|
|
|
|
|
|
_set_my_PS1() {
|
|
|
|
PS1='[\u@\h \W]\$ '
|
|
|
|
if [ "$(whoami)" = "liveuser" ] ; then
|
|
|
|
local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2>/dev/null | cut -d '=' -f 2)"
|
|
|
|
if [ -n "$iso_version" ] ; then
|
|
|
|
local prefix="eos-"
|
|
|
|
local iso_info="$prefix$iso_version"
|
|
|
|
PS1="[\u@$iso_info \W]\$ "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
_set_my_PS1
|
|
|
|
unset -f _set_my_PS1
|
|
|
|
|
|
|
|
ShowInstallerIsoInfo() {
|
|
|
|
local file=/usr/lib/endeavouros-release
|
|
|
|
if [ -r $file ] ; then
|
|
|
|
cat $file
|
|
|
|
else
|
|
|
|
echo "Sorry, installer ISO info is not available." >&2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[ "$(whoami)" = "root" ]] && return
|
|
|
|
|
|
|
|
[[ -z "$FUNCNEST" ]] && export FUNCNEST=100 # limits recursive functions, see 'man bash'
|
|
|
|
|
|
|
|
## Use the up and down arrow keys for finding a command in history
|
|
|
|
## (you can write some initial letters of the command first).
|
|
|
|
bind '"\e[A":history-search-backward'
|
|
|
|
bind '"\e[B":history-search-forward'
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
## Some generally useful functions.
|
|
|
|
## Consider uncommenting aliases below to start using these functions.
|
|
|
|
|
|
|
|
|
|
|
|
_GeneralCmdCheck() {
|
|
|
|
# A helper for functions UpdateArchPackages and UpdateAURPackages.
|
|
|
|
|
|
|
|
echo "$@" >&2
|
|
|
|
"$@" || {
|
|
|
|
echo "Error: '$*' failed." >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_CheckInternetConnection() {
|
|
|
|
# curl --silent --connect-timeout 8 https://8.8.8.8 >/dev/null
|
|
|
|
eos-connection-checker
|
|
|
|
local result=$?
|
|
|
|
test $result -eq 0 || echo "No internet connection!" >&2
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
_CheckArchNews() {
|
|
|
|
local conf=/etc/eos-update-notifier.conf
|
|
|
|
|
|
|
|
if [ -z "$CheckArchNewsForYou" ] && [ -r $conf ] ; then
|
|
|
|
source $conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$CheckArchNewsForYou" = "yes" ] ; then
|
|
|
|
local news="$(yay -Pw)"
|
|
|
|
if [ -n "$news" ] ; then
|
|
|
|
echo "Arch news:" >&2
|
|
|
|
echo "$news" >&2
|
|
|
|
echo "" >&2
|
|
|
|
# read -p "Press ENTER to continue (or Ctrl-C to stop): "
|
|
|
|
else
|
|
|
|
echo "No Arch news." >&2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateArchPackages() {
|
|
|
|
# Updates Arch packages.
|
|
|
|
|
|
|
|
_CheckInternetConnection || return 1
|
|
|
|
|
|
|
|
_CheckArchNews
|
|
|
|
|
|
|
|
#local updates="$(yay -Qu --repo)"
|
|
|
|
local updates="$(checkupdates)"
|
|
|
|
if [ -n "$updates" ] ; then
|
|
|
|
echo "Updates from upstream:" >&2
|
|
|
|
echo "$updates" | sed 's|^| |' >&2
|
|
|
|
_GeneralCmdCheck sudo pacman -Syu "$@"
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
echo "No upstream updates." >&2
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateAURPackages() {
|
|
|
|
# Updates AUR packages.
|
|
|
|
|
|
|
|
_CheckInternetConnection || return 1
|
|
|
|
|
|
|
|
local updates
|
|
|
|
if [ -x /usr/bin/yay ] ; then
|
|
|
|
updates="$(yay -Qua)"
|
|
|
|
if [ -n "$updates" ] ; then
|
|
|
|
echo "Updates from AUR:" >&2
|
|
|
|
echo "$updates" | sed 's|^| |' >&2
|
|
|
|
_GeneralCmdCheck yay -Syua "$@"
|
|
|
|
else
|
|
|
|
echo "No AUR updates." >&2
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Warning: /usr/bin/yay does not exist." >&2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
psyu() {
|
|
|
|
# Updates all packages in the system.
|
2023-11-22 00:23:04 -05:00
|
|
|
# Upstream (i.eUpdate. Arch) packages are updated first.
|
2023-08-23 05:35:23 -04:00
|
|
|
# If there are Arch updates, you should run
|
|
|
|
# this function a second time to update
|
|
|
|
# the AUR packages too.
|
|
|
|
|
|
|
|
UpdateArchPackages || UpdateAURPackages
|
|
|
|
}
|
|
|
|
|
|
|
|
_open_files_for_editing() {
|
|
|
|
# Open any given document file(s) for editing (or just viewing).
|
|
|
|
# Note1: Do not use for executable files!
|
|
|
|
# Note2: uses mime bindings, so you may need to use
|
|
|
|
# e.g. a file manager to make some file bindings.
|
|
|
|
|
|
|
|
if [ -x /usr/bin/exo-open ] ; then
|
|
|
|
echo "exo-open $*" >&2
|
|
|
|
/usr/bin/exo-open "$@" >& /dev/null &
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ -x /usr/bin/xdg-open ] ; then
|
|
|
|
for file in "$@" ; do
|
|
|
|
echo "xdg-open $file" >&2
|
|
|
|
/usr/bin/xdg-open "$file" >& /dev/null &
|
|
|
|
done
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Sorry, none of programs [$progs] is found." >&2
|
|
|
|
echo "Tip: install one of packages" >&2
|
|
|
|
for prog in $progs ; do
|
|
|
|
echo " $(pacman -Qqo "$prog")" >&2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_Pacdiff() {
|
|
|
|
local differ pacdiff=/usr/bin/pacdiff
|
|
|
|
|
|
|
|
if [ -n "$(echo q | DIFFPROG=diff $pacdiff)" ] ; then
|
|
|
|
for differ in kdiff3 meld diffuse ; do
|
|
|
|
if [ -x /usr/bin/$differ ] ; then
|
|
|
|
DIFFPROG=$differ su-c_wrapper $pacdiff
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Reboot directly to Windows
|
|
|
|
# https://unix.stackexchange.com/questions/43196/how-can-i-tell-grub-i-want-to-reboot-into-windows-before-i-reboot
|
|
|
|
# Inspired by http://askubuntu.com/questions/18170/how-to-reboot-into-windows-from-ubuntu
|
|
|
|
bootwindows ()
|
|
|
|
{
|
|
|
|
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
|
|
|
|
notify-send -t 1000 "$windows_title"
|
|
|
|
# sudo grub-reboot "$windows_title" && sudo reboot
|
|
|
|
}
|
|
|
|
# alias reboot-to-windows='reboot_to_windows'
|
|
|
|
|
|
|
|
## FZF
|
|
|
|
# https://github.com/junegunn/fzf/wiki/examples#opening-files
|
|
|
|
fe() {
|
|
|
|
IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0))
|
|
|
|
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
|
|
|
|
}
|
|
|
|
## FZF
|
|
|
|
|
|
|
|
# Modified version where you can press
|
|
|
|
# - CTRL-O to open with `open` command,
|
|
|
|
# - CTRL-E or Enter key to open with the $EDITOR
|
|
|
|
fo() {
|
|
|
|
cd /home/$USER/
|
|
|
|
IFS=$'\n' out=("$(fzf -e --query="$1" --exit-0 --expect=alt-e,alt-o,ctrl-o,ctrl-e,ctrl-p)")
|
|
|
|
key=$(head -1 <<< "$out")
|
|
|
|
file=$(head -2 <<< "$out" | tail -1)
|
|
|
|
# echo "key1: $key"
|
|
|
|
|
|
|
|
if [ -n "$file" ]; then
|
|
|
|
file=/home/$USER/${file}
|
|
|
|
case "$key" in
|
|
|
|
*ctrl-p*) echo ${file} | xclip -sel c ;; # copy variable contents to clip
|
|
|
|
*alt-o*) Directory="$(dirname "${file}")" ; dolphin "${Directory}";;
|
|
|
|
*alt-e*)
|
|
|
|
# FullFilepath=/home/me/mydir/file.c
|
|
|
|
Directory="$(dirname "${file}")" # Get directory
|
|
|
|
FileNameWExt="$(basename "${file}")" # File Name wExtension
|
|
|
|
FileNameNoExt=${file%.*} # File name wOut Extension
|
|
|
|
FileExtension="${file##*.}" # File Extension
|
|
|
|
# echo "$Directory"
|
|
|
|
# echo "$FileNameWExt"
|
|
|
|
# echo "$FileNameNoExt"
|
|
|
|
# echo "$FileExtension"
|
|
|
|
# xdg-open $file
|
|
|
|
|
|
|
|
case "$FileExtension" in
|
|
|
|
*txt*) subl ${file} ;;
|
|
|
|
*conf*) subl ${file} ;;
|
|
|
|
*sh*) subl ${file} ;;
|
|
|
|
*py*) subl ${file} ;;
|
|
|
|
*jpg*) gimp ${file} & xdotool key Escape ;;
|
|
|
|
*png*) gimp ${file} & xdotool key Escape ;;
|
|
|
|
*) subl ${file} ;; # sublime everything else
|
|
|
|
esac ;;
|
|
|
|
*) xdg-open $file ;;
|
|
|
|
esac
|
|
|
|
# echo "$file"
|
|
|
|
# echo "key2: $key"
|
|
|
|
# [ "$key" = ctrl-o ] && open "$file" || gimp "$file" &
|
|
|
|
# [ "$key" = ctrl-p ] && echo "$file"
|
|
|
|
fi
|
|
|
|
#sleep .5
|
|
|
|
#xdotool key F3
|
|
|
|
fo
|
|
|
|
}
|
|
|
|
# Expand on this later
|
|
|
|
|
|
|
|
|
|
|
|
foa() {
|
|
|
|
cd /
|
|
|
|
IFS=$'\n' out=("$(fzf -e --query="$1" --exit-0 --expect=alt-e,alt-o,ctrl-o,ctrl-e,ctrl-p)")
|
|
|
|
key=$(head -1 <<< "$out")
|
|
|
|
file=$(head -2 <<< "$out" | tail -1)
|
|
|
|
# echo "key1: $key"
|
|
|
|
|
|
|
|
if [ -n "$file" ]; then
|
|
|
|
file=/home/$USER/${file}
|
|
|
|
case "$key" in
|
|
|
|
*ctrl-p*) echo ${file} | xclip -sel c ;; # copy variable contents to clip
|
|
|
|
*alt-o*) Directory="$(dirname "${file}")" ; dolphin "${Directory}";;
|
|
|
|
*alt-e*)
|
|
|
|
# FullFilepath=/home/me/mydir/file.c
|
|
|
|
Directory="$(dirname "${file}")" # Get directory
|
|
|
|
FileNameWExt="$(basename "${file}")" # File Name wExtension
|
|
|
|
FileNameNoExt=${file%.*} # File name wOut Extension
|
|
|
|
FileExtension="${file##*.}" # File Extension
|
|
|
|
# echo "$Directory"
|
|
|
|
# echo "$FileNameWExt"
|
|
|
|
# echo "$FileNameNoExt"
|
|
|
|
# echo "$FileExtension"
|
|
|
|
# xdg-open $file
|
|
|
|
|
|
|
|
case "$FileExtension" in
|
|
|
|
*txt*) subl ${file} ;;
|
|
|
|
*conf*) subl ${file} ;;
|
|
|
|
*sh*) subl ${file} ;;
|
|
|
|
*py*) subl ${file} ;;
|
|
|
|
*jpg*) gimp ${file} & xdotool key Escape ;;
|
|
|
|
*png*) gimp ${file} & xdotool key Escape ;;
|
|
|
|
*) subl ${file} ;; # sublime everything else
|
|
|
|
esac ;;
|
|
|
|
*) xdg-open $file ;;
|
|
|
|
esac
|
|
|
|
# echo "$file"
|
|
|
|
# echo "key2: $key"
|
|
|
|
# [ "$key" = ctrl-o ] && open "$file" || gimp "$file" &
|
|
|
|
# [ "$key" = ctrl-p ] && echo "$file"
|
|
|
|
fi
|
|
|
|
#sleep .5
|
|
|
|
#xdotool key F3
|
|
|
|
fo
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sdl() {
|
|
|
|
|
|
|
|
local playlist="$1"
|
|
|
|
cd "/home/yuriy/Executables/zspotify/"
|
|
|
|
|
|
|
|
python zspotify ${playlist}
|
|
|
|
|
|
|
|
echo "we done!"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
# cf - fuzzy cd from anywhere
|
|
|
|
# ex: cf word1 word2 ... (even part of a file name)
|
|
|
|
# zsh autoload function
|
|
|
|
cf() {
|
|
|
|
local file
|
|
|
|
|
|
|
|
file="$(locate -Ai -0 $@ | grep -z -vE '~$' | fzf --read0 -0 -1)"
|
|
|
|
|
|
|
|
if [[ -n $file ]]
|
|
|
|
then
|
|
|
|
if [[ -d $file ]]
|
|
|
|
then
|
|
|
|
cd -- $file
|
|
|
|
else
|
|
|
|
cd -- ${file:h}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# cdf - cd into the directory of the selected file
|
|
|
|
cdf() {
|
|
|
|
local file
|
|
|
|
local dir
|
|
|
|
file=$(fzf +m -q "$1") && dir=$(dirname "$file") && cd "$dir"
|
|
|
|
}
|
|
|
|
|
|
|
|
# fh - repeat history
|
|
|
|
# fh - repeat history
|
|
|
|
fh() {
|
|
|
|
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rl() {
|
|
|
|
# reload bashrc in current instance
|
|
|
|
. ~/.bashrc
|
|
|
|
echo "Successfully Reloaded .bashrc"
|
|
|
|
}
|
|
|
|
|
2024-08-13 23:56:26 -04:00
|
|
|
dlrl() {
|
|
|
|
echo "Downloading latest .bashrc from gitea"
|
|
|
|
cd ~/ && wget -q -O .bashrc https://git.zinchuk.xyz/yuriy/Linux-bashrc-Profile/raw/branch/main/.bashrc && chmod 744 .bashrc
|
|
|
|
|
|
|
|
. ~/.bashrc
|
|
|
|
echo "Loaded latest .bashrc"
|
|
|
|
}
|
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
parul(){
|
|
|
|
pacman -Qqe > pkglist.txt
|
|
|
|
subl pkglist.txt
|
|
|
|
}
|
|
|
|
|
2024-08-13 23:56:26 -04:00
|
|
|
|
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
update() {
|
2024-12-11 01:09:51 -05:00
|
|
|
paru -Sy archlinux-keyring endeavouros-keyring --noconfirm --needed # update keyrings
|
2023-11-22 00:23:04 -05:00
|
|
|
paru -Syu --noconfirm # update packages, no confirmation
|
2023-08-23 05:35:23 -04:00
|
|
|
|
2023-11-22 00:23:04 -05:00
|
|
|
# Skip clearing update cache if this is Flexo Server
|
2024-12-11 01:09:51 -05:00
|
|
|
if [[ $(hostname) == "FLEXO" ]]; then
|
2023-11-22 00:23:04 -05:00
|
|
|
echo "Skipping Clearing Update Cache"
|
|
|
|
else
|
|
|
|
echo "Clearing out Pacman Cache"
|
|
|
|
echo clearing out $(sudo ls /var/cache/pacman/pkg/ | wc -l) packages in cache
|
2024-07-30 00:23:21 -04:00
|
|
|
( echo "y"; echo "y" ) | paru -Sccd
|
2024-08-13 23:56:26 -04:00
|
|
|
# (d) removes all orphaned packages that are no longer needed on your system
|
2023-11-22 00:23:04 -05:00
|
|
|
fi
|
2023-08-23 05:35:23 -04:00
|
|
|
|
2024-08-14 02:43:39 -04:00
|
|
|
|
|
|
|
if command -v flatpak &> /dev/null; then
|
|
|
|
echo "Updating Flatpak packages:"
|
2024-10-13 13:36:30 -04:00
|
|
|
flatpak update -y
|
2024-08-14 02:43:39 -04:00
|
|
|
fi
|
2024-07-06 16:42:47 -04:00
|
|
|
|
2024-10-13 13:36:30 -04:00
|
|
|
if [ -d "$HOME/Syncthing/Configurations/Pacman+Paru/" ]; then
|
|
|
|
echo "Exporting pkglist to /Configurations"
|
|
|
|
pacman -Qqe > $HOME/Syncthing/Configurations/Pacman+Paru/$(hostname)_pacmanpkglist.txt
|
|
|
|
else
|
|
|
|
echo "Skipping pkglist export. Config folder doesn't exist on this device."
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2024-07-06 16:42:47 -04:00
|
|
|
# 1 liner
|
|
|
|
# paru -Sy archlinux-keyring chaotic-keyring endeavouros-keyring --noconfirm --needed && paru -Syu --noconfirm && { [[ $(hostname) == "EOS-SERVER" ]] && echo "Skipping Clearing Update Cache" || (echo "Clearing out Pacman Cache" && echo clearing out $(sudo ls /var/cache/pacman/pkg/ | wc -l) packages in cache && ( echo "y"; echo "y" ) | paru -Scc); } && echo "updating arch mirrorlists" && eos-rankmirrors
|
2023-08-23 05:35:23 -04:00
|
|
|
}
|
|
|
|
|
2024-07-06 16:42:47 -04:00
|
|
|
updatewr() {
|
|
|
|
# Run the Update function
|
2024-08-14 01:22:53 -04:00
|
|
|
update
|
2024-07-06 16:42:47 -04:00
|
|
|
|
|
|
|
# Restart
|
|
|
|
sudo reboot
|
|
|
|
}
|
|
|
|
|
2024-12-11 01:09:51 -05:00
|
|
|
updatews() {
|
|
|
|
# Run the Update function
|
|
|
|
update
|
|
|
|
|
|
|
|
# Restart
|
|
|
|
sudo poweroff
|
|
|
|
}
|
|
|
|
|
2024-08-13 23:56:26 -04:00
|
|
|
rank() {
|
|
|
|
echo "re-ranking arch mirrorlists"
|
|
|
|
eos-rankmirrors
|
2024-08-01 17:59:16 -04:00
|
|
|
}
|
|
|
|
|
2024-01-20 16:09:11 -05:00
|
|
|
rkeymapper(){
|
|
|
|
sudo pkill keymapper
|
|
|
|
sudo systemctl restart keymapperd & keymapper &
|
|
|
|
echo "keymapper restarted successfully"
|
|
|
|
}
|
|
|
|
|
2024-12-11 01:09:51 -05:00
|
|
|
rntfy(){
|
|
|
|
pgrep -f ntfy-Automate.sh | xargs kill
|
|
|
|
$HOME//.config/scripts/ntfy-react/ntfy-react.sh &
|
|
|
|
}
|
|
|
|
|
2024-01-20 16:09:11 -05:00
|
|
|
cdp(){
|
|
|
|
filepath=${1}
|
|
|
|
|
|
|
|
Directory="$(dirname "${filepath}")" # Get directory
|
|
|
|
FolderName="$(basename "${Directory}")" # Get folder name
|
|
|
|
|
|
|
|
FileNameWExt="$(basename "${filepath}")" # File Name wExtension
|
|
|
|
FileNameNoExt=${FileNameWExt%.*} # File name wOut Extension
|
|
|
|
FileExtension="${FileNameWExt##*.}" # File Extension
|
|
|
|
|
|
|
|
# echo "${FolderName}"
|
|
|
|
# echo ${FolderName}
|
|
|
|
cd ${Directory}
|
|
|
|
# echo ${1}
|
|
|
|
}
|
|
|
|
|
2024-10-13 13:36:30 -04:00
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
#------------------------------------------------------------
|
|
|
|
# to refresh terminal with new config:
|
|
|
|
# . ~/.bashrc
|
|
|
|
|
|
|
|
## Aliases for the functions above.
|
|
|
|
## Uncomment an alias if you want to use it.
|
|
|
|
##
|
|
|
|
|
2023-11-22 00:34:01 -05:00
|
|
|
|
|
|
|
################################################################################
|
2024-01-20 16:09:11 -05:00
|
|
|
export PATH="$HOME/.local/bin:$PATH"
|
2024-10-13 13:36:30 -04:00
|
|
|
export PATH="$PATH:/opt/sublime_merge"
|
2024-12-11 01:09:51 -05:00
|
|
|
export PATH="$PATH:~/.ssh/"
|
2024-10-13 13:36:30 -04:00
|
|
|
|
|
|
|
|
2024-01-20 16:09:11 -05:00
|
|
|
|
|
|
|
# pacman/paru aliases
|
|
|
|
# -------------------
|
2023-11-22 00:34:01 -05:00
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
# alias pacdiff=_Pacdiff
|
2023-12-21 21:13:44 -05:00
|
|
|
alias parus='paru -Sy ; paru -S'
|
2024-07-06 17:05:40 -04:00
|
|
|
alias parusy='paru -Sy ; paru -S --noconfirm'
|
2023-08-23 05:35:23 -04:00
|
|
|
alias paruss='paru -Ss'
|
2024-12-11 01:09:51 -05:00
|
|
|
alias parur='paru -Rs'
|
2023-08-23 05:35:23 -04:00
|
|
|
alias parurr='paru -Rs'
|
|
|
|
alias parurl='sudo pacman -Syy'
|
2024-12-11 01:09:51 -05:00
|
|
|
alias pcs='pacseek'
|
2024-01-20 16:09:11 -05:00
|
|
|
|
2024-08-13 23:56:26 -04:00
|
|
|
|
2024-01-20 16:09:11 -05:00
|
|
|
# misc aliases
|
|
|
|
alias ef='_open_files_for_editing' # 'ef' opens given file(s) for editing
|
2024-08-13 23:56:26 -04:00
|
|
|
alias clip='xclip -sel clip' # output piped content to clipboard
|
2023-08-23 05:35:23 -04:00
|
|
|
alias snano='sudo nano'
|
|
|
|
alias pu='pdfunite'
|
|
|
|
alias tda='todo.sh add'
|
|
|
|
alias yt='yt-dlp'
|
|
|
|
alias chrome='chromium'
|
|
|
|
alias mvideos='/home/yuriy/Syncthing/Python/Tools/MergeVideoFilesTogether.py'
|
|
|
|
#alias everything=fo
|
2024-12-11 01:09:51 -05:00
|
|
|
alias todos='rg "(FIXME|TODO)" .' # search the contents of folders/subfolders for fixme,todo,
|
|
|
|
|
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
|
2024-01-20 16:09:11 -05:00
|
|
|
# boot/switch to CLI/GUI target
|
|
|
|
alias switchtocli="sudo systemctl isolate multi-user.target"
|
|
|
|
alias switchtogui="sudo systemctl isolate graphical.target"
|
|
|
|
alias bootcli="sudo systemctl set-default multi-user.target"
|
|
|
|
alias bootgui="sudo systemctl set-default graphical.target"
|
2023-11-22 00:34:01 -05:00
|
|
|
|
|
|
|
|
2024-08-13 23:25:29 -04:00
|
|
|
# flatpak
|
|
|
|
alias flatpaks="sudo flatpak install"
|
|
|
|
alias flatpakr="sudo flatpak uninstall"
|
|
|
|
|
|
|
|
|
2023-11-22 00:34:01 -05:00
|
|
|
# Git Aliases
|
|
|
|
alias gac="git add .;git commit -m"
|
2023-11-22 00:54:20 -05:00
|
|
|
alias gacc='f() { git add . ; git commit -m "$@" ; git push; }; f'
|
2023-11-22 00:47:54 -05:00
|
|
|
alias gpm="git push origin master"
|
|
|
|
alias pull="git pull"
|
2024-12-11 01:09:51 -05:00
|
|
|
alias gpp="git pull --rebase --autostash"
|
2023-11-22 00:47:54 -05:00
|
|
|
alias gl="git log"
|
|
|
|
alias glo="git log --oneline"
|
|
|
|
alias gch="git checkout ${1}"
|
2023-11-22 00:54:20 -05:00
|
|
|
alias gb="git branch ${1}"
|
|
|
|
alias gs="git status"
|
|
|
|
alias gss="git status"
|
|
|
|
alias gdd="git diff"
|
|
|
|
alias gdf="git diff"
|
|
|
|
alias gsi="git submodule init"
|
|
|
|
alias gsu="git submodule update --recursive --remote"
|
|
|
|
alias gr="touch README.md ;nano README.md" # choco install nano -y
|
2023-11-22 00:47:54 -05:00
|
|
|
|
2024-10-13 13:36:30 -04:00
|
|
|
# Chezmoi Aliases
|
|
|
|
alias cz="chezmoi"
|
|
|
|
alias czs="chezmoi status"
|
|
|
|
alias cza="chezmoi apply"
|
2024-12-11 01:09:51 -05:00
|
|
|
alias czadd="chezmoi add"
|
2024-10-13 13:36:30 -04:00
|
|
|
alias czc="chezmoi cd"
|
2024-12-11 01:09:51 -05:00
|
|
|
alias czcd="chezmoi cd"
|
|
|
|
alias czd="dolphin $HOME/.local/share/chezmoi ; cd /home/yuriy/.local/share/chezmoi"
|
|
|
|
alias czea="chezmoi edit --apply"
|
2024-10-13 13:36:30 -04:00
|
|
|
|
|
|
|
# Misc
|
2024-12-11 01:09:51 -05:00
|
|
|
alias ka="while :; do xdotool mousemove_relative -- $(( $RANDOM % 3 - 1 )) $(( $RANDOM % 3 - 1 )) sleep 60; done" # Keep screen awake
|
|
|
|
alias chmodx="chmod u+x" # make file executable for current user
|
|
|
|
|
|
|
|
alias sm='smerge'
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
if command -v lsd &> /dev/null; then
|
|
|
|
alias ls="lsd -al"
|
|
|
|
alias ll="lsd -alh"
|
|
|
|
alias lst="lsd --tree --level 2"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
alias ls="ls -la"
|
|
|
|
alias ll="ls -alh"
|
|
|
|
alias lst="ls --tree --level 2 --long"
|
|
|
|
#alias ls='ls --color=auto'
|
|
|
|
#alias ll='ls -lav --ignore=..' # show long listing of all except ".."
|
|
|
|
#alias l='ls -lav --ignore=.?*' # show long listing but no hidden dotfiles except "."
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if command -v bat &> /dev/null; then
|
|
|
|
alias cat="bat"
|
|
|
|
alias less="bat"
|
|
|
|
alias df="duf"
|
|
|
|
alias du="dust"
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2024-10-13 13:36:30 -04:00
|
|
|
|
2023-11-22 00:34:01 -05:00
|
|
|
|
2023-08-23 05:35:23 -04:00
|
|
|
################################################################################
|
2024-08-13 23:25:29 -04:00
|
|
|
|
|
|
|
# Initialize Zoxide if it's installed
|
|
|
|
if command -v zoxide &> /dev/null; then
|
|
|
|
# Initialize zoxide with the 'cd' command
|
|
|
|
eval "$(zoxide init --cmd cd bash)"
|
2024-08-14 01:22:53 -04:00
|
|
|
fi
|
|
|
|
|
2024-12-11 01:09:51 -05:00
|
|
|
# initialize atuin if it's installed
|
2024-08-14 01:22:53 -04:00
|
|
|
if command -v atuin &> /dev/null; then
|
|
|
|
# Initialize preexec and atuin if atuin is installed
|
|
|
|
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
|
|
|
|
eval "$(atuin init bash)"
|
|
|
|
fi
|
|
|
|
|
2024-12-11 01:09:51 -05:00
|
|
|
|
|
|
|
# Initialize starship if it's installed
|
|
|
|
if command -v starship &> /dev/null; then
|
|
|
|
eval "$(starship init bash)"
|
|
|
|
fi
|