setup.sh and installing on new system

This commit is contained in:
Karol Krzosa
2026-06-17 22:13:50 +02:00
parent 466220c7aa
commit bd9506a9be
5 changed files with 95 additions and 58 deletions

View File

@@ -1,53 +0,0 @@
# TODO:
# - [ ] Mount /krk-pc on startup
# - [ ] Add server SSH keys and PC ssh keys
# - [ ] Mount /proton on startup
# - [x] Hibernate if not using PC for 10 minutes
#
# - [ ] Combine apps + bin + bookmarks
# - [x] everything relevant wmenu browser (programs and scripts without arguments, bookmarks, files)
# - [x] plocate + wmenu > xdg-open
# - [x] applications + bin folder
# - [x] bookmarks
#
# - [x] fzf starship zoxide eza bat (only fzf seems descent)
#
# Solutions in search for problems:
# - [ ] tmux automation
#
# Setup sudo for user
su root
export PATH="$PATH:/usr/sbin"
apt install sudo
usermod -aG sudo kk
exit # exit root
exit # exit user to reload config
# Basic utilities
sudo apt install clang cmake build-essential make tcc vim ripgrep curl git man-db plocate tmux zip unzip fzf
sudo updatedb
# Standard enviroment setup
sudo apt install xdg-desktop-portal-wlr xdg-desktop-portal-gtk xdg-user-dirs
# DE setup
sudo apt install sway swayidle swaybg swaylock foot wmenu brightnessctl
# Clipboard and history
sudo apt install wl-clipboard cliphist
# Issue fix
# there were issues because user was not in render group (error messages on start of sway)
sudo usermod -aG render kk
# Setup audio
sudo apt install pipewire pipewire-pulse wireplumber pavucontrol
sudo apt install sshfs
# Setup internet
# sudo apt install w3m surfraw
sudo apt install chromium

View File

@@ -48,8 +48,7 @@ include /etc/sway/config-vars.d/*
#
exec swayidle -w \
timeout 300 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
timeout 600 'systemctl hibernate' \
before-sleep 'swaylock -f -c 000000'
timeout 600 'systemctl hibernate'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when

View File

@@ -1,7 +1,6 @@
#!/usr/bin/python3
import os, subprocess, json
def readfile(path):
fd = open(path, "r")
result = fd.read()
@@ -34,7 +33,7 @@ for appdir in appsdir:
_exec = line[5:]
elif line.startswith("Type="):
_type = line[5:]
elif line.startswith("Name="):
elif line.startswith("Name=") and _name is None:
_name = line[5:]
elif line.startswith("NoDisplay="):
_nodisplay = line[10:]
@@ -49,6 +48,7 @@ for appdir in appsdir:
if _nodisplay == "true" or _hidden == "true":
continue
vals[_name] = {"kind": "app", "exec": _exec, "path": path}
@@ -94,7 +94,6 @@ if result.returncode != 0:
choice = result.stdout.strip()
val = vals[choice]
if val["kind"] == "bin":
subprocess.run([val["path"]])
elif val["kind"] == "app":

81
install_the_dotfiles.sh Normal file
View File

@@ -0,0 +1,81 @@
# TODO:
# - [x] Mount /krk-pc on startup
# - [x] Add server SSH keys and PC ssh keys
# - [ ] Mount /proton on startup
# - [x] Hibernate if not using PC for 10 minutes
#
# - [ ] Mount /lenovo-laptop
# - [ ] Mount server /server-vps
#
# - [ ] Combine apps + bin + bookmarks
# - [ ] Use .desktop file name instead of "Name" parameter
# - [x] everything relevant wmenu browser (programs and scripts without arguments, bookmarks, files)
# - [x] plocate + wmenu > xdg-open
# - [x] applications + bin folder
# - [x] bookmarks
#
# - [ ] Kakoune setup
#
# Solutions in search for problems:
# - [ ] tmux automation
#
## Setup sudo for user
# su root
# export PATH="$PATH:/usr/sbin"
# apt install sudo git
# usermod -aG sudo kk
# exit # exit root
# exit # exit user to reload config
## Basic utilities
# sudo apt install -y clang cmake build-essential make tcc vim ripgrep curl git man-db plocate tmux zip unzip fzf
# sudo updatedb
## Update grub to not wait on bootloader screen @todo: automate
# sudo vi /etc/default/grub
# GRUB_TIMEOUT=0
# GRIM_TIMEOUT_STYLE=hidden
## Drivers
## Need to update /etc/apt/sources.list (add contrib non-free non-free-firmware) @todo: automate
# sudo apt update
# sudo apt install -y nvidia-driver firmware-misc-nonfree linux-headers-amd64
## Then do some nvidia configuration (set modeset=1, update ramfs, reboot)
# # Standard enviroment setup
# sudo apt install -y xdg-desktop-portal-wlr xdg-desktop-portal-gtk xdg-user-dirs
# # DE setup
# sudo apt install -y sway swayidle swaybg swaylock foot wmenu brightnessctl xwayland wl-clipboard
# # Issue fix
# # there were issues because user was not in render group (error messages on start of sway)
# sudo usermod -aG video,render kk
# # Setup audio
# sudo apt install -y pipewire pipewire-pulse wireplumber pavucontrol
## Copy over ssh keys to relevant machines @user_action
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""
## Setup ssh drives
# sudo apt install -y sshfs
## Mount the drives using /etc/fstab automatically
## Example:
##
## root@157.90.144.237:/ /server-vps fuse.sshfs noauto,x-systemd.automount,_netdev,x-systemd.idle-timeout=2min,x-systemd.mount-timeout=10s,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/home/kk/.ssh/id_ed25519,UserKnownHostsFile=/home/kk/.ssh/known_hosts,StrictHostKeyChecking=accept-new,allow_other,default_permissions 0 0
#
# # Setup internet
# # sudo apt install w3m surfraw
# sudo apt install chromium
# Extra
## Clipboard history
# sudo apt install cliphist

11
setup.sh Normal file
View File

@@ -0,0 +1,11 @@
SRC=$HOME/.dotfilesrepo
rm $HOME/.bashrc
rm $HOME/.profile
ln -sf $SRC/.bashrc $HOME/.bashrc
ln -sf $SRC/.vimrc $HOME/.vimrc
ln -sf $SRC/.profile $HOME/.profile
ln -sf $SRC/.config $HOME/.config
ln -sf $SRC/bin $HOME/bin
mkdir -p $HOME/.local/share/fonts
cp $SRC/.local/share/fonts/* $HOME/.local/share/fonts/.