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
|
||||
|
||||
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)
|
||||
|
||||
You can install these dotfiles by cloning this repository and executing `install.sh`:
|
||||
If you're on Artix Linux, you can install these dotfiles by cloning this repository and executing `artix-install.sh`:
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/theanonymousexyz/dotfiles.git
|
||||
$ cd dotfiles
|
||||
$ chmod +x install.sh
|
||||
$ ./install.sh
|
||||
$ chmod +x artix-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`:
|
||||
|
@ -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.
|
||||
- The install script requires GNU Stow to work.
|
||||
- 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.
|
||||
- Optionally, fork this repository to make maintenance easier.
|
||||
- See the READMEs in the individual subfolders here for special notes.
|
||||
- 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
|
||||
|
||||
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..."
|
||||
cd -- "$(dirname -- $0)"
|
||||
ZDOTDIR="$HOME/.config/zsh"
|
||||
mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory
|
||||
|
||||
sleep 0.5
|
||||
|
||||
echo "Creating the symlinks with stow..."
|
||||
|
||||
for dir in *
|
||||
do
|
||||
[ -d "$dir" ] && stow -t "$HOME" --ignore="README.md" "$dir"
|
||||
for dir in *; do
|
||||
if [ -d "$dir" ]; then
|
||||
echo "* Symlinking $dir"
|
||||
stow -t "$HOME" --ignore="README.md" "$dir"
|
||||
sleep 0.1
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 0.5
|
||||
sleep 0.4
|
||||
echo "Making scripts executable..."
|
||||
|
||||
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-status.sh
|
||||
chmod +x waybar/.config/waybar/mediaplayer.py
|
||||
|
||||
sleep 0.5
|
||||
|
||||
echo "Done!"
|
|
@ -6,3 +6,5 @@
|
|||
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
|
||||
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; }
|
||||
|
||||
return 0
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#!/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
|
||||
echo "This script must be run as root. Quitting..."
|
||||
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
|
||||
pgrep "^ivpn-service$" &> /dev/null &&
|
||||
ivpn disconnect &> /dev/null
|
||||
doas pkill "^ivpn-service$" &> /dev/null
|
||||
if [[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]]; then
|
||||
{
|
||||
pgrep "^ivpn-service$" && ivpn disconnect
|
||||
doas pkill "^ivpn-service$"
|
||||
|
||||
pkill "^mako$" &> /dev/null
|
||||
pkill "^pipewire$" &> /dev/null
|
||||
pkill "^pipewire-pulse$" &> /dev/null
|
||||
pkill "^wireplumber$" &> /dev/null
|
||||
pkill "^mako$"
|
||||
pkill "^pipewire$"
|
||||
pkill "^pipewire-pulse$"
|
||||
pkill "^wireplumber$"
|
||||
} &> /dev/null
|
||||
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 XDG_CURRENT_DESKTOP=Unity
|
||||
export GTK_USE_PORTAL=1
|
||||
|
@ -6,6 +6,4 @@ if [ "$(tty)" = "/dev/tty1" ]; then
|
|||
|
||||
dbus-launch --sh-syntax --exit-with-session sway &> /dev/null
|
||||
exit
|
||||
else
|
||||
neofetch
|
||||
fi
|
||||
|
|
|
@ -7,9 +7,12 @@ export LANG="en_DK.UTF-8"
|
|||
export EDITOR="nvim"
|
||||
export PAGER="less"
|
||||
|
||||
# Settings
|
||||
# Less
|
||||
export LESS="-R"
|
||||
export LESSHISTFILE="/dev/null"
|
||||
|
||||
# Tmux
|
||||
[[ -z $TMUX ]] || export TERM="xterm-256color"
|
||||
|
||||
# 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)
|
||||
|
||||
# Load the .zsh files
|
||||
for file in $ZDOTDIR/.*.zsh; do
|
||||
[[ $file == $ZDOTDIR/.p10k.zsh ]] || source $file
|
||||
for file in $ZDOTDIR/*.zsh; do
|
||||
source $file
|
||||
done
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue