From bd9506a9be9f26988ee4398325023fed05cca73a Mon Sep 17 00:00:00 2001 From: Karol Krzosa Date: Wed, 17 Jun 2026 22:13:50 +0200 Subject: [PATCH] setup.sh and installing on new system --- .config/install_the_dotfiles.sh | 53 --------------------- .config/sway/config | 3 +- bin/command-list | 5 +- install_the_dotfiles.sh | 81 +++++++++++++++++++++++++++++++++ setup.sh | 11 +++++ 5 files changed, 95 insertions(+), 58 deletions(-) delete mode 100644 .config/install_the_dotfiles.sh create mode 100644 install_the_dotfiles.sh create mode 100644 setup.sh diff --git a/.config/install_the_dotfiles.sh b/.config/install_the_dotfiles.sh deleted file mode 100644 index 3cccf5a..0000000 --- a/.config/install_the_dotfiles.sh +++ /dev/null @@ -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 - diff --git a/.config/sway/config b/.config/sway/config index adb4d09..8266b15 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -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 diff --git a/bin/command-list b/bin/command-list index 944640c..6ccdef0 100755 --- a/bin/command-list +++ b/bin/command-list @@ -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": diff --git a/install_the_dotfiles.sh b/install_the_dotfiles.sh new file mode 100644 index 0000000..d1ca25b --- /dev/null +++ b/install_the_dotfiles.sh @@ -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 diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..69778e6 --- /dev/null +++ b/setup.sh @@ -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/.