Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,22 @@ Every tool in draphyOS was chosen with a purpose. Here's why:
~/.draphyOS/uninstall.sh
```

This will:
The uninstaller is smart about your base system:

**Fedora i3 Spin:**
- Keeps core i3 packages (your system needs them!)
- Only removes draphyOS additions (polybar, picom, fish, etc.)
- Strongly recommends restoring your original configs
- Falls back to `/etc/skel` defaults if no backup exists

**Other Fedora variants (XFCE, Workstation, etc.):**
- Option to remove only draphyOS additions
- Option to fully remove all i3 packages
- Restore backup or skip

All uninstalls:
- Remove draphyOS config symlinks
- Optionally revert shell to bash
- Optionally remove draphyOS packages
- Optionally restore your backup configs

---
Expand All @@ -292,11 +304,15 @@ This will:
</details>

<details>
<summary><strong>Network module missing?</strong></summary>
<summary><strong>Network module not showing?</strong></summary>

draphyOS has separate WiFi and Ethernet modules that auto-hide when disconnected.

- Your interface name may differ
- Edit `~/.config/polybar/config.ini` → `interface = YOUR_INTERFACE`
- Find yours with: `ip link show`
- Interfaces are auto-detected on each login via `~/.xprofile`
- If not working, check your interface names: `ip link show`
- Edit `~/.config/polybar/config.ini`:
- WiFi: `[module/network-wifi]` → `interface = wlan0` (or your interface)
- Ethernet: `[module/network-eth]` → `interface = eth0` (or your interface)

</details>

Expand Down
1 change: 0 additions & 1 deletion configs/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ exec_always --no-startup-id feh --bg-fill ~/.config/wallpaper.png
# Blue light filter (Thrissur, Kerala, India)
exec --no-startup-id redshift -l 10.5276:76.2144


# Polkit authentication agent
exec --no-startup-id /usr/libexec/xfce-polkit

Expand Down
36 changes: 26 additions & 10 deletions configs/polybar/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ modules-left = i3 xwindow
; Center: date and time
modules-center = calendar date

; Right: system info
modules-right = filesystem cpu memory network pulseaudio battery tray powermenu
; Right: system info (network modules auto-hide when disconnected)
modules-right = filesystem cpu memory network-wifi network-eth pulseaudio battery tray powermenu

cursor-click = pointer
cursor-scroll = ns-resize
Expand Down Expand Up @@ -137,22 +137,19 @@ format-prefix = " "
format-prefix-foreground = ${colors.primary}
label = %percentage_used%% %used%/%total%

[module/network]
[module/network-wifi]
type = internal/network
; IMPORTANT: Change this to your network interface
; Find yours with: ip link show
; WiFi interface (auto-configured by install script)
interface = wlan0
interval = 3.0

; Connected state
; Connected state - shows signal strength icon and network name
format-connected = <ramp-signal> <label-connected>
label-connected = %essid% ↓%downspeed% ↑%upspeed%
label-connected-foreground = ${colors.foreground}

; Disconnected state
format-disconnected = <label-disconnected>
label-disconnected =  Disconnected
label-disconnected-foreground = ${colors.alert}
; Disconnected state - hidden (empty format shows nothing)
format-disconnected =

; WiFi signal strength icons
ramp-signal-0 = 
Expand All @@ -166,6 +163,25 @@ ramp-signal-foreground = ${colors.primary}
click-left = nm-connection-editor
click-right = nm-applet

[module/network-eth]
type = internal/network
; Ethernet interface (auto-configured by install script)
interface = eth0
interval = 3.0

; Connected state - shows wired icon and label
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.primary}
label-connected = Wired ↓%downspeed% ↑%upspeed%
label-connected-foreground = ${colors.foreground}

; Disconnected state - hidden (empty format shows nothing)
format-disconnected =

; Click to open network settings
click-left = nm-connection-editor
click-right = nm-applet

[module/date]
type = internal/date
interval = 5
Expand Down
18 changes: 14 additions & 4 deletions configs/xprofile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ export SSH_AUTH_SOCK
# Export keyring to D-Bus so browsers and apps can access it
dbus-update-activation-environment --systemd DISPLAY XAUTHORITY SSH_AUTH_SOCK

# Auto-detect WiFi interface for polybar (handles USB adapters changing ports)
WIFI_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: wl.*state UP" | head -1 | awk -F: '{print $2}' | tr -d ' ')
if [ -n "$WIFI_IFACE" ] && [ -f ~/.config/polybar/config.ini ]; then
sed -i "s/^interface = .*/interface = $WIFI_IFACE/" ~/.config/polybar/config.ini
# Auto-detect network interfaces for polybar (handles USB adapters changing ports)
# Each module auto-hides when disconnected, so both can be configured
if [ -f ~/.config/polybar/config.ini ]; then
# Detect WiFi interface (prefer active/UP one)
WIFI_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: wl" | head -1 | awk -F: '{print $2}' | tr -d ' ')
if [ -n "$WIFI_IFACE" ]; then
sed -i "/^\[module\/network-wifi\]/,/^\[module\// s/^interface = .*/interface = $WIFI_IFACE/" ~/.config/polybar/config.ini
fi

# Detect Ethernet interface
ETH_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: (enp|eth)" | head -1 | awk -F: '{print $2}' | tr -d ' ')
if [ -n "$ETH_IFACE" ]; then
sed -i "/^\[module\/network-eth\]/,/^\[module\// s/^interface = .*/interface = $ETH_IFACE/" ~/.config/polybar/config.ini
fi
fi
66 changes: 58 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,52 @@ configure_hardware() {
sed -i "s/^adapter = .*/adapter = $ADAPTER/" "$polybar_config" 2>/dev/null || true
fi

# Detect network interface (WiFi preferred, fallback to Ethernet)
WIFI_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: wl" | head -1 | awk -F: '{print $2}' | tr -d ' ')
ETH_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: (enp|eth)" | head -1 | awk -F: '{print $2}' | tr -d ' ')
# Detect network interfaces (both WiFi and Ethernet)
# Polybar has separate modules for each - they auto-hide when disconnected
local WIFI_IFACE=""
local ETH_IFACE=""

# Detect WiFi interface (prefer active one from default route)
local DEFAULT_IFACE
DEFAULT_IFACE=$(ip route show default 2>/dev/null | awk '/default/ {print $5}' | head -1)

if [[ "$DEFAULT_IFACE" == wl* ]]; then
WIFI_IFACE="$DEFAULT_IFACE"
else
# Fallback: find any WiFi interface
WIFI_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: wl" | head -1 | awk -F: '{print $2}' | tr -d ' ')
fi

# Detect Ethernet interface
if [[ "$DEFAULT_IFACE" != wl* ]] && [ -n "$DEFAULT_IFACE" ]; then
ETH_IFACE="$DEFAULT_IFACE"
else
# Fallback: find any Ethernet interface
ETH_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: (enp|eth)" | head -1 | awk -F: '{print $2}' | tr -d ' ')
fi

# Configure WiFi module
if [ -n "$WIFI_IFACE" ]; then
print_step "WiFi interface detected: $WIFI_IFACE"
sed -i "s/^interface = .*/interface = $WIFI_IFACE/" "$polybar_config" 2>/dev/null || true
elif [ -n "$ETH_IFACE" ]; then
# Update interface in network-wifi module section only
sed -i "/^\[module\/network-wifi\]/,/^\[module\// s/^interface = .*/interface = $WIFI_IFACE/" "$polybar_config" 2>/dev/null || true
echo "WIFI_IFACE=$WIFI_IFACE" >> "$MARKER_FILE" 2>/dev/null || true
else
print_step "No WiFi interface detected (module will be hidden)"
fi

# Configure Ethernet module
if [ -n "$ETH_IFACE" ]; then
print_step "Ethernet interface detected: $ETH_IFACE"
sed -i "s/^interface = .*/interface = $ETH_IFACE/" "$polybar_config" 2>/dev/null || true
# Update interface in network-eth module section only
sed -i "/^\[module\/network-eth\]/,/^\[module\// s/^interface = .*/interface = $ETH_IFACE/" "$polybar_config" 2>/dev/null || true
echo "ETH_IFACE=$ETH_IFACE" >> "$MARKER_FILE" 2>/dev/null || true
else
print_warning "No network interface detected. Please set manually in polybar config."
print_step "No Ethernet interface detected (module will be hidden)"
fi

if [ -z "$WIFI_IFACE" ] && [ -z "$ETH_IFACE" ]; then
print_warning "No network interfaces detected. Please configure polybar manually."
fi

print_success "Hardware configured"
Expand Down Expand Up @@ -545,10 +579,26 @@ EOF
fi
}

# Create marker file
# Create marker file with system info
create_marker() {
echo "Installed: $(date)" > "$MARKER_FILE"
echo "Version: 1.0" >> "$MARKER_FILE"

# Detect and store base Fedora variant for smart uninstall
local variant_id=""
if [ -f /etc/os-release ]; then
variant_id=$(grep "^VARIANT_ID=" /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')
fi

# Check if this is Fedora i3 Spin
if [ "$variant_id" = "i3" ] || [ -d /usr/share/backgrounds/i3 ]; then
echo "BASE_SYSTEM=fedora-i3" >> "$MARKER_FILE"
print_step "Detected: Fedora i3 Spin"
else
echo "BASE_SYSTEM=fedora-other" >> "$MARKER_FILE"
echo "BASE_VARIANT=$variant_id" >> "$MARKER_FILE"
print_step "Detected: Fedora ${variant_id:-unknown}"
fi
}

# Configure for VM environment (picom compatibility)
Expand Down
Loading