206 lines · 6.2 KB
#!/usr/bin/env bash

# Where our dotfiles repo lives
export DOTFILES="$HOME/.dotfiles"

os="$(which_os)"

function thunderboltUp() {
    local "$id"
    case "$HOSTNAME" in
    stardust)
        id="00968984-4c6a-1e00-ffff-ffffffffffff"
        ;;
    *) # lightningbolt
        id="00b62260-4590-1e00-ffff-ffffffffffff"
        ;;
    esac
    sudo boltctl authorize "$id"
}

# OS/Distro specific stuff
case "$os" in
nixos)
    alias ls='ls --color=auto'
    PS1='[\u@\h \W]\$ '

    # Fixes for various things on demand
    alias make-firefox-default="xdg-settings set default-web-browser firefox.desktop"
    alias fix-display='xrandr --output DP-0 --mode 2560x2880 --pos 0x0 --output DP-2 --mode 2560x2880 --pos 2560x0'
    alias set-wallpaper='[ -f "$HOME/.wallpaper" ] && feh --bg-scale "$HOME/.wallpaper"'
    alias start-picom='systemctl --user start picom.service'
    alias stop-picom='systemctl --user stop picom.service'
    alias restart-picom='systemctl --user restart picom.service'
    ;;

debian)
    # shellcheck disable=1091
    if ! shopt -oq posix; then
        if [ -f /usr/share/bash-completion/bash_completion ]; then
            . /usr/share/bash-completion/bash_completion