Major overhaul
- Make everything compatible with both Artix and Fedora - Install script is now only for Artix - Extra .zsh files are no longer dot files, makes sourcing from .zshrc easier
This commit is contained in:
parent
b9bc23d46e
commit
67eac27d79
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB |
14
README.md
14
README.md
|
@ -1,16 +1,14 @@
|
||||||
# My dotfiles
|
# My dotfiles
|
||||||
|
|
||||||
This is a collection of some of my dotfiles for my Artix Linux system.
|
This is a collection of some of my dotfiles for my Linux systems. I personally use these on Artix Linux and Fedora Workstation.
|
||||||
|
|
||||||
![Screenshot](./.img/screenshot.png)
|
If you're on Artix Linux, you can install these dotfiles by cloning this repository and executing `artix-install.sh`:
|
||||||
|
|
||||||
You can install these dotfiles by cloning this repository and executing `install.sh`:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ git clone https://github.com/theanonymousexyz/dotfiles.git
|
$ git clone https://github.com/theanonymousexyz/dotfiles.git
|
||||||
$ cd dotfiles
|
$ cd dotfiles
|
||||||
$ chmod +x install.sh
|
$ chmod +x artix-install.sh
|
||||||
$ ./install.sh
|
$ ./artix-install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that I use `doas` instead of `sudo`. If you prefer `sudo`, then change all instances of `doas` to `sudo`, or simply create a symlink `doas` pointing to `sudo`:
|
Note that I use `doas` instead of `sudo`. If you prefer `sudo`, then change all instances of `doas` to `sudo`, or simply create a symlink `doas` pointing to `sudo`:
|
||||||
|
@ -23,5 +21,5 @@ sudo ln -s $(which sudo) /usr/bin/doas
|
||||||
- You need to make `doas`/`sudo` rules that allow you to execute, `poweroff` and `reboot` (and additionally `ivpn-service` and `pkill "^ivpn-service$"` if you use IVPN) without a password, otherwise the keybindings and scripts for those won't work.
|
- You need to make `doas`/`sudo` rules that allow you to execute, `poweroff` and `reboot` (and additionally `ivpn-service` and `pkill "^ivpn-service$"` if you use IVPN) without a password, otherwise the keybindings and scripts for those won't work.
|
||||||
- The install script requires GNU Stow to work.
|
- The install script requires GNU Stow to work.
|
||||||
- Make sure to thoroughly examine these dotfiles and change them to your needs before using them.
|
- Make sure to thoroughly examine these dotfiles and change them to your needs before using them.
|
||||||
- See the READMEs for some of the packages here for special notes.
|
- See the READMEs in the individual subfolders here for special notes.
|
||||||
- Optionally, fork this repository to make maintenance easier.
|
- I've installed `dash` and symlinked `/bin/sh` to it for faster execution of shell scripts. As such, all my scripts try to be as POSIX compliant as possible. If you're on an Arch based distro, you can install `dashbinsh` from the AUR to automatically keep `/bin/sh` symlinked to `dash`.
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(lsb_release -si)" != "Artix" ]; then
|
||||||
|
echo "This script is only intended to be used for a full setup on Artix Linux. Quitting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Configuring directories..."
|
echo "Configuring directories..."
|
||||||
cd -- "$(dirname -- $0)"
|
cd -- "$(dirname -- $0)"
|
||||||
ZDOTDIR="$HOME/.config/zsh"
|
ZDOTDIR="$HOME/.config/zsh"
|
||||||
mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory
|
mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
echo "Creating the symlinks with stow..."
|
echo "Creating the symlinks with stow..."
|
||||||
|
|
||||||
for dir in *
|
for dir in *; do
|
||||||
do
|
if [ -d "$dir" ]; then
|
||||||
[ -d "$dir" ] && stow -t "$HOME" --ignore="README.md" "$dir"
|
echo "* Symlinking $dir"
|
||||||
|
stow -t "$HOME" --ignore="README.md" "$dir"
|
||||||
|
sleep 0.1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.4
|
||||||
echo "Making scripts executable..."
|
echo "Making scripts executable..."
|
||||||
|
|
||||||
chmod +x scripts/.local/bin/clear-clipboard.sh
|
chmod +x scripts/.local/bin/clear-clipboard.sh
|
||||||
|
@ -23,6 +31,6 @@ chmod +x sway/.config/sway/autostart.sh
|
||||||
chmod +x waybar/.config/waybar/ivpn-reconnect.sh
|
chmod +x waybar/.config/waybar/ivpn-reconnect.sh
|
||||||
chmod +x waybar/.config/waybar/ivpn-status.sh
|
chmod +x waybar/.config/waybar/ivpn-status.sh
|
||||||
chmod +x waybar/.config/waybar/mediaplayer.py
|
chmod +x waybar/.config/waybar/mediaplayer.py
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
||||||
echo "Done!"
|
echo "Done!"
|
|
@ -6,3 +6,5 @@
|
||||||
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
|
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
|
||||||
command -v npm >/dev/null 2>&1 && { echo; npm up -g; }
|
command -v npm >/dev/null 2>&1 && { echo; npm up -g; }
|
||||||
command -v docker >/dev/null 2>&1 && { echo; docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -l docker pull; }
|
command -v docker >/dev/null 2>&1 && { echo; docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -l docker pull; }
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(lsb_release -si)" = "Arch" ] || [ "$(lsb_release -si)" = "Artix" ]; then
|
||||||
|
echo "This script must be run on either Arch Linux or Artix Linux. Quitting..."
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
echo "This script must be run as root. Quitting..."
|
echo "This script must be run as root. Quitting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
# Shortcuts
|
|
||||||
alias btctl="bluetoothctl"
|
|
||||||
alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
|
||||||
alias cl="clear"
|
|
||||||
alias exa="exa -aFghl --color=always --git --icons"
|
|
||||||
alias grep="grep --color=always"
|
|
||||||
alias l="lsd -hlA --color=always"
|
|
||||||
alias la="lsd -hl --color=always"
|
|
||||||
alias ll="lsd -hlaF --color=always"
|
|
||||||
alias ls="ls --color=always"
|
|
||||||
alias q="exit"
|
|
||||||
alias tree="exa --color=always --tree -I '.git'"
|
|
||||||
alias u="paru; echo; npm up -g"
|
|
||||||
alias zgrep="zgrep --color=always"
|
|
||||||
|
|
||||||
# File management
|
|
||||||
alias cp="cp -iv"
|
|
||||||
alias mkdir="mkdir -pv"
|
|
||||||
alias mv="mv -iv"
|
|
||||||
alias rm="rm -iv"
|
|
||||||
alias srm="srm -iv"
|
|
||||||
|
|
||||||
# Passwordless doas
|
|
||||||
alias poweroff="doas poweroff"
|
|
||||||
alias reboot="doas reboot"
|
|
||||||
|
|
||||||
# sudoedit for doas (hacky solution)
|
|
||||||
alias doasedit="doas -L; doas sh -c '$EDITOR /etc/doas.conf; doas -C /etc/doas.conf && echo ok || echo error'; doas -L"
|
|
|
@ -1,10 +1,11 @@
|
||||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
if [[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]]; then
|
||||||
pgrep "^ivpn-service$" &> /dev/null &&
|
{
|
||||||
ivpn disconnect &> /dev/null
|
pgrep "^ivpn-service$" && ivpn disconnect
|
||||||
doas pkill "^ivpn-service$" &> /dev/null
|
doas pkill "^ivpn-service$"
|
||||||
|
|
||||||
pkill "^mako$" &> /dev/null
|
pkill "^mako$"
|
||||||
pkill "^pipewire$" &> /dev/null
|
pkill "^pipewire$"
|
||||||
pkill "^pipewire-pulse$" &> /dev/null
|
pkill "^pipewire-pulse$"
|
||||||
pkill "^wireplumber$" &> /dev/null
|
pkill "^wireplumber$"
|
||||||
|
} &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
if [[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]]; then
|
||||||
export $(gnome-keyring-daemon --start)
|
export $(gnome-keyring-daemon --start)
|
||||||
export XDG_CURRENT_DESKTOP=Unity
|
export XDG_CURRENT_DESKTOP=Unity
|
||||||
export GTK_USE_PORTAL=1
|
export GTK_USE_PORTAL=1
|
||||||
|
@ -6,6 +6,4 @@ if [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
|
|
||||||
dbus-launch --sh-syntax --exit-with-session sway &> /dev/null
|
dbus-launch --sh-syntax --exit-with-session sway &> /dev/null
|
||||||
exit
|
exit
|
||||||
else
|
|
||||||
neofetch
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,9 +7,12 @@ export LANG="en_DK.UTF-8"
|
||||||
export EDITOR="nvim"
|
export EDITOR="nvim"
|
||||||
export PAGER="less"
|
export PAGER="less"
|
||||||
|
|
||||||
# Settings
|
# Less
|
||||||
export LESS="-R"
|
export LESS="-R"
|
||||||
export LESSHISTFILE="/dev/null"
|
export LESSHISTFILE="/dev/null"
|
||||||
|
|
||||||
|
# Tmux
|
||||||
|
[[ -z $TMUX ]] || export TERM="xterm-256color"
|
||||||
|
|
||||||
# Secret variables
|
# Secret variables
|
||||||
[[ -f $ZDOTDIR/.env ]] && source $ZDOTDIR/.env
|
[[ -f $ZDOTDIR/.env.zsh ]] && source $ZDOTDIR/.env.zsh
|
||||||
|
|
|
@ -7,8 +7,8 @@ PZ_PLUGIN_HOME="$ZDOTDIR/plugins"
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern regexp root line)
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern regexp root line)
|
||||||
|
|
||||||
# Load the .zsh files
|
# Load the .zsh files
|
||||||
for file in $ZDOTDIR/.*.zsh; do
|
for file in $ZDOTDIR/*.zsh; do
|
||||||
[[ $file == $ZDOTDIR/.p10k.zsh ]] || source $file
|
source $file
|
||||||
done
|
done
|
||||||
|
|
||||||
# Initialize PZ
|
# Initialize PZ
|
||||||
|
|
26
zsh/.config/zsh/aliases.zsh
Normal file
26
zsh/.config/zsh/aliases.zsh
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Common aliases
|
||||||
|
alias btctl="bluetoothctl"
|
||||||
|
alias cl="clear"
|
||||||
|
alias cp="cp -i"
|
||||||
|
alias exa="exa -aFghl --color=always --git --icons"
|
||||||
|
alias grep="grep --color=always"
|
||||||
|
alias l="lsd -hlA --color=always"
|
||||||
|
alias la="lsd -hl --color=always"
|
||||||
|
alias ll="lsd -hlaF --color=always"
|
||||||
|
alias ls="ls --color=always"
|
||||||
|
alias mkdir="mkdir -p"
|
||||||
|
alias mv="mv -i"
|
||||||
|
alias q="exit"
|
||||||
|
alias rm="rm -i"
|
||||||
|
alias srm="srm -i"
|
||||||
|
alias tmux="tmux -2u"
|
||||||
|
alias tree="exa --tree -I '.git'"
|
||||||
|
alias wl-copy="wl-copy -n"
|
||||||
|
alias zgrep="zgrep --color=always"
|
||||||
|
|
||||||
|
if [[ $(lsb_release -si) == Artix ]]; then
|
||||||
|
alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||||
|
alias doasedit="doas -L; doas sh -c '$EDITOR /etc/doas.conf; doas -C /etc/doas.conf && echo ok || echo error'; doas -L"
|
||||||
|
alias poweroff="doas poweroff"
|
||||||
|
alias reboot="doas reboot"
|
||||||
|
fi
|
|
@ -1,2 +1,2 @@
|
||||||
ZDOTDIR="$HOME/.config/zsh"
|
export ZDOTDIR="$HOME/.config/zsh"
|
||||||
source $ZDOTDIR/.zshenv
|
source $ZDOTDIR/.zshenv
|
||||||
|
|
Loading…
Reference in a new issue