Big Update

This commit is contained in:
2025-08-08 21:51:33 +02:00
parent 4f7483d053
commit b57943ee4b
8 changed files with 126 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ pacman -Syu --noconfirm
# === Essential tools ===
ESSENTIAL_PACKAGES="
python3
vim
neovim
ranger
firefox
@@ -55,11 +56,17 @@ AUDIO_PACKAGES="
# === Fonts & theming ===
FONTS_AND_THEME="
otf-font-awesome
noto-fonts
noto-fonts-cjk
ttf-jetbrains-mono
orchis-theme
"
# === Multimedia ===
MEDIA_PACKAGES="
mpv
eog
ffmpeg
"
# === Install all packages ===
@@ -75,10 +82,34 @@ pacman -S --noconfirm --needed \
# === Enable display manager ===
echo "Enabling SDDM..."
systemctl enable sddm
# === Apply GTK settings for theme and color scheme ===
echo "Applying GTK settings..."
# Extract DBus address from the user's environment
USER_DBUS_ENV=$(sudo -u "$ORIG_USER" -- dbus-launch)
eval "$USER_DBUS_ENV"
export DBUS_SESSION_BUS_ADDRESS
export XDG_RUNTIME_DIR="/run/user/$(id -u $ORIG_USER)"
sudo -u "$ORIG_USER" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
gsettings set org.gnome.desktop.interface gtk-theme "Orchis-Dark-Compact"
sudo -u "$ORIG_USER" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
gsettings set org.gnome.desktop.interface icon-theme "Orchis-Dark-Compact"
sudo -u "$ORIG_USER" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
echo "GTK settings applied successfully."
# === Run dotfiles setup ===
echo "Running dotfiles setup as $ORIG_USER..."
cd "$ORIG_PWD" || exit 1
sudo -u "$ORIG_USER" HOME="$ORIG_HOME" python3 setup.py
sudo -E -u "$ORIG_USER" HOME="$ORIG_HOME" mkdir -p "$ORIG_HOME/Downloads" "$ORIG_HOME/Documents" "$ORIG_HOME/Pictures" "$ORIG_HOME/Videos" "$ORIG_HOME/Repositories"
echo "Dotfiles installed successfully."

View File

@@ -4,10 +4,50 @@ import shutil
SRC_DIR = "src"
HOME_DIR = os.path.expanduser("~")
CHOICES = {
'.config/hypr/monitors.conf': ['.config/hypr/monitors-1.conf', '.config/hypr/monitors-2.conf']
}
def ask_override(path):
resp = input(f"'{path}' already exists. Override? (Y/N): ").strip().lower()
return resp == 'y'
def choice_files(src_root, dst_root, choices_map, override_all=False):
for final_name, options in choices_map.items():
existing_options = [f for f in options if os.path.exists(os.path.join(src_root, f))]
if not existing_options:
print(f"No source file found among options for {final_name}. Skipping.")
continue
if len(existing_options) == 1:
chosen = existing_options[0]
else:
print(f"Choose which file to copy as '{final_name}':")
for idx, opt in enumerate(existing_options, 1):
print(f"{idx}: {opt}")
while True:
try:
choice_idx = int(input(f"Enter number (1-{len(existing_options)}): "))
if 1 <= choice_idx <= len(existing_options):
chosen = existing_options[choice_idx - 1]
break
except ValueError:
pass
print("Invalid choice, try again.")
src_file = os.path.join(src_root, chosen)
dst_file = os.path.join(dst_root, final_name)
if os.path.exists(dst_file):
if not override_all and not ask_override(dst_file):
print(f"Skipped overriding {dst_file}")
continue
shutil.copy2(src_file, dst_file)
print(f"Copied {chosen} -> {final_name}")
def copy_with_structure(src_root, dst_root, override_all=False):
for root, dirs, files in os.walk(src_root):
rel_path = os.path.relpath(root, src_root)
@@ -28,6 +68,9 @@ def copy_with_structure(src_root, dst_root, override_all=False):
def main():
override_all = input('Override all existing files? (Y/N): ').strip().lower() == 'y'
choice_files(SRC_DIR, HOME_DIR, CHOICES, override_all)
copy_with_structure(SRC_DIR, HOME_DIR, override_all)
if __name__ == '__main__':

12
src/.bashrc Normal file
View File

@@ -0,0 +1,12 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias grep='grep --color=auto'
PS1='[\u@\h \W]\$ '
alias vim='nvim'

View File

@@ -0,0 +1,5 @@
[Settings]
gtk-icon-theme-name = Orchis-Dark-Compact
gtk-theme-name = Orchis-Dark-Compact
gtk-font-name = Console Sans 11
gtk-application-prefer-dark-theme = true

View File

@@ -279,4 +279,10 @@ windowrule = float,class:org.pulseaudio.pavucontrol
windowrule = opacity 1 1 override,title:(?i).*YouTube.*
windowrule = opacity 1 1 override,class: Spotify
windowrule = opacity 1 1 override,class: jetbrains-idea-ce
windowrule = opacity 1 1 override,class: jetbrains-pycharm-ce
windowrule = opacity 1 1 override,class: jetbrains-pycharm-ce
# All the menus
windowrule = opacity 1 1 override, floating:1
# "Open File" dialogues will now be centered
windowrulev2 = center, title:^(?i)Open Files$

20
src/.config/mimeapps.list Normal file
View File

@@ -0,0 +1,20 @@
[Default Applications]
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
image/jpeg=org.gnome.eog.desktop.desktop
image/png=org.gnome.eog.desktop.desktop
image/gif=org.gnome.eog.desktop.desktop
image/webp=org.gnome.eog.desktop.desktop
image/svg+xml=org.gnome.eog.desktop.desktop
video/mp4=mpv.desktop
video/x-matroska=mpv.desktop
video/webm=mpv.desktop
video/x-msvideo=mpv.desktop
audio/mpeg=music-player.desktop
audio/ogg=music-player.desktop
audio/flac=music-player.desktop
audio/wav=music-player.desktop

8
src/.profile Normal file
View File

@@ -0,0 +1,8 @@
# XDG Base Directory Specification
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# For compatibility with apps that support runtime dir (like systemd-based services)
export XDG_RUNTIME_DIR="/run/user/$(id -u)"