mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:07:04 +01:00
Two levels of pure taxonomy carrying no information, and a 2-directory
cap leaves no room for them. Categories now sit directly under
linux_configuration/: features, fixes, utils, misc, fresh-install,
installers, diagnostics, gaming, boot_recovery, periodic_background, lib,
meta, tests. A script's own lib/ and tests/ are exempt from the cap, so
those stay put.
Depth violations 248 -> 139; roughly 40 of the remainder are inside
digital_wellbeing and hosts, deferred until the guard-lib repoint.
The moves are the easy half. What breaks is every path that counted
levels, and three classes of it had to be found by resolving paths rather
than reading diffs:
- 52 relative `source` lines for lib/common.sh and lib/android.sh. The
correct prefix differs per file: 40 were ../../ and 12 were ../../../,
so a blanket replace would have fixed one set and broken the other.
- REPO_ROOT in 7 fixes/lib/tests harnesses and setup_syncyomi_guard.sh,
each walking up four levels from a directory now two levels shallower.
This caused a real regression -- the fixes suite went red with
"log_warn: command not found" -- caught by running it and comparing
against the pre-move baseline worktree.
- conftest.py's sys.path entries, which took the pytest gate down with
14 collection errors, and the `# shellcheck source=` directives, which
took shellcheck down with SC1091.
16 symlinks in $HOME broke, including the entire i3blocks bar. All
repointed, and cpu_monitor/memory/disk/time/volume were run to confirm
they emit real output rather than merely resolving.
Verified: 1798 tests pass at 100% coverage, 8 of 9 lib/tests suites pass
(the ninth needs the coverage jail, identically at baseline), pre-commit
is clean, and the two untracked secret configs are still ignored after
their gitignore paths changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
76 lines
2.0 KiB
Bash
Executable File
76 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# ActivityWatch install, both packaged and manual.
|
|
#
|
|
# Sourced by setup_activitywatch.sh; split out to keep it under the 250-line
|
|
# cap. Sourced rather than run, so it inherits the caller's strict mode
|
|
# and the variables defined above the source line.
|
|
|
|
# Function to install ActivityWatch
|
|
install_activitywatch() {
|
|
echo ""
|
|
echo "2. Installing ActivityWatch..."
|
|
echo "============================="
|
|
|
|
# Check if we need sudo for installation
|
|
check_sudo "install"
|
|
|
|
echo "Installing activitywatch-bin from AUR..."
|
|
|
|
# Check if an AUR helper is available
|
|
local aur_helpers=("yay" "paru" "makepkg")
|
|
local helper_found=""
|
|
|
|
for helper in "${aur_helpers[@]}"; do
|
|
if command -v "$helper" &>/dev/null; then
|
|
helper_found="$helper"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [[ -n $helper_found && $helper_found != "makepkg" ]]; then
|
|
echo "Using AUR helper: $helper_found"
|
|
if [[ $EUID -eq 0 ]]; then
|
|
# Running as root, need to install as user
|
|
sudo -u "$ACTUAL_USER" "$helper_found" -S --noconfirm activitywatch-bin
|
|
else
|
|
"$helper_found" -S --noconfirm activitywatch-bin
|
|
fi
|
|
else
|
|
echo "No AUR helper found. Installing manually with makepkg..."
|
|
install_activitywatch_manual
|
|
fi
|
|
|
|
echo "✓ ActivityWatch installation completed"
|
|
}
|
|
|
|
# Function to manually install ActivityWatch via makepkg
|
|
install_activitywatch_manual() {
|
|
local temp_dir="/tmp/activitywatch-install"
|
|
local original_user="$ACTUAL_USER"
|
|
|
|
# Create temp directory
|
|
mkdir -p "$temp_dir"
|
|
# Guarded: the next command is `git clone ... .`, which would otherwise
|
|
# clone into whatever directory the caller happened to be in.
|
|
cd "$temp_dir" || {
|
|
print_error "Cannot enter $temp_dir"
|
|
return 1
|
|
}
|
|
|
|
# Download PKGBUILD
|
|
if command -v git &>/dev/null; then
|
|
sudo -u "$original_user" git clone https://aur.archlinux.org/activitywatch-bin.git .
|
|
else
|
|
echo "Installing git..."
|
|
pacman -S --noconfirm git
|
|
sudo -u "$original_user" git clone https://aur.archlinux.org/activitywatch-bin.git .
|
|
fi
|
|
|
|
# Build and install package
|
|
sudo -u "$original_user" makepkg -si --noconfirm
|
|
|
|
# Cleanup
|
|
cd /
|
|
rm -rf "$temp_dir"
|
|
}
|