Skip to content

Commit a11b7b4

Browse files
committed
feat: Add system updater, config updates with three-way merge, and version tracking (v1)
1 parent e0d5368 commit a11b7b4

9 files changed

Lines changed: 2391 additions & 10 deletions

File tree

CONTRIBUTING.md

Lines changed: 529 additions & 5 deletions
Large diffs are not rendered by default.

PACKAGES

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# draphyOS Package Manifest
2+
# Format: package_name:min_version:max_version
3+
# - min_version: first version where package is required (empty = always)
4+
# - max_version: last version where package is required (empty = current)
5+
#
6+
# Examples:
7+
# polybar:: # Required in all versions
8+
# newtool:2: # Added in version 2, still required
9+
# oldtool::1 # Only in version 1, removed after
10+
# temptool:2:3 # Only in versions 2 and 3
11+
12+
# === Core (always required) ===
13+
i3::
14+
i3lock::
15+
dunst::
16+
lightdm::
17+
18+
# === Terminal ===
19+
rxvt-unicode::
20+
21+
# === Networking ===
22+
NetworkManager::
23+
network-manager-applet::
24+
firefox::
25+
26+
# === Audio ===
27+
pulseaudio-utils::
28+
pavucontrol::
29+
30+
# === Utilities ===
31+
brightnessctl::
32+
htop::
33+
mousepad::
34+
Thunar::
35+
36+
# === App launcher ===
37+
rofi::
38+
39+
# === Productivity & GUI tools ===
40+
lxappearance::
41+
powertop::
42+
arandr::
43+
tmux::
44+
45+
# === draphyOS Customizations ===
46+
# Shell
47+
fish::
48+
49+
# Status bar
50+
polybar::
51+
52+
# Compositor
53+
picom::
54+
55+
# Utilities
56+
feh::
57+
flameshot::
58+
playerctl::
59+
xss-lock::
60+
ImageMagick::
61+
xdotool::
62+
xclip::
63+
64+
# Bluetooth
65+
blueman::
66+
67+
# Authentication
68+
xfce-polkit::
69+
gnome-keyring::
70+
71+
# Theming
72+
xfce4-settings::
73+
74+
# Night light
75+
redshift::
76+
geoclue2::
77+
78+
# Fonts
79+
fira-code-fonts::
80+
google-noto-sans-mono-vf-fonts::
81+
fontawesome-6-free-fonts::
82+
fontawesome-6-brands-fonts::
83+
84+
# Icons & Themes
85+
mint-y-icons::
86+
adwaita-cursor-theme::
87+
88+
# Calendar popup
89+
yad::
90+
91+
# Qt theming
92+
qt5ct::

README.md

Lines changed: 158 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ If you love that vibe — welcome home.
5555

5656
## Features
5757

58+
### Desktop Environment
5859
- ⌨️ Pre-configured i3 window manager with vim-style keybindings
5960
- 📊 Clean polybar status bar (replaces i3status)
6061
- 🚀 Beautiful rofi app launcher with dark theme
@@ -65,6 +66,13 @@ If you love that vibe — welcome home.
6566
- 🌙 Night light (redshift) for eye comfort
6667
- 📋 Comprehensive keybinding cheatsheet (`Super+F1`)
6768

69+
### System Management
70+
- 🔄 **System updater** (`update-draphyOS`) — Interactive tool for system updates, security patches, and Fedora version upgrades
71+
- ⬆️ **Config updates** — Update draphyOS configs from GitHub with intelligent three-way merge (preserves your customizations)
72+
- 📦 **Smart uninstall** — Tracks packages installed by draphyOS for clean removal
73+
- 🔋 **Battery health** — Optional 80% charge limit for laptop battery longevity
74+
- 🔀 **Version migrations** — Seamless upgrades between draphyOS versions
75+
6876
---
6977

