Compare commits

...
12 Commits
9 changed files with 737 additions and 4 deletions

No files matched your search

+2 -2
View File
@@ -46,7 +46,7 @@ coverage/
/.zsh_sessions/
# Firefox (sensitive, usually ignore)
# ~/.mozilla/firefox/*.default-release/sessionstore*
~/.mozilla/firefox/*.default-release/sessionstore*
# SSH keys (NEVER track)
# ~/.ssh/id_*
~/.ssh/id_*
+27 -2
View File
@@ -1,3 +1,28 @@
# windows-config
# Config
A repository for my Windows-based configuration files.
A repository for my configuration files and setup scripts for Linux and Windows
## Configurations
:diamond_shape_with_a_dot_inside: PowerShell and Git Bash for Windows
🗒️ Visual Studio Code
🖥️ Windows Terminal
⌨️ Oh My Posh
## Prerequisites
📝 [Git for Windows](https://git-scm.com/install/windows)
📝 [PowerShell 7](https://github.com/PowerShell/PowerShell/releases)
📝 [Caskaydia Mono NerdFont](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/CascadiaMono.zip)
📝 [Oh My Posh](https://ohmyposh.dev/docs/installation/windows)
**NOTE:** Typically it is sufficient to run `winget install JanDeDobbeleer.OhMyPosh --source winget`
## Notes
ℹ️ My OMP theme is based on the `rudolfs-dark` theme covered in Jan DeDobbeleer's oh-my-posh repository which is under the MIT license.
+2
View File
@@ -0,0 +1,2 @@
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
+8
View File
@@ -0,0 +1,8 @@
# Start Oh My Posh
if command -v oh-my-posh &> /dev/null; then
eval "$(oh-my-posh init bash --config ~/zoness.omp.json)"
fi
# Aliases
alias gs="git status"
alias ll="ls -lah"
+180
View File
@@ -0,0 +1,180 @@
#!/usr/bin/env bash
set -Eeuo pipefail
LOGFILE="${HOME:-/root}/fedora-setup-$(date +%Y%m%d-%H%M%S).log"
exec > >(tee -a "$LOGFILE") 2>&1
echo "=== Fedora New Machine Setup Started at $(date --iso-8601=seconds) ==="
if [[ ${EUID:-$(id -u)} -eq 0 ]]; then
SUDO=""
REAL_USER="${SUDO_USER:-root}"
REAL_HOME="$(getent passwd "$REAL_USER" | cut -d: -f6)"
else
SUDO="sudo"
REAL_USER="$USER"
REAL_HOME="$HOME"
fi
FEDORA_VER="$(rpm -E %fedora)"
run() {
echo
echo ">>> $*"
"$@"
}
warn() {
echo "WARNING: $*" >&2
}
have_cmd() {
command -v "$1" >/dev/null 2>&1
}
pkg_installed() {
rpm -q "$1" >/dev/null 2>&1
}
pkg_install() {
local to_install=()
local pkg
for pkg in "$@"; do
if ! pkg_installed "$pkg"; then
to_install+=("$pkg")
fi
done
if ((${#to_install[@]} == 0)); then
echo "Packages already installed: $*"
return 0
fi
run $SUDO dnf install -y "${to_install[@]}" || warn "Some packages failed to install: ${to_install[*]}"
}
flatpak_install() {
local ref
for ref in "$@"; do
if flatpak info "$ref" >/dev/null 2>&1; then
echo "Flatpak already installed: $ref"
else
run flatpak install -y flathub "$ref" || warn "Flatpak failed: $ref"
fi
done
}
write_vscode_repo() {
run $SUDO rpm --import https://packages.microsoft.com/keys/microsoft.asc
run $SUDO tee /etc/yum.repos.d/vscode.repo >/dev/null <<'EOF'
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
type=rpm-md
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF
}
echo "Detected Fedora version: $FEDORA_VER"
echo "Running as: ${REAL_USER}"
echo
echo "Creating mount points..."
run $SUDO mkdir -p /mnt/games /mnt/media
if have_cmd systemctl; then
run $SUDO systemctl daemon-reload || true
fi
echo
echo "Installing DNF tools..."
pkg_install dnf-plugins-core
echo
echo "Installing RPM Fusion repos..."
run $SUDO dnf install -y \
"https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VER}.noarch.rpm" \
"https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VER}.noarch.rpm" \
|| warn "RPM Fusion install failed or repos may already exist"
echo
echo "Enabling Flatpak + Flathub..."
pkg_install flatpak
run flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
echo
echo "Upgrading system..."
run $SUDO dnf upgrade -y || warn "System upgrade encountered errors"
echo
echo "Installing multimedia codecs..."
run $SUDO dnf swap -y ffmpeg-free ffmpeg --allowerasing || warn "ffmpeg swap failed"
run $SUDO dnf install -y \
mozilla-openh264 \
gstreamer1-plugins-bad-freeworld \
ffmpeg \
|| warn "Codec package install failed"
run $SUDO dnf update -y @multimedia --setopt=install_weak_deps=False --exclude=PackageKit-gstreamer-plugin \
|| warn "Multimedia group update failed"
echo
echo "Installing common RPM apps..."
pkg_install \
git \
hugo \
NetworkManager-openvpn \
openvpn \
qbittorrent \
steam \
oh-my-posh \
openrgb \
screenfetch \
yt-dlp
echo
echo "Installing fonts..."
pkg_install cascadia-fonts-all
run $SUDO fc-cache -f || true
echo
echo "Setting up VS Code repo..."
write_vscode_repo
run $SUDO dnf makecache -y || warn "dnf makecache failed"
pkg_install code
echo
echo "Installing Flatpaks..."
flatpak_install \
org.signal.Signal \
com.bitwarden.desktop \
io.github.martinrotter.rssguard \
com.spotify.Client \
io.github.Archeb.opentrace \
org.filezillaproject.Filezilla \
org.mozilla.Thunderbird \
com.discordapp.Discord
echo
echo "Configuring Flatpak access to mounted media..."
run flatpak override --user --filesystem=/mnt/media org.filezillaproject.Filezilla \
|| warn "Could not grant FileZilla access to /mnt/media"
echo
echo "Setting ownership hint for mounted directories..."
echo "After you mount the ext4 games/media partitions, you may want:"
echo " sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games /mnt/media"
echo
echo "qBittorrent note: keep the RPM build for host-level VPN adapter binding."
echo "After connecting OpenVPN, select its tun interface in qBittorrent:"
echo " Tools -> Options -> Advanced -> Network interface"
echo "Then restart qBittorrent and verify transfers stop when the VPN disconnects."
echo
echo "=== Fedora New Machine Setup Finished at $(date --iso-8601=seconds) ==="
echo "Log saved to: $LOGFILE"
+236
View File
@@ -0,0 +1,236 @@
#!/usr/bin/env bash
set -Eeuo pipefail
LOGFILE="${HOME:-/root}/opensuse-kde-setup-$(date +%Y%m%d-%H%M%S).log"
exec > >(tee -a "$LOGFILE") 2>&1
echo "=== openSUSE Tumbleweed KDE Setup Started at $(date --iso-8601=seconds) ==="
if [[ ${EUID:-$(id -u)} -eq 0 ]]; then
SUDO=""
REAL_USER="${SUDO_USER:-root}"
REAL_HOME="$(getent passwd "$REAL_USER" | cut -d: -f6)"
else
SUDO="sudo"
REAL_USER="${USER}"
REAL_HOME="${HOME}"
fi
run() {
echo
echo ">>> $*"
"$@"
}
warn() {
echo "WARNING: $*" >&2
}
have_cmd() {
command -v "$1" >/dev/null 2>&1
}
pkg_installed() {
rpm -q "$1" >/dev/null 2>&1
}
pkg_install() {
local to_install=()
local pkg
for pkg in "$@"; do
if ! pkg_installed "$pkg"; then
to_install+=("$pkg")
fi
done
if ((${#to_install[@]} == 0)); then
echo "Packages already installed: $*"
return 0
fi
run $SUDO zypper install -y "${to_install[@]}" || warn "Some packages failed to install: ${to_install[*]}"
}
flatpak_install() {
local ref
for ref in "$@"; do
if flatpak info "$ref" >/dev/null 2>&1; then
echo "Flatpak already installed: $ref"
else
run flatpak install -y flathub "$ref" || warn "Flatpak failed: $ref"
fi
done
}
write_vscode_repo() {
run $SUDO rpm --import https://packages.microsoft.com/keys/microsoft.asc
run $SUDO tee /etc/zypp/repos.d/vscode.repo >/dev/null <<'EOF'
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
autorefresh=1
type=rpm-md
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF
}
ensure_repo() {
local alias="$1"
local url="$2"
if zypper lr --uri | awk '{print $2}' | grep -Fxq "$alias"; then
echo "Repository already exists: $alias"
else
run $SUDO zypper ar -cfp 90 "$url" "$alias" || warn "Failed to add repo: $alias"
fi
}
echo "Running as: ${REAL_USER}"
echo "Real home: ${REAL_HOME}"
echo
echo "Creating mount points..."
run $SUDO mkdir -p /mnt/games /mnt/media
if have_cmd systemctl; then
run $SUDO systemctl daemon-reload || true
fi
echo
echo "Refreshing repositories..."
run $SUDO zypper ref -f || warn "Initial repo refresh failed"
echo
echo "Ensuring KDE Plasma patterns are installed..."
run $SUDO zypper install -y -t pattern kde kde_plasma || warn "KDE patterns may already be present or partially failed"
echo
echo "Adding Packman for multimedia..."
ensure_repo packman https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/
run $SUDO zypper ref || warn "Repo refresh after Packman failed"
echo
echo "Upgrading system..."
run $SUDO zypper dup -y --allow-vendor-change || warn "System dup encountered errors"
echo
echo "Switching multimedia packages to Packman where applicable..."
run $SUDO zypper dup -y --from packman --allow-vendor-change || warn "Packman vendor switch encountered errors"
echo
echo "Installing Flatpak + Flathub..."
pkg_install flatpak
run flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
echo
echo "Installing KDE-friendly desktop apps..."
pkg_install \
ark \
dolphin \
filezilla \
git \
kate \
kdeconnect-kde \
kio-extras \
konsole \
okular \
plasma-browser-integration \
spectacle \
yakuake
echo
echo "Installing common apps..."
pkg_install \
ffmpeg \
filelight \
fastfetch \
gstreamer-plugins-bad \
gstreamer-plugins-libav \
gstreamer-plugins-ugly \
hugo \
MozillaThunderbird \
NetworkManager-openvpn \
openrgb \
openvpn \
qbittorrent \
steam \
yt-dlp
echo
echo "Installing fonts..."
pkg_install \
cascadia-code-fonts \
google-droid-fonts \
liberation-fonts \
noto-sans-fonts \
noto-serif-fonts
run $SUDO fc-cache -f || true
echo
echo "Setting up VS Code..."
write_vscode_repo
run $SUDO zypper ref || warn "zypper ref after VS Code repo failed"
pkg_install code
echo
echo "Installing optional RPM apps..."
pkg_install discord || warn "discord not available from current repos"
echo
echo "Installing Flatpaks..."
flatpak_install \
org.signal.Signal \
com.bitwarden.desktop \
io.github.martinrotter.rssguard \
com.spotify.Client \
io.github.Archeb.opentrace
echo
echo "Enabling useful services..."
run $SUDO systemctl enable --now NetworkManager || warn "Could not enable NetworkManager"
echo
echo "Ownership hint for /mnt/games..."
echo "After you mount the ext4 games partition, you may want:"
echo " sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games"
cat <<EOF
=== Setup completed at $(date --iso-8601=seconds) ===
Check log: $LOGFILE
Manual follow-up:
1. Verify Plasma session at login if needed.
2. Verify Packman repo:
zypper lr -d
3. Verify multimedia packages:
zypper se -si ffmpeg gstreamer-plugins-libav
4. Find UUIDs:
lsblk -f
5. Back up fstab:
sudo cp /etc/fstab /etc/fstab.bak
6. Add entries like these:
# ext4 games partition
UUID=XXXXXX-XXXX /mnt/games ext4 defaults,nofail 0 2
# media partition if NTFS
UUID=YYYYYY-YYYY /mnt/media ntfs3 defaults,nofail,uid=1000,gid=1000 0 0
7. Test mounts:
sudo mount -a
8. Fix ownership if needed:
sudo chown -R ${REAL_USER}:${REAL_USER} /mnt/games
Notes:
- KDE Plasma patterns are installed with: zypper install -t pattern kde kde_plasma
- Packman is the important multimedia repo on Tumbleweed.
- Signal Desktop is installed via Flatpak.
- If you started from a KDE install image, the KDE pattern step is mostly harmless.
EOF
+75
View File
@@ -0,0 +1,75 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#BF231D",
"foreground": "#ffffff",
"style": "plain",
"template": " \uf0e7 ",
"type": "root"
},
{
"background": "#0A703E",
"foreground": "#ffffff",
"style": "plain",
"template": " {{ .Icon }} ",
"type": "os"
},
{
"background": "#0A703E",
"foreground": "#ffffff",
"style": "plain",
"template": "{{ .UserName }}@{{ .HostName }} ",
"type": "session"
},
{
"background": "#256C9D",
"foreground": "#ffffff",
"options": {
"folder_icon": "\uf115",
"folder_separator_icon": " \ue0b1 ",
"max_depth": 2,
"style": "agnoster_short"
},
"style": "plain",
"template": " {{ .Path }} ",
"type": "path"
},
{
"background": "#256C9D",
"foreground": "#ffffff",
"options": {
"branch_template": "{{ trunc 30 .Branch }}",
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "plain",
"template": "[ {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ]",
"type": "git"
},
{
"background": "#256C9D",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"style": "plain",
"template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
"options": {
"text": "\ue0b0"
},
"type": "python"
},
{
"foreground": "#256C9D",
"style": "plain",
"template": "\ue0b0 ",
"type": "text"
}
],
"type": "prompt"
}
],
"version": 4
}
+32
View File
@@ -0,0 +1,32 @@
{
"debug.onTaskErrors": "abort",
"diffEditor.ignoreTrimWhitespace": true,
"editor.minimap.enabled": false,
"extensions.ignoreRecommendations": true,
"extensions.verifySignature": false,
"files.exclude": {
"**/.angular": true,
"**/.vs": true,
"**/.vscode": true,
"**/bin": true,
"**/dist": true,
"**/node_modules": true,
"**/obj": true
},
"git.confirmSync": true,
"security.workspace.trust.untrustedFiles": "open",
"terminal.integrated.defaultLocation": "editor",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.tabs.location": "left",
"terminal.integrated.fontFamily": "Cascadia Code",
"terminal.integrated.fontSize": 14,
"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontWeightBold": "bold",
"terminal.integrated.letterSpacing": 1.1,
"terminal.integrated.lineHeight": 1.1,
"editor.renderWhitespace": "selection",
"update.enableWindowsBackgroundUpdates": false,
"update.mode": "manual",
"workbench.colorTheme": "One Monokai Darker"
}
+175
View File
@@ -0,0 +1,175 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{4ef75186-8199-4aa7-a88d-f9d17ed101f4}",
"initialCols": 130,
"initialRows": 36,
"keybindings":
[
{
"id": "Terminal.CopyToClipboard",
"keys": "ctrl+c"
},
{
"id": "Terminal.FindText",
"keys": "ctrl+shift+f"
},
{
"id": "Terminal.PasteFromClipboard",
"keys": "ctrl+v"
},
{
"id": "Terminal.DuplicatePaneAuto",
"keys": "alt+shift+d"
}
],
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults": {},
"list":
[
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"font":
{
"face": "Consolas",
"size": 14
},
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": true,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"font":
{
"face": "Cascadia Mono",
"size": 14
},
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt",
"startingDirectory": "%USERPROFILE%"
},
{
"colorScheme": "VS2022 Dark",
"commandline": "pwsh.exe -nologo",
"font":
{
"face": "Cascadia Mono",
"size": 14
},
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"startingDirectory": "%USERPROFILE%"
},
{
"bellStyle": "none",
"closeOnExit": "graceful",
"colorScheme": "VS2022 Dark",
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe --login -i",
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"font":
{
"face": "Cascadia Mono",
"size": 14
},
"guid": "{4ef75186-8199-4aa7-a88d-f9d17ed101f4}",
"historySize": 9001,
"icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name": "Git Bash",
"padding": "0, 0, 0, 0",
"snapOnInput": true,
"startingDirectory": "%USERPROFILE%",
"suppressApplicationTitle": true,
"tabTitle": "Git Bash",
"useAcrylic": false
}
]
},
"schemes":
[
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#F0F0F0",
"green": "#13A10E",
"name": "Campbell Powershell (modified)",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#F0F0F0",
"yellow": "#C19C00"
},
{
"background": "#000000",
"black": "#0C0C0C",
"blue": "#6060FF",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#BFBFBF",
"green": "#00A400",
"name": "GitBash",
"purple": "#BF00BF",
"red": "#BF0000",
"selectionBackground": "#FFFFFF",
"white": "#FFFFFF",
"yellow": "#BFBF00"
},
{
"background": "#1E1E1E",
"black": "#000000",
"blue": "#2472C8",
"brightBlack": "#666666",
"brightBlue": "#3B8EEA",
"brightCyan": "#29B8DB",
"brightGreen": "#23D18B",
"brightPurple": "#D670D6",
"brightRed": "#F14C4C",
"brightWhite": "#E5E5E5",
"brightYellow": "#F5F543",
"cursorColor": "#FFFFFF",
"cyan": "#11A8CD",
"foreground": "#D4D4D4",
"green": "#0DBC79",
"name": "VS2022 Dark",
"purple": "#BC3FBC",
"red": "#CD3131",
"selectionBackground": "#FFFFFF",
"white": "#E5E5E5",
"yellow": "#E5E510"
}
],
"themes": []
}