Merge branch 'master' of github.com:hektor/dots

master
Hektor Misplon 2023-03-12 13:12:36 +01:00
commit 0b7b0900af
2 changed files with 29 additions and 9 deletions

View File

@ -65,7 +65,15 @@ alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
reboot_to_windows () reboot_to_windows ()
{ {
# Check if grub is installed by checking if the command exists, if it does
# not, then assume that the system is using systemd-boot
if grub-install --version &>/dev/null; then
windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2) windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
sudo grub-reboot "$windows_title" && sudo reboot sudo grub-reboot "$windows_title"
echo "Grub set to reboot to Windows"
else
sudo bootctl set-oneshot windows.conf
echo "Systemd set to reboot to Windows"
fi
} }
alias reboot-to-windows='reboot_to_windows' alias reboot-to-windows='reboot_to_windows'

22
.bashrc
View File

@ -1,6 +1,8 @@
# If not running interactively, don't do anything # If not running interactively, don't do anything
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
source /etc/os-release
# Aliases {{{ # Aliases {{{
# Load aliases dynamically # Load aliases dynamically
[ -f "$HOME/.bash_aliases" ] && source "$HOME/.bash_aliases" [ -f "$HOME/.bash_aliases" ] && source "$HOME/.bash_aliases"
@ -46,6 +48,14 @@ export MANWIDTH=120
export EDITOR=nvim export EDITOR=nvim
# }}} # }}}
# Vim
export EDITOR=vim
# Nvm
export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
export NVM_DIR="$HOME/.nvm"
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
# X11 {{{ # X11 {{{
export XDG_SESSION_TYPE=X11 export XDG_SESSION_TYPE=X11
export XDG_CONFIG_HOME=$HOME/.config export XDG_CONFIG_HOME=$HOME/.config
@ -68,13 +78,16 @@ if [ -f "/usr/bin/fzf" ]; then
--color=fg:-1,bg:-1" --color=fg:-1,bg:-1"
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}" export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'" export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
if [[ $ID == "raspbian" ]]; then
source /usr/share/doc/fzf/examples/completion.bash
source /usr/share/doc/fzf/examples/key-bindings.bash
elif [[ $ID == "arch" ]]; then
source /usr/share/fzf/completion.bash source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash source /usr/share/fzf/key-bindings.bash
fi
_fzf_setup_completion path vim _fzf_setup_completion path vimn zathura xournalpp
_fzf_setup_completion path zathura
_fzf_setup_completion path xournalpp
_fzf_setup_completion path nvim
else else
echo "fzf not installed" echo "fzf not installed"
fi fi
@ -93,4 +106,3 @@ source /usr/share/nvm/install-nvm-exec
# Jupyter {{{ # Jupyter {{{
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
# }}} # }}}