create_user_aliases.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. cd || return
  7. {
  8. echo "alias aur_update='for dir in ~/aur/*; do (cd \"\$dir\" && pwd && git pull); done'"
  9. echo "alias syncthing='syncthing -no-browser'"
  10. echo "alias getBatt='upower -i /org/freedesktop/UPower/devices/battery_BAT0'"
  11. echo "alias getBattBrief='upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E \"state|time\ to\ |percentage\"'"
  12. echo "alias getBattPercent=\"upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'percentage' | awk '{print \$2}'\"":
  13. echo "alias getVulnerabilities='grep -RHe \"^\" /sys/devices/system/cpu/vulnerabilities'"
  14. echo "alias getAudioMaster=\"amixer sget Master | grep 'Right:' | awk -F'[][]' '{print \$2}'\""
  15. echo "alias dim=\"echo \$(tput cols)x\$(tput lines)\""
  16. echo "alias systemstats='echo \"== Disks ==\" && df -h && echo \"== Memory ==\" && free -h && echo \"== CPU ==\" && cat /proc/cpuinfo | grep \"cpu MHz\" && echo \"== TEMP ==\" && sensors | grep \"°C\"'"
  17. echo "alias youtube-dl_getlist='sed -i \"s/invidious.sethforprivacy.com/www.youtube.com/g\" ~/Downloads/youtube-dl.txt && yt-dlp -vci -N 1 -o \"video-\$(date \"+%Y%m%d\")-%(title)s-%(id)s.%(ext)s\" -a ~/Downloads/youtube-dl.txt && rm ~/Downloads/youtube-dl.txt'"
  18. } >>~/.bash_aliases
  19. {
  20. echo ""
  21. echo "# bash aliases"
  22. echo "if [ -f ~/.bash_aliases ]; then"
  23. echo " . ~/.bash_aliases"
  24. echo "fi"
  25. } >>~/.bashrc
  26. source ~/.bashrc