Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
49ec9f815a | |||
7991035935 | |||
0a8b09ca65 |
51 changed files with 158 additions and 854 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.installed
|
13
README.md
13
README.md
|
@ -1,12 +1 @@
|
|||
# Raine's Dotfiles
|
||||
|
||||
## Crates
|
||||
Everything is a crate.
|
||||
If something is distro specific you should follow the following naming scheme:
|
||||
`crate.<DISTRO>.sh`
|
||||
|
||||
## Using it
|
||||
Just use the script tbh
|
||||
```sh
|
||||
curl -L https://via.ixvd.net/sh | sh
|
||||
```
|
||||
# Strix's Dotfiles
|
3
configs/default.sh
Normal file
3
configs/default.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
crate_apply ssh
|
|
@ -1,27 +0,0 @@
|
|||
name = "example" #*
|
||||
description = "hello"
|
||||
author = ":$3"
|
||||
|
||||
# [ LINKS ]
|
||||
# This defines what links should be made.
|
||||
# vars:
|
||||
# "$CRATE" expands to path of directory of this file.
|
||||
# "$CROOT" expands to base directory / cwd from the runner
|
||||
# prefixes:
|
||||
# "#" - system root
|
||||
# "~" - home of user or user defined in options
|
||||
# "%" - temp directory
|
||||
[links]
|
||||
"$CRATE/system.sh" = { name = "/etc/system_boot", su = "true" }
|
||||
"$CRATE/system2.sh" = "#/etc/system_boot.sh" # same as above
|
||||
|
||||
# [ COPIES ]
|
||||
# basically the same as links but copies
|
||||
[copies]
|
||||
"$CRATE/system3.sh" = "#/etc/system_boot.sh" # same as above
|
||||
|
||||
# [ SCRIPTS ]
|
||||
# Run stuff
|
||||
[scripts]
|
||||
"$CRATE/system/net_config.sh" = 1
|
||||
"$CRATE/system/net_config2.sh" = { su = "false" }
|
3
configs/laptop.sh
Normal file
3
configs/laptop.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
crate_apply tlp
|
|
@ -1,12 +0,0 @@
|
|||
super_apply() {
|
||||
pacman -Syyu --noconfirm
|
||||
pacman -S --needed --noconfirm sudo reflector
|
||||
if ! grep -q "Reflector" /etc/pacman.d/mirrorlist; then
|
||||
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
||||
reflector -c NL -f 10 --threads 4 --save /etc/pacman.d/mirrorlist
|
||||
else
|
||||
echo "err: reflector already executed -- skipping..."
|
||||
fi
|
||||
|
||||
cp files/pacman.conf /etc/pacman.conf
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
super_apply() {
|
||||
apt update -y
|
||||
apt install -y netselect-apt sudo
|
||||
netselect-apt
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Install stuff on the system!"
|
||||
scripts="@distro @self"
|
||||
|
||||
super_apply() {
|
||||
if [ -f /usr/lib/security/pam_wheel.so ] && ! grep -q "# pam_wheel.so added" /etc/pam.d/su; then
|
||||
echo "auth sufficient pam_wheel.so trust use_uid" > /etc/pam.d/su
|
||||
echo "# pam_wheel.so added" > /etc/pam.d/su
|
||||
fi
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
[options]
|
||||
HoldPkg = pacman glibc yay
|
||||
Architecture = auto
|
||||
|
||||
Color
|
||||
CheckSpace
|
||||
ParallelDownloads = 5
|
||||
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
#[testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[community-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[community]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
#[multilib-testing]
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="setup ssh"
|
||||
|
||||
apply() {
|
||||
[ -e "$HOME/.ssh/authorized_keys" ] || ln files/authorized_keys $HOME/.ssh/authorized_keys
|
||||
if ! [ -f "$HOME/.ssh/id_rsa" ]; then
|
||||
echo "Creating new ssh key for this device..."
|
||||
ssh-keygen -f $HOME/.ssh/id_rsa -p "" -q
|
||||
echo "Adding key to authorized_keys..."
|
||||
cat $HOME/.ssh/id_rsa.pub > $HOME/.ssh/authorized_keys
|
||||
fi
|
||||
}
|
||||
|
||||
undo() {
|
||||
echo "Undoing ssh keys is not supported, please do this manually."
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCeNQfnbyyF3sht43vH5BcXDPca8nWu6bKPVGvAlWBOq4Av8ME2IQgwVe9nJ05r73ZY02/Vdqc01a8wyK5Hmw0XlPL0Cn6wc9QoiscOvq5lMUK87S2tr3EVLGkgl8o7nmVuWgLewyojiORjM02P1PZEiFhKPXVEQFxU0dFz9QtpAdm0u78Xn2HTukHpXSv44R3XDDMFZ3Ek/XRuS6J9dZVxGkgCLQhK8kpfbxuiYxaRC7MHgGlYuxjLuZ6P4i+V+SSSShfCGdm6U9bgeIAwftN6a8Pc9+OsBeZGSUrGjZjRlD35q0a7fbpoS8pKTfbwgf/ijYeu3JmAQUlY+H959mIpg4H9XOgRrKVJSYwx5/BGuhmWgVy6HIYpXCQfEbLE7QDmwC2C430KzAH6jCcrRNyurIUCuO4iq9dwoQTzboMccOK79S2Z+1B5fYgS3BZgaiTUBSME2G2FriM6utgleiBnvFu/p7oH2I8ZHL/aVcSWAw0gbzsr7ADywAuiDNZk18c= raine@ryuk
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
pkgs="i3 i3lock i3status libpulse brightnessctl xss-lock dex maim dmenu gnome-keyring feh picom"
|
||||
|
||||
super_apply() {
|
||||
pacman -S --needed --noconfirm $pkgs
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
pacman -R --noconfirm $pkgs
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Installs i3"
|
||||
scripts="@distro @self"
|
||||
|
||||
apply() {
|
||||
[ -d "$HOME/.config/i3" ] || mkdir -p $HOME/.config/i3
|
||||
[ -d "$HOME/.config/i3status" ] || mkdir -p $HOME/.config/i3status
|
||||
[ -e "$HOME/.config/i3/config" ] || ln files/config $HOME/.config/i3/config
|
||||
[ -e "$HOME/.config/i3status/config" ] || ln files/status_config $HOME/.config/i3status/config
|
||||
[ -e "$HOME/.config/picom.conf" ] || ln files/picom.conf $HOME/.config/picom.conf
|
||||
}
|
||||
|
||||
undo() {
|
||||
rm $HOME/.config/i3/config
|
||||
rm $HOME/.config/i3status/config
|
||||
}
|
||||
|
||||
super_apply() {
|
||||
[ -d "/etc/X11/xorg.conf.d" ] || mkdir -p /etc/X11/xorg.conf.d/
|
||||
cp files/40-proper-touchpad.conf /etc/X11/xorg.conf.d/40-proper-touchpad.conf
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
rm /etc/X11/xorg.conf.d/40-proper-touchpad.conf
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
pkgs="i3 i3lock i3status pulseaudio-devel brightnessctl xss-lock dex maim dmenu gnome-keyring feh picom"
|
||||
|
||||
super_apply() {
|
||||
xbps-install -y $pkgs
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
xbps-remove -y $pkgs
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
Section "InputClass"
|
||||
Identifier "libinput touchpad catchall"
|
||||
MatchIsTouchpad "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
Option "NaturalScrolling" "True"
|
||||
Option "Tapping" "on"
|
||||
EndSection
|
|
@ -1,206 +0,0 @@
|
|||
#######################
|
||||
## Raine's i3 config ##
|
||||
## Mar 22, 2023 ##
|
||||
## mutation: 1m ##
|
||||
#######################
|
||||
|
||||
## Mostly similar to i3's config yet differs
|
||||
|
||||
# Useful variables:
|
||||
# This section probably gets changed a lot
|
||||
# ---
|
||||
set $terminal alacritty
|
||||
set $screen_lock i3lock -c "#111111" --nofork
|
||||
set $appmenu i3-dmenu-desktop
|
||||
|
||||
set $screenshot maim -s | xclip -selection clipboard -t image/png
|
||||
|
||||
set $font pango:monospace 8
|
||||
|
||||
# Startup Applications:
|
||||
# Things that will startup when starting i3.
|
||||
# ---
|
||||
exec_always --no-startup-id dex --autostart --environment i3
|
||||
exec_always --no-startup-id nm-applet
|
||||
exec_always --no-startup-id xss-lock --transfer-sleep-lock -- $screen_lock
|
||||
exec_always --no-startup-id gnome-keyring-daemon --start --components=ssh,secrets,pkcs11
|
||||
exec_always --no-startup-id feh --bg-fill ~/Pictures/wallpaper.jpg
|
||||
exec_always --no-startup-id picom
|
||||
|
||||
# Gaps & Borders:
|
||||
# ---
|
||||
gaps inner 10
|
||||
smart_gaps on
|
||||
|
||||
default_border pixel 1
|
||||
hide_edge_borders smart_no_gaps
|
||||
|
||||
# Extra variables:
|
||||
# Only need changing for very specific installations.
|
||||
# ---
|
||||
set $audio_volume_up XF86AudioRaiseVolume
|
||||
set $audio_volume_down XF86AudioLowerVolume
|
||||
set $audio_mute XF86AudioMute
|
||||
set $audio_mute_mic XF86AudioMicMute
|
||||
|
||||
set $brightness_up XF86MonBrightnessUp
|
||||
set $brightness_down XF86MonBrightnessDown
|
||||
|
||||
set $ws_1 "1:main"
|
||||
set $ws_2 "2:term"
|
||||
set $ws_3 "3:docs"
|
||||
set $ws_4 "4:mail"
|
||||
set $ws_5 "5"
|
||||
set $ws_6 "6"
|
||||
set $ws_7 "7"
|
||||
set $ws_8 "8"
|
||||
set $ws_9 "9:bg"
|
||||
set $ws_10 "10:misc"
|
||||
|
||||
set $meta_refresh_statusbar killall -SIGUSR1 i3status
|
||||
bar {
|
||||
strip_workspace_numbers yes
|
||||
status_command i3status
|
||||
}
|
||||
|
||||
# END OF CONFIG
|
||||
|
||||
set $mod Mod4
|
||||
set $alt Mod1
|
||||
|
||||
# Customization
|
||||
|
||||
# class border backgr. text indic. child_border
|
||||
client.focused #81A1C1 #81A1C1 #ffffff #D8DEE9
|
||||
client.focused_inactive #2E3440 #2E3440 #88C0D0 #454948
|
||||
client.unfocused #2E3440 #2E3440 #88C0D0 #454948
|
||||
client.urgent #D08770 #3B4252 #ffffff #268BD2
|
||||
client.placeholder #000000 #0c0c0c #ffffff #000000
|
||||
client.background #3B4252
|
||||
|
||||
# Generic
|
||||
floating_modifier $mod
|
||||
tiling_drag modifier titlebar
|
||||
font $font
|
||||
|
||||
# Open a terminal
|
||||
bindsym $mod+Return exec $terminal
|
||||
|
||||
# Kill current window
|
||||
bindsym $mod+$alt+q kill
|
||||
|
||||
# Open app menu
|
||||
bindsym $mod+d exec --no-startup-id $appmenu
|
||||
|
||||
# Lock screen
|
||||
bindsym $mod+l exec --no-startup-id $screen_lock
|
||||
|
||||
# Screenshots
|
||||
bindsym Print exec --no-startup-id $screenshot
|
||||
|
||||
# Audio
|
||||
bindsym $audio_volume_up exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $meta_refresh_statusbar
|
||||
bindsym $audio_volume_down exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $meta_refresh_statusbar
|
||||
bindsym $audio_mute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $meta_refresh_statusbar
|
||||
bindsym $audio_mute_mic exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $meta_refresh_statusbar
|
||||
|
||||
# Brightness
|
||||
bindsym $brightness_up exec --no-startup-id brightnessctl set +5% && $meta_refresh_statusbar
|
||||
bindsym $brightness_down exec --no-startup-id brightnessctl set 5%- && $meta_refresh_statusbar
|
||||
|
||||
# Change focused window
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move focused window
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Right move right
|
||||
|
||||
# Splits
|
||||
bindsym $mod+Shift+h split h
|
||||
bindsym $mod+Shift+v split v
|
||||
|
||||
# Change container layout
|
||||
bindsym $mod+Shift+s layout stacking
|
||||
bindsym $mod+Shift+t layout tabbed
|
||||
bindsym $mod+Shift+d layout toggle split
|
||||
|
||||
# Make current window fullscreen
|
||||
bindsym $mod+Shift+f fullscreen toggle
|
||||
|
||||
# Floating stuff
|
||||
bindsym $mod+space focus mode_toggle
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
bindsym $mod+minus scratchpad show
|
||||
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace $ws_1
|
||||
bindsym $mod+2 workspace $ws_2
|
||||
bindsym $mod+3 workspace $ws_3
|
||||
bindsym $mod+4 workspace $ws_4
|
||||
bindsym $mod+5 workspace $ws_5
|
||||
bindsym $mod+6 workspace $ws_6
|
||||
bindsym $mod+7 workspace $ws_7
|
||||
bindsym $mod+8 workspace $ws_8
|
||||
bindsym $mod+9 workspace $ws_9
|
||||
bindsym $mod+0 workspace $ws_10
|
||||
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace $ws_1
|
||||
bindsym $mod+Shift+2 move container to workspace $ws_2
|
||||
bindsym $mod+Shift+3 move container to workspace $ws_3
|
||||
bindsym $mod+Shift+4 move container to workspace $ws_4
|
||||
bindsym $mod+Shift+5 move container to workspace $ws_5
|
||||
bindsym $mod+Shift+6 move container to workspace $ws_6
|
||||
bindsym $mod+Shift+7 move container to workspace $ws_7
|
||||
bindsym $mod+Shift+8 move container to workspace $ws_8
|
||||
bindsym $mod+Shift+9 move container to workspace $ws_9
|
||||
bindsym $mod+Shift+0 move container to workspace $ws_10
|
||||
|
||||
# Move through workspaces
|
||||
bindsym $mod+$alt+Left workspace prev
|
||||
bindsym $mod+$alt+Right workspace next
|
||||
|
||||
# WM stuff
|
||||
# reload i3 config
|
||||
bindsym $mod+$alt+c reload
|
||||
# restart i3
|
||||
bindsym $mod+$alt+r restart
|
||||
# exit i3
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Exit i3?' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||
|
||||
# Modes
|
||||
bindsym $mod+r mode resize
|
||||
mode "resize" {
|
||||
bindsym $nav_left resize shrink width 10 px or 10 ppt
|
||||
bindsym $nav_down resize grow height 10 px or 10 ppt
|
||||
bindsym $nav_up resize shrink height 10 px or 10 ppt
|
||||
bindsym $nav_right resize grow width 10 px or 10 ppt
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
bindsym Down resize grow height 10 px or 10 ppt
|
||||
bindsym Up resize shrink height 10 px or 10 ppt
|
||||
bindsym Right resize grow width 10 px or 10 ppt
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+r mode "default"
|
||||
}
|
||||
|
||||
bindsym $mod+s mode "session"
|
||||
mode "session" {
|
||||
bindsym l exec --no-startup-id $lock, mode "default"
|
||||
bindsym e exec --no-startup-id i3-msg exit, mode "default"
|
||||
bindsym Shift+r exec --no-startup-id systemctl reboot, mode "default"
|
||||
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
bindsym $mod+s mode "default"
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
inactive-opacity = 0.75;
|
||||
|
||||
blur: {
|
||||
method = "box";
|
||||
size = 10;
|
||||
background = false;
|
||||
background-frame = false;
|
||||
background-fixed = false;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
general {
|
||||
output_format = "i3bar"
|
||||
colors = true
|
||||
interval = 5
|
||||
}
|
||||
|
||||
order += "ipv6"
|
||||
order += "wireless wlp58s0"
|
||||
order += "battery 0"
|
||||
order += "disk /"
|
||||
order += "memory"
|
||||
order += "load"
|
||||
order += "tztime local"
|
||||
|
||||
wireless wlp58s0 {
|
||||
format_up = "W: (%quality at %essid, %bitrate) %ip"
|
||||
format_down = "W: down"
|
||||
}
|
||||
|
||||
battery 0 {
|
||||
format = "%status %percentage %remaining %emptytime"
|
||||
format_down = "No battery"
|
||||
status_chr = "⚡ CHR"
|
||||
status_bat = "🔋 BAT"
|
||||
status_unk = "? UNK"
|
||||
status_full = "☻ FULL"
|
||||
path = "/sys/class/power_supply/BAT%d/uevent"
|
||||
low_threshold = 10
|
||||
}
|
||||
|
||||
tztime local {
|
||||
format = "%Y-%m-%d %H:%M:%S"
|
||||
hide_if_equals_localtime = false
|
||||
}
|
||||
|
||||
tztime berlin {
|
||||
format = "%Y-%m-%d %H:%M:%S %Z"
|
||||
timezone = "Europe/Berlin"
|
||||
}
|
||||
|
||||
load {
|
||||
format = "%5min"
|
||||
}
|
||||
|
||||
memory {
|
||||
format = "%used"
|
||||
threshold_degraded = "10%"
|
||||
format_degraded = "MEMORY: %free"
|
||||
}
|
||||
|
||||
disk "/" {
|
||||
format = "%free"
|
||||
}
|
||||
|
||||
read_file uptime {
|
||||
path = "/proc/uptime"
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
pacman -S --needed --noconfirm zsh
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
pacman -R --noconfirm zsh
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
apt install -y zsh
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
pacman -R --noconfirm zsh
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Install zsh and oh-my-zsh!"
|
||||
scripts="@distro @self"
|
||||
|
||||
super_apply() {
|
||||
usermod $USER --shell /bin/zsh
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
usermod $USER --shell /bin/bash
|
||||
}
|
||||
|
||||
apply() {
|
||||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
[ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-autosuggestions $PL_DIR
|
||||
PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
[ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $PL_DIR
|
||||
fi
|
||||
|
||||
[ -f "$HOME/.zshrc" ] && unlink $HOME/.zshrc
|
||||
[ -e "$HOME/.zshrc" ] || ln files/.zshrc $HOME/.zshrc
|
||||
}
|
||||
|
||||
undo() {
|
||||
unlink $HOME/.zshrc
|
||||
rm -rf $HOME/.oh-my-zsh
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
super_apply() {
|
||||
xbps-install -y zsh
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
xbps-remove -y zsh
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#!/bin/zsh
|
||||
|
||||
# Raine's .zshrc
|
||||
|
||||
if [ "$PROFILEINC" = "1" ]; then
|
||||
. ~/.profile
|
||||
fi
|
||||
|
||||
export EDITOR=vim
|
||||
export GPG_TTY=$(tty)
|
||||
export PATH="$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$HOME/.local/bin"
|
||||
|
||||
# oh-my-zsh init
|
||||
if [ -f "$HOME/.oh-my-zsh/oh-my-zsh.sh" ]; then
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
ZSH_THEME="afowler"
|
||||
plugins=(git docker docker-compose node zsh-autosuggestions zsh-syntax-highlighting zsh-cargo-completion)
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
else
|
||||
echo "oh-my-zsh not detected :("
|
||||
PS1="$(whoami)@${HOSTNAME:-$(hostname)} $ "
|
||||
fi
|
||||
|
||||
update_dotfiles() {
|
||||
cd $HOME/.dotfiles
|
||||
git pull
|
||||
cd - &> /dev/null
|
||||
}
|
||||
|
||||
share_cdn() {
|
||||
if ! [ -f "$1" ]; then
|
||||
echo "file needs to exist"
|
||||
return 1
|
||||
fi
|
||||
scp $1 keymaker:/usr/share/cdn/random/$2 > /dev/null
|
||||
echo "https://cdn.ixvd.net/random/${2:-$(basename $1)}"
|
||||
}
|
||||
|
||||
container() {
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
--name tmp-$(id -u)-$(openssl rand -hex 8) \
|
||||
--network ${CONTAINER_NETWORK:-internal} \
|
||||
alpine \
|
||||
ash
|
||||
}
|
||||
|
||||
[ -f "$HOME/.config/i3/shortcuts-i3.sh" ] && . ~/.config/i3/shortcuts-i3.sh
|
||||
|
||||
alias q="exit"
|
||||
alias vim="nvim"
|
||||
alias vi="nvim"
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
pacman -S --needed --noconfirm neovim
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
echo "we never uninstall vim -_-"
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
apt install -y neovim
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
echo "we never uninstall vim -_-"
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Install vim and it's stuff"
|
||||
scripts="@distro @self"
|
||||
|
||||
apply() {
|
||||
[ -d "$HOME/.config/nvim" ] || mkdir -p "$HOME/.config/nvim"
|
||||
[ -e "$HOME/.config/nvim/init.vim" ] || ln files/init.vim $HOME/.config/nvim/init.vim
|
||||
[ -e "$HOME/.ideavimrc" ] || ln files/.ideavimrc $HOME/.ideavimrc
|
||||
}
|
||||
|
||||
undo() {
|
||||
unlink $HOME/.config/nvim/init.vim
|
||||
unlink $HOME/.ideavimrc
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
xbps-install -y neovim
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
echo "we never uninstall vim -_-"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
source ~/.vimrc
|
||||
|
||||
set scrolloff=5
|
||||
set incsearch
|
||||
|
||||
map Q gq
|
||||
|
||||
Plug 'machakann/vim-highlightedyank'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'wellle/targets.vim'
|
|
@ -1,27 +0,0 @@
|
|||
" vim preferences
|
||||
set number
|
||||
set relativenumber
|
||||
syntax on
|
||||
|
||||
" No arrow keys
|
||||
noremap <Up> <Nop>
|
||||
noremap <Down> <Nop>
|
||||
noremap <Left> <Nop>
|
||||
noremap <Right> <Nop>
|
||||
|
||||
" ensure vim-plug
|
||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
||||
if empty(glob(data_dir . '/autoload/plug.vim'))
|
||||
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||
endif
|
||||
|
||||
call plug#begin()
|
||||
|
||||
Plug 'ThePrimeagen/vim-be-good'
|
||||
Plug 'machakann/vim-highlightedyank'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'wellle/targets.vim'
|
||||
Plug 'vim-scripts/loremipsum'
|
||||
|
||||
call plug#end()
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
pacman -S --needed --noconfirm alacritty
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
pacman -R --noconfirm alacritty
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Installs alacritty and configs"
|
||||
scripts="@distro @self"
|
||||
|
||||
apply() {
|
||||
[ -d "$HOME/.config/alacritty" ] || mkdir -p $HOME/.config/alacritty
|
||||
[ -e "$HOME/.config/alacritty/alacritty.yml" ] || ln files/alacritty.yml $HOME/.config/alacritty/alacritty.yml
|
||||
}
|
||||
|
||||
undo() {
|
||||
unlink $HOME/.config/alacritty/alacritty.yml
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
super_apply() {
|
||||
xbps-install -y alacritty
|
||||
}
|
||||
|
||||
super_undo() {
|
||||
xbps-remove -y alacritty
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
cursor:
|
||||
style:
|
||||
shape: 'Block'
|
||||
blinking: 'On'
|
||||
blink_interval: 500
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Setup git"
|
||||
scripts="@distro @self"
|
||||
|
||||
apply() {
|
||||
git config --global user.name Raine
|
||||
git config --global user.email raine@ixvd.net
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
apply() {
|
||||
echo "------------ WARNING ------------"
|
||||
echo "BACKUPS ARE NOT SETUP ON DEBIAN! "
|
||||
echo " PLEASE SETUP MANUALLY "
|
||||
echo "---------------------------------"
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
describe="Setup restic backups"
|
||||
scripts="@distro" # only distro
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
log() {
|
||||
echo "log: $@"
|
||||
if [ -f "/var/backups/ntfy.env" ]; then
|
||||
. /var/backups/ntfy.env
|
||||
curl \
|
||||
-s \
|
||||
-d "$@" \
|
||||
${NTFY_URL:-https://push.ixvd.net/logs}
|
||||
fi
|
||||
}
|
||||
|
||||
log starting backup for $HOSTNAME
|
||||
restic \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret \
|
||||
backup \
|
||||
--tag auto \
|
||||
--exclude-caches \
|
||||
--exclude dist \
|
||||
--exclude target \
|
||||
--exclude node_modules \
|
||||
--exclude bin \
|
||||
--exclude .cache \
|
||||
--exclude '.config/*/cache' \
|
||||
--exclude '.config/*/Cache' \
|
||||
--exclude .cargo/git \
|
||||
--exclude .cargo/registry \
|
||||
--exclude '.rustup' \
|
||||
--exclude '.local' \
|
||||
--exclude '.var' \
|
||||
--exclude Steam \
|
||||
--exclude '.config/Code' \
|
||||
--exclude '.config/Code - OSS' \
|
||||
--exclude 'code/linux' \
|
||||
--exclude Downloads \
|
||||
/srv /home /etc
|
||||
log backup finished with $?
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
[ -d "/var/backups" ] || mkdir -p /var/backups
|
||||
[ -f "/var/backups/$HOSTNAME.secret" ] || openssl rand -hex 64 > /var/backups/$HOSTNAME.secret
|
||||
|
||||
restic init \
|
||||
-r /var/backups/$HOSTNAME \
|
||||
-p /var/backups/$HOSTNAME.secret
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sync backup to *the* external
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
|
||||
set -e
|
||||
|
||||
rsync \
|
||||
--info=progress2 \
|
||||
-avzylu \
|
0
crates/example/.invalid
Normal file
0
crates/example/.invalid
Normal file
0
crates/example/apply.sh
Normal file
0
crates/example/apply.sh
Normal file
0
crates/example/remove.sh
Normal file
0
crates/example/remove.sh
Normal file
9
crates/ssh/apply.sh
Normal file
9
crates/ssh/apply.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "pulling ssh key..."
|
||||
scp \
|
||||
strix@hydrogen.red.helix.saluco.nl:.ssh/config \
|
||||
strix@hydrogen.red.helix.saluco.nl:.ssh/authorized_keys \
|
||||
strix@hydrogen.red.helix.saluco.nl:.ssh/id_rsa \
|
||||
strix@hydrogen.red.helix.saluco.nl:.ssh/id_rsa.pub \
|
||||
~/.ssh
|
3
crates/ssh/remove.sh
Normal file
3
crates/ssh/remove.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf ~/.ssh
|
2
crates/tlp/apply.sh
Normal file
2
crates/tlp/apply.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
|
97
dot
97
dot
|
@ -1,97 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
ask=0
|
||||
|
||||
is_function() {
|
||||
type "$1" 2> /dev/null | sed "s/$1//" | grep -qwi function
|
||||
}
|
||||
|
||||
curr_distro() {
|
||||
cat /etc/os-release | grep -G "^ID=" | sed 's/ID=//'
|
||||
}
|
||||
|
||||
include() {
|
||||
[ -f "$1" ] || return 1
|
||||
. $1
|
||||
return 0
|
||||
}
|
||||
|
||||
func() {
|
||||
if is_function $(echo "super_$2"); then
|
||||
[ "${DO_SUDO:-yes}" = "yes" ] || return 0
|
||||
ecmd=". $1 && super_$2"
|
||||
[ "$(id -u)" = "0" ] && sh -c "$ecmd" || sudo sh -c "$ecmd"
|
||||
unset ecmd
|
||||
fi
|
||||
is_function $2 && $2
|
||||
}
|
||||
|
||||
get_command() {
|
||||
case $1 in
|
||||
a*)
|
||||
printf "apply"
|
||||
;;
|
||||
u*)
|
||||
printf "undo"
|
||||
;;
|
||||
*)
|
||||
echo "err: not supported" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# only run this *in crate dir*
|
||||
run_crate() {
|
||||
enabled=1
|
||||
include ./crate.sh || exit 1
|
||||
if [ -n "$describe" ]; then
|
||||
echo "desc($(basename $PWD)): $describe"
|
||||
fi
|
||||
if [ $enabled -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
cmd=$(get_command $1)
|
||||
scripts=${scripts:-"@self @distro"}
|
||||
for s in $scripts; do
|
||||
echo "exec($(basename $PWD)): $s/$cmd"
|
||||
case $s in
|
||||
@self)
|
||||
func ./crate.sh $cmd
|
||||
;;
|
||||
@distro)
|
||||
unset -f super_$cmd
|
||||
unset -f $cmd
|
||||
include ./crate.$(curr_distro).sh
|
||||
func ./crate.$(curr_distro).sh $cmd
|
||||
unset -f super_$cmd
|
||||
unset -f $cmd
|
||||
include ./crate.sh
|
||||
;;
|
||||
*)
|
||||
sh $s
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
echo "# details:"
|
||||
echo "# user: $USER (${UID:-$(id -u)})"
|
||||
echo "# groups: $(groups)"
|
||||
echo "# distro: $(curr_distro)"
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
[ -d crates/*$1 ] || exit 1
|
||||
cd crates/*$1
|
||||
run_crate $2
|
||||
cd ../..
|
||||
else
|
||||
[ $# -eq 0 ] && exit 2
|
||||
for crate in $(find ./crates -mindepth 1 -maxdepth 1 -type d | sort); do
|
||||
cd $crate
|
||||
run_crate $1
|
||||
cd ../..
|
||||
done
|
||||
fi
|
||||
|
||||
|
79
lib/crates.sh
Normal file
79
lib/crates.sh
Normal file
|
@ -0,0 +1,79 @@
|
|||
#!/bin/sh
|
||||
|
||||
DF_CRATE_STRICT=${DF_CRATE_STRICT:-0}
|
||||
|
||||
# crate_validate <crate> <exit_on_invalid>
|
||||
# example:
|
||||
# crate_validate $1 1
|
||||
# crate_validate $1 0 || return 1
|
||||
crate_validate() {
|
||||
a=$DF_RUNNER_VERBOSE
|
||||
DF_RUNNER_VERBOSE=
|
||||
err=0
|
||||
[ -d "crates/$1" ] || err=1
|
||||
[ -f "crates/$1/apply.sh" ] || err=1
|
||||
[ -f "crates/$1/.invalid" ] && err=1
|
||||
if [ $err = 1 ]; then
|
||||
if [ "${2:-$DF_CRATE_STRICT}" = "1" ]; then
|
||||
echo "$1 is an invalid crate"
|
||||
exit 1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
DF_RUNNER_VERBOSE=$a
|
||||
}
|
||||
|
||||
in_crate() {
|
||||
crate=$1
|
||||
crate_validate $1 0 || return 1
|
||||
shift
|
||||
DF_RUNNER_WORKDIR="$(pwd)/crates/$crate" ./runner $@
|
||||
}
|
||||
|
||||
crate_applied() {
|
||||
crate_validate $1 0 || return 1
|
||||
in_crate "$1" [ -f ".installed" ]
|
||||
}
|
||||
|
||||
crate_has_root_apply() {
|
||||
crate_validate $1 0 || return 1
|
||||
in_crate "$1" [ -f "apply_root.sh" ]
|
||||
}
|
||||
|
||||
crate_has_root_remove() {
|
||||
crate_validate $1 0 || return 1
|
||||
in_crate "$1" [ -f "remove_root.sh" ]
|
||||
}
|
||||
|
||||
crate_removable() {
|
||||
crate_validate $1 0 || return 1
|
||||
in_crate "$1" [ -f "remove.sh" ]
|
||||
}
|
||||
|
||||
crate_info() {
|
||||
if ! crate_validate $1 0; then
|
||||
printf "%s " "!"
|
||||
else
|
||||
if crate_applied $1; then
|
||||
if crate_removable $1; then
|
||||
printf "%s " "+"
|
||||
else
|
||||
printf "%s " "*"
|
||||
fi
|
||||
else
|
||||
printf "%s " "-"
|
||||
fi
|
||||
fi
|
||||
printf "%s " $1
|
||||
crate_removable $1 && printf "[removable] "
|
||||
crate_has_root_apply $1 && printf "[has root apply] "
|
||||
crate_has_root_remove $1 && printf "[has root remove] "
|
||||
printf "\n"
|
||||
}
|
||||
|
||||
crate_apply() {
|
||||
crate_validate $1 1
|
||||
echo "applying crates/$1..."
|
||||
in_crate $1 sh apply.sh
|
||||
}
|
26
main
Executable file
26
main
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
. lib/crates.sh
|
||||
|
||||
cmd=$1
|
||||
if [ -z "$cmd" ]; then
|
||||
exit 1
|
||||
else
|
||||
shift
|
||||
fi
|
||||
|
||||
case $cmd in
|
||||
apply-crates) crate_apply $@ ;;
|
||||
remove-crate)
|
||||
if crate_removable $1; then
|
||||
crate_remove $1
|
||||
else
|
||||
echo "crate can't be removed"
|
||||
fi
|
||||
;;
|
||||
list-crates)
|
||||
for c in ${@:-$(ls crates)}; do
|
||||
crate_info $c
|
||||
done
|
||||
;;
|
||||
esac
|
|
@ -3,12 +3,12 @@
|
|||
# this script is meant to be ran when .dotfiles is not present.
|
||||
#
|
||||
# example:
|
||||
# curl https://git.ixvd.net/raine/dotfiles/raw/branch/main/remote_script.sh | sh
|
||||
# curl https://git.saluco.net/strix/dotfiles/raw/branch/main/remote_script.sh | sh
|
||||
|
||||
set -e
|
||||
|
||||
HOME=${HOME:-/home/${USER:-$(whomai)}}
|
||||
|
||||
[ -d "$HOME/.dotfiles" ] || git clone https://git.ixvd.net/raine/dotfiles $HOME/.dotfiles
|
||||
[ -d "$HOME/.dotfiles" ] || git clone https://git.saluco.net/strix/dotfiles $HOME/.dotfiles
|
||||
cd $HOME/.dotfiles
|
||||
./dot a
|
||||
|
|
29
runner
Executable file
29
runner
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# DF_SRC_ROOT: dotfiles source root
|
||||
# DF_RUNNER_WORKDIR: runner workdir
|
||||
# DF_RUNNER_LIBS: libs to include in runner
|
||||
# DF_RUNNER_VERBOSE: verbosity runner
|
||||
|
||||
|
||||
if [ -n "$DF_RUNNER_WORKDIR" ]; then
|
||||
[ $DF_RUNNER_VERBOSE ] && echo "workdir: $DF_RUNNER_WORKDIR"
|
||||
DF_SRC_ROOT=${DF_SRC_ROOT:-$(pwd)}
|
||||
cd $DF_RUNNER_WORKDIR
|
||||
fi
|
||||
|
||||
for lib in ${DF_RUNNER_LIBS:-}; do
|
||||
if [ -n "$DF_SRC_ROOT" ]; then
|
||||
oldpwd=$(pwd)
|
||||
cd $DF_SRC_ROOT
|
||||
fi
|
||||
[ $DF_RUNNER_VERBOSE ] && echo "include: lib/$lib.sh"
|
||||
. lib/$lib.sh
|
||||
if [ -n "$DF_SRC_ROOT" ]; then
|
||||
cd $oldpwd
|
||||
fi
|
||||
done
|
||||
|
||||
[ $DF_RUNNER_VERBOSE ] && echo "command: $@"
|
||||
|
||||
$@
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Downloading newest package..."
|
||||
curl -Lo /tmp/discord.deb "https://discord.com/api/download?platform=linux&format=deb"
|
||||
cd /tmp
|
||||
echo "Extracting package..."
|
||||
xdeb discord.deb
|
||||
echo "Installing package..."
|
||||
sudo xbps-install -R /tmp/binpkgs discord
|
||||
rm -rf /tmp/binpkgs
|
||||
cd -
|
Loading…
Reference in a new issue