+ Replacing sudo with doas (if possible)

This commit is contained in:
ziro 2021-08-14 08:32:45 +07:00
parent 7aa1e65676
commit b2ce214bd3
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 22 additions and 20 deletions

View file

@ -1,15 +1,15 @@
#!/bin/zsh
# Path
# -- Path
PATH="$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')${PATH:+:${PATH}}"
# IBus stuff
# -- IBus stuff (IME)
export GTK_IM_MODULE='ibus'
export QT_IM_MODULE='ibus'
export XMODIFIERS=@im='ibus'
export GLFW_IM_MODULE='ibus'
# DEFAULT
# -- DEFAULT
export QT_QPA_PLATFORMTHEME='qt5ct'
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
@ -26,24 +26,24 @@ export GOOGLE_APPLICATION_CREDENTIALS="$HOME/Downloads/youtube-9ab71578c563.json
export MANPAGER="nvimpager"
# export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
# Wine problem workaround
# -- Wine problem workaround
# export MESA_GL_VERSION_OVERRIDE=4.4
# alternative workaround
export MESA_GL_VERSION_OVERRIDE=4.6
export MESA_GLSL_VERSION_OVERRIDE=460
# SUDO
#export SUDO_ASKPASS=/bin/rofi-askpass
if [[ ! -z $DISPLAY ]]; then
export SUDO_ASKPASS="/bin/dmenu-askpass"
fi
# -- SUDO - Deactivated by default (using DOAS now)
# export SUDO_ASKPASS=/bin/rofi-askpass
# if [[ ! -z $DISPLAY ]]; then
# export SUDO_ASKPASS="/bin/dmenu-askpass"
# fi
# XDG
# -- XDG
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
#cleaning up
# cleaning up
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
export SCRIPTS="$HOME/.scripts"
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
@ -60,11 +60,15 @@ export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc-2.0"
export PYTHONSTARTUP="${XDG_CONFIG_HOME:-$HOME/.config}/python/pyrc"
# Path to your oh-my-zsh installation.
# vimrc (this will init/source ~/.config/vim/vimrc instead of ~/.vimrc)
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
# Path to oh-my-zsh installation
export ZSH="${XDG_DATA_HOME:-$HOME/.local/share}/oh-my-zsh"
export ZSH_CUSTOM="$ZSH/custom"
export ZSH_PLUGINS="$ZSH_CUSTOM/plugins"
# -- LF
# icon for lf
export LF_ICONS="\
tw=:\

View file

@ -31,8 +31,6 @@ HISTFILE=~/.cache/zsh/zsh_history
HISTSIZE=1000
SAVEHIST=1000
# vimrc
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
# vi mode
set -o vi
bindkey -v

View file

@ -2,7 +2,7 @@
#sudo
[ -z $DISPLAY ] && alias sudo='sudo ' || alias sudo='sudo --askpass '
alias doas='doas -- '
# alias doas='doas -- '
#sudo + vim, yea imagine having that powe- nvm
alias sudovim='sudoedit'
@ -31,7 +31,7 @@ alias weather='curl wttr.in'
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
#install
alias p='sudo pacman'
alias p='doas pacman'
alias a='paru'
#ripper
@ -48,9 +48,9 @@ alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
alias ytv='youtube-viewer'
alias gravit='~/my\ Files/Gravit/GravitDesigner.AppImage'
alias redoom='~/doom refresh'
alias rvim='sudo vim'
alias rvim='doas vim'
alias py='python'
alias ps2c='sudo sh $HOME/.scripts/ps2c'
alias ps2c='doas sh $HOME/.scripts/ps2c'
alias cls='clear'
alias classprop='xprop WM_CLASS'
alias storagelist='lsblk -f'
@ -100,8 +100,8 @@ alias htop='htop -t'
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias mntfd='sudo mount -o gid=users,fmask=113,dmask=002'
alias umntfd='sudo umount'
alias mntfd='doas mount -o gid=users,fmask=113,dmask=002'
alias umntfd='doas umount'
alias cmatrix='unimatrix -n -s 96 -l 'o''
alias make-xanmod='env use_tracers=n use_numa=n use_pds=y use_ns=y makepkg -s'
alias s='cd $HOME/.local/bin/scripts;ls'