7078
## 📋 Prerequisites
@@ -128,6 +136,51 @@ git clone https://github.com/draphy/draphyOS ~/.draphyOS && ~/.draphyOS/install.
128136

129137
---
130138

139+
## 🔄 System Updates
140+
141+
draphyOS includes `update-draphyOS`, a safe, interactive system update tool.
142+
143+
### Quick Usage
144+
145+
```bash
146+
update-draphyOS # Interactive menu
147+
update-draphyOS -u # Quick system update
148+
update-draphyOS -d # Update draphyOS configs
149+
update-draphyOS -v # Fedora version upgrade
150+
```
151+
152+
### Features
153+
154+
| Option | Description |
155+
|--------|-------------|
156+
| **System Update** | Update all packages with `dnf upgrade` |
157+
| **Security Only** | Install only security patches |
158+
| **Full Maintenance** | Update + clean cache + remove orphans |
159+
| **Fedora Upgrade** | Upgrade to next Fedora version (e.g., F41 → F42) |
160+
| **draphyOS Update** | Pull latest configs from GitHub |
161+
162+
### draphyOS Config Updates
163+
164+
When you update draphyOS configs, the updater:
165+
166+
1. **Backs up** your current configs automatically
167+
2. **Fetches** the latest version from GitHub
168+
3. **Preserves your changes** using three-way merge:
169+
- If you haven't modified a config → updates automatically
170+
- If only upstream changed → updates automatically
171+
- If both changed → attempts auto-merge, asks you on conflicts
172+
4. **Runs migrations** for version upgrades (e.g., new keybindings, config format changes)
173+
5. **Installs new packages** if required by the update
174+
175+
### Conflict Resolution
176+
177+
When a config conflict is detected, you choose:
178+
- **Keep mine** — Ignore upstream changes
179+
- **Use new** — Replace with upstream version
180+
- **Backup & use new** — Save your version as `.backup-TIMESTAMP`, use new
181+
182+
---
183+
131184
## ⌨️ Keybindings
132185

133186
| Key | Action |
@@ -282,6 +335,8 @@ Every tool in draphyOS was chosen with a purpose. Here's why:
282335

283336
## 📁 Configuration Files
284337

338+
### User Configs (symlinked to ~/.draphyOS/configs/)
339+
285340
| Config | Location | Description |
286341
| -------- | ---------------------------------- | -------------- |
287342
| i3 | `~/.config/i3/config` | Window manager |
@@ -294,6 +349,17 @@ Every tool in draphyOS was chosen with a purpose. Here's why:
294349
| Redshift | `~/.config/redshift/redshift.conf` | Night light |
295350
| GTK | `~/.config/gtk-3.0/settings.ini` | Theme settings |
296351

352+
### draphyOS Internal Files
353+
354+
| File | Location | Description |
355+
| ---- | -------- | ----------- |
356+
| Install marker | `~/.draphyOS-installed` | Tracks installation state, version, base system |
357+
| Package state | `~/.draphyOS-packages-before` | Snapshot of packages before install (for clean uninstall) |
358+
| Config checksums | `~/.draphyOS-config-checksums` | MD5 checksums for three-way merge during updates |
359+
| Update script | `/usr/local/bin/update-draphyOS` | System-wide update command |
360+
| VERSION | `~/.draphyOS/VERSION` | Current draphyOS version number |
361+
| PACKAGES | `~/.draphyOS/PACKAGES` | Package manifest with version requirements |
362+
297363
---
298364

299365
## 💡 Productivity Tips
@@ -401,6 +467,55 @@ No setup needed — works automatically with PAM.
401467

402468
</details>
403469

