diff --git a/README.md b/README.md index 9b91489..bbddfd8 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,12 @@ $EDITOR config ./base.sh ``` -If you want to install a gui (replace *gui* with your choice): +If you want to install a gui ```bash -$EDITOR gui/config +$EDITOR ./gui/config +./gui/install.sh + +$EDITOR ./gui/config ./gui/install.sh ``` diff --git a/config b/config index 9014f0d..18ec1a4 100644 --- a/config +++ b/config @@ -21,21 +21,29 @@ pkg=( fuse fzf git + gnu-netcat htop - man-{db,pages} + jq + linux{,lts,firmware} + lsof + man-{db,pages} tldr neofetch - neovim python-neovim - networkmanager - podman{,-docker} docker-compose + neovim{,-lspconfig,-nvim-treesitter} python-pynvim ripgrep tree-sitter-cli + networkmanager iptables-nft systemd-resolved wireguard-tools + p7zip unrar + podman{,-compose} ranger reflector + rename{,utils} + rsync terminus-font awesome-terminal-fonts tree udisks2 - xdg-user-dirs zsh ) laptop_pkg=( tlp ) + +# vim: ft=sh diff --git a/dotfiles.sh b/dotfiles.sh index f2ec319..cff5341 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -1,9 +1,11 @@ #!/bin/bash -e cd -NORMAL='\e[0m' -BOLD='\e[1m' -GREEN='\e[32m' +if [ -t 1 ]; then + NORMAL='\e[0m' + BOLD='\e[1m' + GREEN='\e[32m' +fi config="git --git-dir $HOME/.dotfiles --work-tree $HOME" repo='https://git.maby.dev/ange/.dotfiles.git' diff --git a/dwm/etc/udev/rules.d/backlight.rules b/dwm/etc/udev/rules.d/backlight.rules deleted file mode 100644 index 333af3c..0000000 --- a/dwm/etc/udev/rules.d/backlight.rules +++ /dev/null @@ -1 +0,0 @@ -ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod a+w $sys$devpath/brightness" diff --git a/dwm/config b/gui/config similarity index 55% rename from dwm/config rename to gui/config index 110c55a..5f80ac0 100644 --- a/dwm/config +++ b/gui/config @@ -1,20 +1,28 @@ -# User Variables -# Comment to disable - pkg=( alacritty dunst feh - firefox flameshot gammastep - i3lock xss-lock + imagemagick materia-{gtk-theme,kde} papirus-icon-theme gtk-engine-murrine mpv noto-fonts{,-cjk,-emoji} ttf-{dejavu,liberation} pcmanfm - picom pipewire{,-pulse,-jack} wireplumber pavucontrol playerctl polkit-gnome - xorg-{server,xinit,xrandr,xsetroot} xclip + xdg-user-dirs + yt-dlp + zenity ) + +flatpakpkg=( + com.valvesoftware.Steam + net.lutris.Lutris + org.getmonero.Monero + org.gimp.GIMP + org.mozilla.Thunderbird + org.mozilla.firefox +) + +# vim: ft=sh diff --git a/gui/dwm/config b/gui/dwm/config new file mode 100644 index 0000000..4ed5023 --- /dev/null +++ b/gui/dwm/config @@ -0,0 +1,11 @@ +# User Variables +# Comment to disable + +pkg=( + autorandr + i3lock xss-lock + picom + xorg-{server,xinit,xrandr,xsetroot} xclip +) + +# vim: ft=sh diff --git a/dwm/install.sh b/gui/dwm/install.sh similarity index 78% rename from dwm/install.sh rename to gui/dwm/install.sh index 90b8eac..99e583c 100755 --- a/dwm/install.sh +++ b/gui/dwm/install.sh @@ -2,9 +2,11 @@ cd "$(dirname "$0")" . ./config -NORMAL='\e[0m' -BOLD='\e[1m' -GREEN='\e[32m' +if [ -t 1 ]; then + NORMAL='\e[0m' + BOLD='\e[1m' + GREEN='\e[32m' +fi PACMAN='pacman --noconfirm --needed -Syu' @@ -27,10 +29,10 @@ case "$(lspci -k | grep -A3 -E '(VGA|3D)')" in esac $PACMAN "${pkg[@]}" -cp -rfT etc /etc +cp -rfT rootfs / -git clone https://git.maby.dev/ange/suckless /tmp/suckless/ -cd "$_" +git clone https://git.maby.dev/ange/suckless.git /tmp/suckless/ +cd /tmp/suckless ./update.sh echo -e "${BOLD}${GREEN}DONE. I recommend you run \`su ${username-\$username} \ diff --git a/dwm/etc/X11/xorg.conf.d/00-keyboard.conf b/gui/dwm/rootfs/etc/X11/xorg.conf.d/00-keyboard.conf similarity index 100% rename from dwm/etc/X11/xorg.conf.d/00-keyboard.conf rename to gui/dwm/rootfs/etc/X11/xorg.conf.d/00-keyboard.conf diff --git a/dwm/etc/X11/xorg.conf.d/30-touchpad.conf b/gui/dwm/rootfs/etc/X11/xorg.conf.d/30-touchpad.conf similarity index 100% rename from dwm/etc/X11/xorg.conf.d/30-touchpad.conf rename to gui/dwm/rootfs/etc/X11/xorg.conf.d/30-touchpad.conf diff --git a/dwm/etc/X11/xorg.conf.d/50-mouse-acceleration.conf b/gui/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse-acceleration.conf similarity index 100% rename from dwm/etc/X11/xorg.conf.d/50-mouse-acceleration.conf rename to gui/dwm/rootfs/etc/X11/xorg.conf.d/50-mouse-acceleration.conf diff --git a/gpu.sh b/gui/install.sh similarity index 78% rename from gpu.sh rename to gui/install.sh index 5dbee08..964f2a8 100755 --- a/gpu.sh +++ b/gui/install.sh @@ -1,9 +1,12 @@ #!/bin/bash -e cd "$(dirname "$0")" +. ./config -NORMAL='\e[0m' -BOLD='\e[1m' -GREEN='\e[32m' +if [ -t 1 ]; then + NORMAL='\e[0m' + BOLD='\e[1m' + GREEN='\e[32m' +fi PACMAN='pacman --noconfirm --needed -Syu' @@ -12,13 +15,10 @@ if [ "$EUID" != 0 ]; then exit 1 fi +$PACMAN "${pkg[@]}" flatpak +flatpak install "${flatpakpkg[@]}" + case "$(lspci -k | grep -E '(VGA|3D)')" in - *NVIDIA*) - $PACMAN nvidia{,-utils,-settings} - mkdir -p /etc/pacman.d/hooks/ - cp -rfT rootfs_nvidia/ / - modules='nvidia nvidia_modeset nvidia_uvm nvidia_drm' - ;; *AMD*) $PACMAN mesa vulkan-radeon modules=amdgpu @@ -27,9 +27,15 @@ case "$(lspci -k | grep -E '(VGA|3D)')" in $PACMAN mesa vulkan-intel modules=i915 ;; + *NVIDIA*) + $PACMAN nvidia{,-utils,-settings} + modules='nvidia nvidia_modeset nvidia_uvm nvidia_drm' + ;; esac sed -i "s/^MODULES=(/MODULES=($modules/" /etc/mkinitcpio.conf mkinitcpio -P +xdg-user-dirs-update + echo -e "${BOLD}${GREEN}GPU drivers install finished.${NORMAL}" diff --git a/base.sh b/install.sh similarity index 85% rename from base.sh rename to install.sh index 3e24289..0203c8d 100755 --- a/base.sh +++ b/install.sh @@ -2,9 +2,11 @@ cd "$(dirname "$0")" . ./config -NORMAL='\e[0m' -BOLD='\e[1m' -GREEN='\e[32m' +if [ -t 1 ]; then + NORMAL='\e[0m' + BOLD='\e[1m' + GREEN='\e[32m' +fi PACMAN='pacman --noconfirm --needed -Syu' @@ -26,25 +28,23 @@ case "$(lscpu | grep Vendor)" in esac sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf -./gpu.sh - # Packages $PACMAN "${pkg[@]}" "$cpu-ucode" -systemctl enable \ - NetworkManager \ - podman.socket \ - reflector.timer \ +systemctl enable \ + NetworkManager \ + podman.socket \ + reflector.timer \ + systemd-resolved \ systemd-timesyncd if ls -d /sys/class/power_supply/BAT*/ > /dev/null 2>&1; then $PACMAN "${laptop_pkg[@]}" - cp -rfT rootfs_laptop/ / systemctl enable tlp fi # Users echo "root:$root_passwd" | chpasswd -useradd -mG wheel "$username" -s "${default_shell-/bin/bash}" +useradd -mG wheel,video "$username" -s "${default_shell-/bin/bash}" echo "$username:$user_passwd" | chpasswd su "$username" -c 'xdg-user-dirs-update' 2> /dev/null || true diff --git a/rootfs/boot/loader/entries/arch-fallback.conf b/rootfs/boot/loader/entries/arch-fallback.conf deleted file mode 100755 index 974bc28..0000000 --- a/rootfs/boot/loader/entries/arch-fallback.conf +++ /dev/null @@ -1,3 +0,0 @@ -title Arch Linux (fallback) -linux /vmlinuz-linux -initrd /initramfs-linux-fallback.img diff --git a/rootfs/boot/loader/entries/arch-lts.conf b/rootfs/boot/loader/entries/arch-lts.conf new file mode 100755 index 0000000..d3c2b3e --- /dev/null +++ b/rootfs/boot/loader/entries/arch-lts.conf @@ -0,0 +1,3 @@ +title Arch Linux LTS +linux /vmlinuz-linux-lts +initrd /initramfs-linux-lts.img diff --git a/rootfs/etc/NetworkManager/NetworkManager.conf b/rootfs/etc/NetworkManager/NetworkManager.conf new file mode 100644 index 0000000..1983860 --- /dev/null +++ b/rootfs/etc/NetworkManager/NetworkManager.conf @@ -0,0 +1,3 @@ +[main] +dns=systemd-resolved +systemd-resolved=false diff --git a/rootfs/etc/iptables/iptables.rules b/rootfs/etc/iptables/iptables.rules new file mode 100644 index 0000000..f33b7f0 --- /dev/null +++ b/rootfs/etc/iptables/iptables.rules @@ -0,0 +1,6 @@ +*filter +:INPUT DROP [0:0] +:FORWARD DROP [0:0] +:OUTPUT ACCEPT [0:0] +-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT +COMMIT diff --git a/rootfs_nvidia/etc/pacman.d/hooks/nvidia.hook b/rootfs/etc/pacman.d/hooks/10-nvidia.hook similarity index 95% rename from rootfs_nvidia/etc/pacman.d/hooks/nvidia.hook rename to rootfs/etc/pacman.d/hooks/10-nvidia.hook index 325ec7c..7198a90 100644 --- a/rootfs_nvidia/etc/pacman.d/hooks/nvidia.hook +++ b/rootfs/etc/pacman.d/hooks/10-nvidia.hook @@ -4,7 +4,6 @@ Operation=Upgrade Operation=Remove Type=Package Target=nvidia -Target=linux* [Action] Description=Update NVIDIA module in initcpio diff --git a/rootfs/etc/pacman.d/hooks/95-systemd-boot.hook b/rootfs/etc/pacman.d/hooks/10-systemd-boot.hook similarity index 100% rename from rootfs/etc/pacman.d/hooks/95-systemd-boot.hook rename to rootfs/etc/pacman.d/hooks/10-systemd-boot.hook diff --git a/rootfs/etc/systemd/resolved.conf b/rootfs/etc/systemd/resolved.conf new file mode 100644 index 0000000..3d11fa1 --- /dev/null +++ b/rootfs/etc/systemd/resolved.conf @@ -0,0 +1,35 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file, or by creating "drop-ins" in +# the resolved.conf.d/ subdirectory. The latter is generally recommended. +# Defaults can be restored by simply deleting this file and all drop-ins. +# +# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. +# +# See resolved.conf(5) for details. + +[Resolve] +# Some examples of DNS servers which may be used for DNS= and FallbackDNS=: +# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com +# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google +# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net +DNS=1.1.1.1#cloudflare-dns.com +FallbackDNS=1.1.1.1 8.8.8.8 +Domains=~. +#DNSSEC=no +DNSOverTLS=yes +#MulticastDNS=yes +#LLMNR=yes +#Cache=yes +#CacheFromLocalhost=no +#DNSStubListener=yes +#DNSStubListenerExtra= +#ReadEtcHosts=yes +#ResolveUnicastSingleLabel=no +#StaleRetentionSec=0 diff --git a/rootfs_laptop/etc/udev/rules.d/99-lowbat.rules b/rootfs/etc/udev/rules.d/10-lowbat.rules similarity index 100% rename from rootfs_laptop/etc/udev/rules.d/99-lowbat.rules rename to rootfs/etc/udev/rules.d/10-lowbat.rules diff --git a/rootfs/etc/udev/rules.d/99-backlight.rules b/rootfs/etc/udev/rules.d/99-backlight.rules new file mode 100644 index 0000000..5440ae6 --- /dev/null +++ b/rootfs/etc/udev/rules.d/99-backlight.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video $sys$devpath/brightness", RUN+="/bin/chmod g+w $sys$devpath/brightness"