From 997a522e5aca800392c93c42446991bd46a76a0d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 03:17:29 -0500 Subject: created next modules for apps, editr,bt,rog,rog,ags,qs Phase 4 moving apps to its own module On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh new file: scripts/lib_apps.sh --- scripts/lib_apps.sh | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 scripts/lib_apps.sh (limited to 'scripts/lib_apps.sh') diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh new file mode 100644 index 00000000..a1ee2fe5 --- /dev/null +++ b/scripts/lib_apps.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# App enablement and editor selection helpers. + +enable_asusctl() { + local log="$1" + if command -v asusctl >/dev/null 2>&1; then + local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")" + touch "$OVERLAY_SA" + grep -qx 'exec-once = rog-control-center' "$OVERLAY_SA" || echo 'exec-once = rog-control-center' >>"$OVERLAY_SA" + fi +} + +enable_blueman() { + local log="$1" + if command -v blueman-applet >/dev/null 2>&1; then + local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")" + touch "$OVERLAY_SA" + grep -qx 'exec-once = blueman-applet' "$OVERLAY_SA" || echo 'exec-once = blueman-applet' >>"$OVERLAY_SA" + fi +} + +enable_ags() { + local log="$1" + if command -v ags >/dev/null 2>&1; then + echo "${INFO:-[INFO]} AGS detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$log" + local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")" + touch "$OVERLAY_SA" + grep -qx 'exec-once = ags' "$OVERLAY_SA" || echo 'exec-once = ags' >>"$OVERLAY_SA" + sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh + sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh + fi +} + +enable_quickshell() { + local log="$1" + if command -v qs >/dev/null 2>&1; then + echo "${INFO:-[INFO]} Quickshell detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$log" + local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")" + touch "$OVERLAY_SA" + grep -qx 'exec-once = qs' "$OVERLAY_SA" || echo 'exec-once = qs' >>"$OVERLAY_SA" + sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh + sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh + fi +} + +ensure_keybinds_init() { + local log="$1" + local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")" + if ! grep -qx 'exec-once = \$scriptsDir/KeybindsLayoutInit.sh' "$OVERLAY_SA"; then + echo 'exec-once = $scriptsDir/KeybindsLayoutInit.sh' >>"$OVERLAY_SA" + echo "${INFO:-[INFO]} Added KeybindsLayoutInit.sh to user Startup_Apps overlay" 2>&1 | tee -a "$log" + fi +} + +choose_default_editor() { + local log="$1" + local editor_set=0 + update_editor() { + local editor=$1 + sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" config/hypr/UserConfigs/01-UserDefaults.conf + echo "${OK:-[OK]} Default editor set to ${MAGENTA:-}$editor${RESET:-}." 2>&1 | tee -a "$log" + } + if command -v nvim &>/dev/null; then + printf "${INFO:-[INFO]} ${MAGENTA:-}neovim${RESET:-} is detected as installed\n" + if ! read -r -p "${CAT:-[ACTION]} Do you want to make ${MAGENTA:-}neovim${RESET:-} the default editor? (y/N): " EDITOR_CHOICE /dev/null; then + printf "${INFO:-[INFO]} ${MAGENTA:-}vim${RESET:-} is detected as installed\n" + if read -r -p "${CAT:-[ACTION]} Do you want to make ${MAGENTA:-}vim${RESET:-} the default editor? (y/N): " EDITOR_CHOICE Date: Sun, 11 Jan 2026 20:01:40 -0500 Subject: Moved ghostty/wezterm config file process out of copy.sh On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_apps.sh modified: scripts/lib_copy.sh --- copy.sh | 2 +- scripts/lib_apps.sh | 29 +++++++++++++++++++++++++++++ scripts/lib_copy.sh | 24 +----------------------- 3 files changed, 31 insertions(+), 24 deletions(-) (limited to 'scripts/lib_apps.sh') diff --git a/copy.sh b/copy.sh index 8d143800..398f72d0 100755 --- a/copy.sh +++ b/copy.sh @@ -24,7 +24,7 @@ # - Final symlinks (waybar) and wallust init. # # Next modular step: -# Move ghostty/wezterm install logic into lib_apps.sh (optional) and consider +# Ghostty/WezTerm install logic lives in lib_apps.sh now; consider # breaking user restore logic into helpers for clarity. clear diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh index a1ee2fe5..562e5c5b 100644 --- a/scripts/lib_apps.sh +++ b/scripts/lib_apps.sh @@ -57,6 +57,35 @@ ensure_keybinds_init() { fi } +install_terminal_configs() { + local log="$1" + + # Ghostty + local GHOSTTY_SRC="config/ghostty/ghostty.config" + local GHOSTTY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ghostty" + local GHOSTTY_DEST="$GHOSTTY_DIR/config" + if [ -f "$GHOSTTY_SRC" ]; then + mkdir -p "$GHOSTTY_DIR" + install -m 0644 "$GHOSTTY_SRC" "$GHOSTTY_DEST" 2>&1 | tee -a "$log" + if [ -f "$GHOSTTY_DIR/wallust.conf" ]; then + sed -i -E 's/^(\\s*palette\\s*=\\s*)([0-9]{1,2}):/\\1\\2=/' "$GHOSTTY_DIR/wallust.conf" 2>&1 | tee -a "$log" || true + fi + else + echo "${ERROR:-[ERROR]} - $GHOSTTY_SRC not found; skipping Ghostty config install." 2>&1 | tee -a "$log" + fi + + # WezTerm + local WEZTERM_SRC="config/wezterm/wezterm.lua" + local WEZTERM_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/wezterm" + local WEZTERM_DEST="$WEZTERM_DIR/wezterm.lua" + if [ -f "$WEZTERM_SRC" ]; then + mkdir -p "$WEZTERM_DIR" + install -m 0644 "$WEZTERM_SRC" "$WEZTERM_DEST" 2>&1 | tee -a "$log" + else + echo "${ERROR:-[ERROR]} - $WEZTERM_SRC not found; skipping WezTerm config install." 2>&1 | tee -a "$log" + fi +} + choose_default_editor() { local log="$1" local editor_set=0 diff --git a/scripts/lib_copy.sh b/scripts/lib_copy.sh index e449d668..7d76cfc4 100644 --- a/scripts/lib_copy.sh +++ b/scripts/lib_copy.sh @@ -115,27 +115,5 @@ copy_phase2() { echo "${ERROR:-[ERROR]} - Directory config/$DIR_NAME does not exist to copy." 2>&1 | tee -a "$log" fi done - # Ghostty - local GHOSTTY_SRC="config/ghostty/ghostty.config" - local GHOSTTY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ghostty" - local GHOSTTY_DEST="$GHOSTTY_DIR/config" - if [ -f "$GHOSTTY_SRC" ]; then - mkdir -p "$GHOSTTY_DIR" - install -m 0644 "$GHOSTTY_SRC" "$GHOSTTY_DEST" 2>&1 | tee -a "$log" - if [ -f "$GHOSTTY_DIR/wallust.conf" ]; then - sed -i -E 's/^(\\s*palette\\s*=\\s*)([0-9]{1,2}):/\\1\\2=/' "$GHOSTTY_DIR/wallust.conf" 2>&1 | tee -a "$log" || true - fi - else - echo "${ERROR:-[ERROR]} - $GHOSTTY_SRC not found; skipping Ghostty config install." 2>&1 | tee -a "$log" - fi - # WezTerm - local WEZTERM_SRC="config/wezterm/wezterm.lua" - local WEZTERM_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/wezterm" - local WEZTERM_DEST="$WEZTERM_DIR/wezterm.lua" - if [ -f "$WEZTERM_SRC" ]; then - mkdir -p "$WEZTERM_DIR" - install -m 0644 "$WEZTERM_SRC" "$WEZTERM_DEST" 2>&1 | tee -a "$log" - else - echo "${ERROR:-[ERROR]} - $WEZTERM_SRC not found; skipping WezTerm config install." 2>&1 | tee -a "$log" - fi + install_terminal_configs "$log" } -- cgit v1.2.3