Configs for most of my software.
sudo pacman -Suy base-devel git
git clone --recursive https://github.com/petrikoz/dotfiles.git
cp -r $HOME/dotfiles/project PROJECT_PATH/PROJECT_NAME
cd PROJECT_PATH/PROJECT_NAME
mv editorconfig .editorconfig
mv flake8 .flake8
mv envrc .envrc && direnv allow
mv sublime-project $(basename $PWD).sublime-project
poetry install --no-root
git clone PROJECT_REPO src
# for ITCase's projects only:
mkdir itcase-dev
cd itcase-dev
git clone git@github.com:ITCase/itcase-common.git
pip install -e $PROJECT_ROOT/itcase-dev/itcase-common
This part contains instructions for install and config soft.
All soft separated in files by desktop / laptop and common / specific usage.
See $HOME/dotfiles/pacman/pkglist
directory:
- artix.txt — soft required for systems on Artix Linux
- common.txt — soft required for all systems
- common-aur.txt — soft required for all systems, but available only in AUR
- desktop.txt — soft required for desktop PC
- i3.txt — soft required for all systems with i3wm
- i3-laptop.txt — soft required for laptop with i3wm
- kde.txt — soft required for systmes with KDE
Add Universe repo:
sudo cat <<EOT >> /etc/pacman.conf
# Universe is a repository maintained by Artix package maintainers and
# contains some programs which are not provided in the 4 main
# repositories - mostly programs from the AUR
[universe]
Server = https://universe.artixlinux.org/\$arch
Server = https://mirror1.artixlinux.org/universe/\$arch
Server = https://mirror.pascalpuffke.de/artix-universe/\$arch
Server = https://artixlinux.qontinuum.space:4443/artixlinux/universe/os/\$arch
Server = https://mirror1.cl.netactuate.com/artix/universe/\$arch
EOT
After install artix-archlinux-support
package inable it:
sudo cat <<EOT >> pacman.conf
# Arch repositories from artix-archlinux-support
[extra]
Include = /etc/pacman.d/mirrorlist-arch
[community]
Include = /etc/pacman.d/mirrorlist-arch
#[multilib]
#Include = /etc/pacman.d/mirrorlist-arch
EOT
sudo pacman-key --populate archlinux
sudo pacman -Sy
Regular packages install with pacman
. Ex.:
sudo pacman -S - < $HOME/dotfiles/pacman/pkglist/common.txt
AUR-packages should clone with git and install with makepkg
. Ex.:
cd $HOME/Downloads
while read i; do
git clone "https://aur.archlinux.org/$i.git"
cd "$i"
makepkg -irs --noconfirm
cd ..
rm -rf "$i"
done < "$HOME/dotfiles/pacman/pkglist/common-aur.txt"
Actual only for Artix Linux. On systemd-based distros periodic TRIM run as default
sudo sh -c "(crontab -l ; echo '0 1 * * 5 /usr/bin/fstrim -av > /var/log/trim.log 2>&1') | sort - | uniq - | crontab -"
(crontab -l ; echo "0 11 * * 1,3,5,6 $HOME/dotfiles/cron/user/cloud-backup.sh > $HOME/dotfiles/cron/user/cloud-backup.log 2>&1") | sort - | uniq - | crontab -
ln -s $HOME/dotfiles/direnv $HOME/.config/
Run applications with security profiles:
# generate symlinks for default supported applications
sudo firecfg
# allow PulseAudio in jailed apps
firecfg --fix-audio
# add extra profiles
ln -s $HOME/dotfiles/firejail/profiles $HOME/.config/firejail
Run games with firejail
mkdir $HOME/games
firejail --profile=game "GAME-DIR-IN-games-LOCAL-DIR/start.sh"
# can use desktop entry for run game
mkdir -p $HOME/.local/share/applications
cp $HOME/dotfiles/firejail/game.desktop $HOME/.local/share/applications/GAME-NAME.desktop
vi $HOME/.local/share/applications/GAME-NAME.desktop
ln -s $HOME/dotfiles/gitconfig $HOME/.gitconfig
mkdir -p $HOME/go/bin $HOME/go/pkg $HOME/go/src
Hide GRUB unless the Shift key is held down:
sudo cat <<EOT >> /etc/default/grub
# Hide GRUB unless the Shift key is held down
GRUB_FORCE_HIDDEN_MENU="true"
EOT
sudo cp $HOME/dotfiles/grub/31_hold_shift /etc/grub.d/
sudo chmod a+x /etc/grub.d/31_hold_shift
sudo grub-mkconfig -o /boot/grub/grub.cfg
Directory $HOME/dotfiles/i3wm
contains configs for soft which used with i3wm.
ln -s $HOME/dotfiles/i3 $HOME/.i3
For enable blocks:
# lm_sensors
sudo sensors-detect --auto
# hddtemp
# for run only on localhost add in 'ExecStart': `-l 127.0.0.1`
sudo systemctl enable hddtemp.service
sudo systemctl start hddtemp.service
ln -s $HOME/dotfiles/conkyrc $HOME/.conkyrc
For more information see https://wiki.archlinux.org/index.php/Netctl
See network interfaces:
ip link
ln -s $HOME/dotfiles/i3/rofi $HOME/.config/
git clone https://aur.archlinux.org/st.git
cd st
cp config.def.h config.h
# move differences from `$HOME/dotfiles/st/config.h` to `config.h`
# then run:
makepkg -irs
ln -s $HOME/dotfiles/Xorg/xinitrc $HOME/.xinitrc
ln -s $HOME/dotfiles/Xorg/xserverrc $HOME/.xserverrc
ln -s $HOME/dotfiles/Xorg/xxkbrc $HOME/.xxkbrc
For two monitors add file /etc/X11/xorg.conf.d/10-monitor.conf
with content like this:
Section "Monitor"
Identifier "DVI-0"
Option "PreferredMode" "2560x1600"
Option "Primary" "true"
EndSection
Section "Monitor"
Identifier "HDMI-0"
Option "RightOf" "DVI-0"
EndSection
Mount encfs volumes with passwords from Kwallet:
echo '#!/bin/sh
kdeencfs="$HOME/dotfiles/kde/kdeencfs.sh"
$kdeencfs /path/of/encrypted/target /path/to/mount/point
' > $HOME/dotfiles/kde/autostart/kdeencfs
cp $HOME/dotfiles/kde/autostart/kdeencfs.desktop $HOME/.config/autostart/
Enable WireGuard-connection: copy needed config from cloud backup. Ex.:
sudo cp CLOUD-BACKUP-DIRECTORY/soft/NetworkManager/system-connections/petr-desktop-wg0.nmconnection /etc/NetworkManager/system-connections/wg0.nmconnection
sudo chmod -R 600 /etc/NetworkManager/system-connections/wg0.nmconnection
Add SSH's keys to SSH Agent on logon:
cp $HOME/dotfiles/kde/askpass.sh $HOME/.config/plasma-workspace/env/
echo '#!/bin/sh
/usr/bin/ssh-add -q /home/petr/.ssh/id_key1 /home/petr/.ssh/id_key2 < /dev/null
# if sshmnt installed on system uncomment bellow
#sshmnt -m cloud.wormhole
' > $HOME/dotfiles/kde/autostart/ssh-staff
chmod 700 $HOME/dotfiles/kde/autostart/ssh-staff
cp $HOME/dotfiles/kde/autostart/ssh-staff.desktop $HOME/.config/autostart/
mkdir -p $HOME/.config/mpv
ln -s $HOME/dotfiles/mpv/mpv.conf $HOME/.config/mpv/
# enable color output
sudo sed -i "/^#Color/c\Color" /etc/pacman.conf
# comparing versions before updating
sudo sed -i "/^#VerbosePkgLists/c\VerbosePkgLists" /etc/pacman.conf
# comparing versions before updating
sudo sed -i "/^#ParallelDownloads = 5/c\ParallelDownloads = 16" /etc/pacman.conf
# add hooks
sudo cp -r $HOME/dotfiles/pacman/hooks /etc/pacman.d/
Auto mount LUKS partition and tmpfs volume: edit part 'Volumes' in /etc/security/pam_mount.conf.xml
.
Example (replace all variables with <>
around):
<!-- LUKS -->
<volume user="<USERNAME>" fstype="crypt" path="/dev/disk/by-uuid/<UUID-OF-LUKS-PARTITION>" mountpoint="~" options="allow_discard,crypto_name=home-<USERNAME>,fsck" />
<!-- User's cache in memory -->
<volume user="<USERNAME>" fstype="tmpfs" path="tmpfs" mountpoint="~/.cache" options="size=1G,noexec,nodev,nosuid,uid=%(USER),gid=%(USER),mode=1700" />
Enable pam_mount
in login manager
sudo touch /etc/subuid /etc/subgid
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER
pip install --break-system-packages --user --upgrade --requirement=$HOME/dotfiles/pip-reqs.txt
Add config from cloud backup to $HOME/.config/rclone/
ln -s $HOME/dotfiles/sshmntconfig $HOME/.config/sshmntconfig
curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
sudo pacman -Syu sublime-text
mkdir -p $HOME/.config/sublime-text/Packages
git clone git@github.com:shiyanhui/FileHeader.git $HOME/.config/sublime-text/Packages/FileHeader
ln -sf $HOME/dotfiles/sublime-text $HOME/.config/sublime-text/Packages/User
sudo chattr +i $HOME/dotfiles/sublime-text/Markdown.sublime-settings
Allow 'wheel' group use sudo
:
sudo cp $HOME/dotfiles/sudo/g_wheel /etc/sudoers.d/
sudo cp $HOME/dotfiles/sysctl/99-sysctl.conf /etc/sysctl.d/
ln -s $HOME/dotfiles/tmux $HOME/.tmux
ln -s $HOME/.tmux/conf $HOME/.tmux.conf
ln -s $HOME/Nextcloud/todo $HOME/.todo
ln -s $HOME/dotfiles/vim $HOME/.vim
ln -s $HOME/.vim/rc $HOME/.vimrc
ln -s $HOME/dotfiles/zsh $HOME/.zsh
ln -s $HOME/.zsh/env $HOME/.zshenv
ln -s $HOME/.zsh/profile $HOME/.zprofile
ln -s $HOME/.zsh/rc $HOME/.zshrc
ln -s $HOME/.zsh/p10k.zsh $HOME/.p10k.zsh