diff options
| author | Syndamia <kamen@syndamia.com> | 2022-12-01 12:02:15 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2022-12-01 12:02:15 +0200 |
| commit | 38e6963fd28bb451f8256d9381c47c8a5139a14b (patch) | |
| tree | bca3e0cf994f561cbbc4873ab7b1a4f287b1e080 | |
| parent | b17f7d6299fa3076ac4520881536a902b9a47c24 (diff) | |
| download | dotfiles-38e6963fd28bb451f8256d9381c47c8a5139a14b.tar dotfiles-38e6963fd28bb451f8256d9381c47c8a5139a14b.tar.gz dotfiles-38e6963fd28bb451f8256d9381c47c8a5139a14b.zip | |
[zshrc] Changed ordering of some configs
| -rw-r--r-- | .zshrc | 236 |
1 files changed, 120 insertions, 116 deletions
@@ -37,7 +37,7 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an # DISABLE_UNTRACKED_FILES_DIRTY="true" # disable marking untracked files under VCS as dirty; improves status check for large repos # }}} - # Other {{{ + # setopt and autoload {{{ stty -F/dev/tty -ixon -ixoff # Disables Software Flow Control setopt long_list_jobs @@ -60,12 +60,6 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an # }}} # }}} -# Homelander {{{ - source ~/.zsh/homelander/homelander.zsh - - export RPROMPT='' -# }}} - # Plugins {{{ # omz plugins {{{ source ~/.zsh/omz/history.zsh @@ -77,6 +71,125 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an # zsh-syntax-highlighting {{{ source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # }}} + + # Homelander {{{ + source ~/.zsh/homelander/homelander.zsh + + export RPROMPT='' + # }}} +# }}} + +# Functions {{{ + # Funtoo updates {{{ + pre-sync() { + echo '(.zshrc) Running pre-sync function...' + + # Since in post-sync I change the EAPI of a lot of the ebuilds, + # the overlay can't be synced properly + _pwd=$(pwd) + cd /var/db/repos/gentoo + sudo git reset --hard + cd $_pwd + + echo '(.zshrc) pre-sync finished! :}' + } + + post-sync() { + echo '(.zshrc) Running post-sync function...' + + # Fixes the elusive + # "!!! Repository name or alias 'gentoo', defined for repository 'core-kit', overrides existing alias or repository." + # error when enabling gentoo overlay + sudo sed -i 's/aliases = gentoo/#aliases = gentoo/g' /var/git/meta-repo/kits/core-kit/metadata/layout.conf + + # In the gentoo overlay, most packages don't actually use EAPI 8 specific features, so + # they can safely be rolled back to EAPI 7 (funtoo's portage doesn't support EAPI 8 yet). + # However, there are still some that do need EAPI 8, so they should be left alone. + # Since I'm incredibly lazy, for now, this is how I'm gonna do it. + find '/var/db/repos/gentoo' -type f -name "*.ebuild" ! -path "*dev-qt*" ! -path "*kde-frameworks*" ! -path "*kde-plasma*" \ + | xargs sudo sed -i 's/EAPI=8/EAPI=7/g' + + echo '(.zshrc) post-sync finished! :]' + } + + alias sen="pre-sync && sudo ego sync && post-sync && sudo emerge --quiet-build -vuDN @world" + # }}} + + # cdrepo {{{ + cdrepo () { + [ -n "$2" ] && cd "$HOME/Programming/$1/$2" \ + || cd "$HOME/Programming/$1" + } + + alias cdg="cdrepo GitHub-repos" + alias cdl="cdrepo GitLab-repos" + alias cds="cdrepo source" + # }}} + + # Run in the background + bgr () { + nohup sh -c "$@" 2>&1 & + disown + } + + # Kill process and run in the background + res () { + pkill $@ + bgr $@ + } + + if [[ $device == "desktop" ]]; then + + if [[ -x "$(command -v vim)" ]]; then + # Open vim with .vim-session file, if it exists and the vim command doesn't have any parameters + v () { + if [ -f ".vim-session" ] && [ -z "$1" ]; then + vim -S .vim-session + else + vim $@ + fi + } + fi + + if [[ -x "$(command -v grit)" ]]; then + # Add to grit parent, where first value is parent number and everything else is node value + grap () { + parent="$1" + shift + grit add -p $parent -- $@ + } + fi + + if [[ -x "$(command -v nemo)" ]]; then + onemo() { + bgr "nemo ./" + } + fi + + # Launch .desktop application (either full path or just name) + dela () { + name=$1 + if [[ ${name:0:1} != "/" ]]; then + name="/usr/share/applications/${name}" + fi + if [[ ! $name =~ .desktop$ ]]; then + name+=".desktop" + fi + comm=($(awk -F= '$1=="Exec"{$1=""; print}' "$name")) + bgr "$comm" + } + + metas() { + for file in *; do + [ "$file" != 'cover.jpeg' ] && \ + kid3-cli -c "set title \"$(echo "$file" | sed -e "s/\.[^.]*$//")\"" \ + -c "set artist \"$1\"" -c "set album \"$2\"" -c "set date \"$3\"" \ + -c 'set picture:"./cover.jpeg" ""' "$file" \ + || : + done + } + + fi # }}} # Aliases {{{ @@ -84,7 +197,6 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an if [[ -x "$(command -v emerge)" ]]; then alias seq="sudo emerge --quiet-build -v" alias sep="sudo emerge -pv" - alias sen="pre-sync && sudo ego sync && post-sync && sudo emerge --quiet-build -vuDN @world" alias seN="sudo emerge --quiet-build -vuDN @world" alias seNp="sudo emerge --quiet-build -pvuDN @world" alias ses="sudo emerge -s" @@ -97,37 +209,6 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an alias use="sudo vim /etc/portage/package.use" alias unmask="sudo vim /etc/portage/package.unmask" alias mask="sudo vim /etc/portage/package.mask" - - pre-sync() { - echo '(.zshrc) Running pre-sync function...' - - # Since in post-sync I change the EAPI of a lot of the ebuilds, - # the overlay can't be synced properly - _pwd=$(pwd) - cd /var/db/repos/gentoo - sudo git reset --hard - cd $_pwd - - echo '(.zshrc) pre-sync finished! :}' - } - - post-sync() { - echo '(.zshrc) Running post-sync function...' - - # Fixes the elusive - # "!!! Repository name or alias 'gentoo', defined for repository 'core-kit', overrides existing alias or repository." - # error when enabling gentoo overlay - sudo sed -i 's/aliases = gentoo/#aliases = gentoo/g' /var/git/meta-repo/kits/core-kit/metadata/layout.conf - - # In the gentoo overlay, most packages don't actually use EAPI 8 specific features, so - # they can safely be rolled back to EAPI 7 (funtoo's portage doesn't support EAPI 8 yet). - # However, there are still some that do need EAPI 8, so they should be left alone. - # Since I'm incredibly lazy, for now, this is how I'm gonna do it. - find '/var/db/repos/gentoo' -type f -name "*.ebuild" ! -path "*dev-qt*" ! -path "*kde-frameworks*" ! -path "*kde-plasma*" \ - | xargs sudo sed -i 's/EAPI=8/EAPI=7/g' - - echo '(.zshrc) post-sync finished! :]' - } fi # }}} @@ -176,9 +257,6 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an fi if [[ $device != "server" ]]; then - alias cdg="cdrepo GitHub-repos" - alias cdl="cdrepo GitLab-repos" - alias cds="cdrepo source" else alias wudo="sudo -u www-data" @@ -210,80 +288,6 @@ device='desktop' # can be either "desktop" (default when empty), "server" or "an bindkey '^H' backward-kill-word # }}} -# Functions {{{ - # Run in the background - bgr () { - nohup sh -c "$@" 2>&1 & - disown - } - - # Kill process and run in the background - res () { - pkill $@ - bgr $@ - } - - if [[ $device != "server" ]]; then - cdrepo () { - [ -n "$2" ] && cd "$HOME/Programming/$1/$2" \ - || cd "$HOME/Programming/$1" - } - fi - - if [[ $device == "desktop" ]]; then - - if [[ -x "$(command -v vim)" ]]; then - # Open vim with .vim-session file, if it exists and the vim command doesn't have any parameters - v () { - if [ -f ".vim-session" ] && [ -z "$1" ]; then - vim -S .vim-session - else - vim $@ - fi - } - fi - - if [[ -x "$(command -v grit)" ]]; then - # Add to grit parent, where first value is parent number and everything else is node value - grap () { - parent="$1" - shift - grit add -p $parent -- $@ - } - fi - - if [[ -x "$(command -v nemo)" ]]; then - onemo() { - bgr "nemo ./" - } - fi - - # Launch .desktop application (either full path or just name) - dela () { - name=$1 - if [[ ${name:0:1} != "/" ]]; then - name="/usr/share/applications/${name}" - fi - if [[ ! $name =~ .desktop$ ]]; then - name+=".desktop" - fi - comm=($(awk -F= '$1=="Exec"{$1=""; print}' "$name")) - bgr "$comm" - } - - metas() { - for file in *; do - [ "$file" != 'cover.jpeg' ] && \ - kid3-cli -c "set title \"$(echo "$file" | sed -e "s/\.[^.]*$//")\"" \ - -c "set artist \"$1\"" -c "set album \"$2\"" -c "set date \"$3\"" \ - -c 'set picture:"./cover.jpeg" ""' "$file" \ - || : - done - } - - fi -# }}} - # Execute on startup {{{ #}}} |
