From 9aeefc0a678e4c35a754b28b9207a85993a57b08 Mon Sep 17 00:00:00 2001 From: Preston Hunt Date: Fri, 28 Aug 2026 12:30:44 -0700 Subject: [PATCH] remove dead code Three functions were defined but never called from main() or anywhere else: mute() -- an unused &>/dev/null wrapper. disable_if_installed() -- also buggy: it looped over "$@" binding each unit to $unit, then passed "$@" (the whole list) to 'systemctl list-unit-files', so the existence check never corresponded to the unit being disabled. disable_service() already covers this and is the one actually used. auto_start_terminal() -- along with startup-terminal.desktop, its only consumer. Verified each name appears exactly once in the file (its own definition) before removal, and that nothing else references startup-terminal.desktop. All three are recoverable from history if wanted. Co-Authored-By: Claude Opus 5 (1M context) --- setup | 17 ----------------- startup-terminal.desktop | 10 ---------- 2 files changed, 27 deletions(-) delete mode 100644 startup-terminal.desktop diff --git a/setup b/setup index df939ed..e4a834d 100755 --- a/setup +++ b/setup @@ -82,8 +82,6 @@ main() { info "prestobuntu setup complete!" } -mute() { "$@" &>/dev/null; } - check_not_root() { if (( UID == 0 )); then die "must not run as root (tip: don't use sudo)" @@ -523,14 +521,6 @@ install_tailscale() { wget -qO- https://tailscale.com/install.sh | sudo sh } -disable_if_installed() { - for unit in "$@"; do - if systemctl list-unit-files "$@" &>/dev/null; then - sudo systemctl disable "$unit" - fi - done -} - disable_suspend_on_lid_closed() { _require_line "HandleLidSwitch=ignore" /etc/systemd/logind.conf _require_line "HandleLidSwitchExternalPower=ignore" /etc/systemd/logind.conf @@ -538,13 +528,6 @@ disable_suspend_on_lid_closed() { # systemctl restart systemd-logind } -auto_start_terminal() { - local autostart="$HOME/.config/autostart" - local file="startup-terminal.desktop" - mkdir -p "$autostart" - get_prestobuntu_file "$file" "$autostart/$file" -} - create_gruvbox_terminal_profile() { get_prestobuntu_file "create-gruvbox" /tmp/create-gruvbox bash /tmp/create-gruvbox diff --git a/startup-terminal.desktop b/startup-terminal.desktop deleted file mode 100644 index 4d30fd9..0000000 --- a/startup-terminal.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Exec=x-terminal-emulator -Hidden=false -NoDisplay=false -X-GNOME-Autostart-enabled=true -Name[en_NG]=Terminal -Name=Terminal -Comment[en_NG]=Start Terminal On Startup -Comment=Start Terminal On Startup