470+
<details>
471+
<summary><strong>🔋 Battery Charge Limit</strong></summary>
472+
473+
During installation, you can set an 80% charge limit to extend battery lifespan:
474+
- Reduces battery wear from constant 100% charging
475+
- Best for laptops that are often plugged in
476+
- Uses a systemd service to persist across reboots
477+
478+
To change the limit later:
479+
```bash
480+
# Check current limit
481+
cat /sys/class/power_supply/BAT0/charge_control_end_threshold
482+
483+
# Set to 80%
484+
echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
485+
486+
# Set back to 100%
487+
echo 100 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
488+
```
489+
490+
> **Note:** Not all laptops support charge limits. The installer only offers this if your hardware supports it.
491+
492+
</details>
493+
494+
<details>
495+
<summary><strong>🔄 System Updates</strong></summary>
496+
497+
Use `update-draphyOS` for all system maintenance:
498+
499+
```bash
500+
update-draphyOS # Interactive menu with all options
501+
update-draphyOS -u # Quick update (equivalent to dnf upgrade)
502+
update-draphyOS -s # Security updates only
503+
update-draphyOS -f # Full maintenance (update + clean + autoremove)
504+
update-draphyOS -d # Update draphyOS configs from GitHub
505+
update-draphyOS -v # Upgrade to next Fedora version
506+
update-draphyOS -h # Show help
507+
```
508+
509+
The tool handles:
510+
- Package updates with proper metadata refresh
511+
- Security-only updates when you need stability
512+
- Orphaned package cleanup
513+
- Fedora version upgrades (F41 → F42)
514+
- Reboot prompts when kernel updates require it
515+
- draphyOS config updates with conflict resolution
516+
517+
</details>
518+
404519
<details>
405520
<summary><strong>⌨️ Terminal Multiplexer (tmux)</strong></summary>
406521

@@ -422,6 +537,15 @@ Great for remote work — sessions persist after disconnect.
422537
~/.draphyOS/uninstall.sh
423538
```
424539

540+
### Smart Package Removal
541+
542+
draphyOS tracks which packages it installed. On uninstall:
543+
544+
- **If package state was saved** (installations after v1): Precisely removes only packages added by draphyOS, restoring your system to its exact pre-install state
545+
- **Legacy installations**: Falls back to predefined package lists
546+
547+
### Base System Detection
548+
425549
The uninstaller is smart about your base system:
426550

427551
**Fedora i3 Spin:**
@@ -435,10 +559,14 @@ The uninstaller is smart about your base system:
435559
- Option to fully remove all i3 packages
436560
- Restore backup or skip
437561

438-
All uninstalls:
439-
- Remove draphyOS config symlinks
440-
- Optionally revert shell to bash
441-
- Optionally restore your backup configs
562+
### What Gets Removed
563+
564+
- draphyOS config symlinks
565+
- System update script (`/usr/local/bin/update-draphyOS`)
566+
- Battery charge limit service (if configured)
567+
- LightDM customization (restored from backup)
568+
- Optionally: shell reverted to bash
569+
- Optionally: backup configs restored
442570

443571
---
444572

@@ -508,6 +636,32 @@ If not auto-detected or you need to apply manually, picom's `glx` backend doesn'
508636
509637
</details>
510638

639+
<details>
640+
<summary><strong>update-draphyOS command not found?</strong></summary>
641+
642+
The update script is installed to `/usr/local/bin/update-draphyOS` during installation. If it's missing:
643+
644+
```bash
645+
# Reinstall the update script
646+
sudo cp ~/.draphyOS/update.sh /usr/local/bin/update-draphyOS
647+
sudo chmod +x /usr/local/bin/update-draphyOS
648+
```
649+
650+
</details>
651+
652+
<details>
653+
<summary><strong>Config update shows conflicts for unchanged files?</strong></summary>
654+
655+
This can happen if you installed draphyOS before version tracking was added. The updater will create the checksum file on first update, so future updates will work correctly.
656+
657+
To reset checksums manually:
658+
```bash
659+
rm ~/.draphyOS-config-checksums
660+
update-draphyOS -d
661+
```
662+
663+
</details>
664+
511665
---
512666

513667
## 🤝 Contributing

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

0 commit comments

Comments
 (0)