aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib_apps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib_apps.sh')
-rw-r--r--scripts/lib_apps.sh31
1 files changed, 19 insertions, 12 deletions
diff --git a/scripts/lib_apps.sh b/scripts/lib_apps.sh
index dd918b02..900ca801 100644
--- a/scripts/lib_apps.sh
+++ b/scripts/lib_apps.sh
@@ -3,8 +3,9 @@
enable_asusctl() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
if command -v asusctl >/dev/null 2>&1; then
- local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf"
+ local OVERLAY_SA="$base/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"
@@ -13,8 +14,9 @@ enable_asusctl() {
enable_blueman() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
if command -v blueman-applet >/dev/null 2>&1; then
- local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf"
+ local OVERLAY_SA="$base/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"
@@ -23,33 +25,36 @@ enable_blueman() {
enable_ags() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
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"
+ local OVERLAY_SA="$base/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
+ sed -i '/#ags -q && ags &/s/^#//' "$base/config/hypr/scripts/RefreshNoWaybar.sh"
+ sed -i '/#ags -q && ags &/s/^#//' "$base/config/hypr/scripts/Refresh.sh"
fi
}
enable_quickshell() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
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"
+ local OVERLAY_SA="$base/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
+ sed -i '/#pkill qs && qs &/s/^#//' "$base/config/hypr/scripts/RefreshNoWaybar.sh"
+ sed -i '/#pkill qs && qs &/s/^#//' "$base/config/hypr/scripts/Refresh.sh"
fi
}
ensure_keybinds_init() {
local log="$1"
- local OVERLAY_SA="config/hypr/configs/Startup_Apps.conf"
+ local base="${DOTFILES_DIR:-.}"
+ local OVERLAY_SA="$base/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"
@@ -59,9 +64,10 @@ ensure_keybinds_init() {
install_terminal_configs() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
# Ghostty
- local GHOSTTY_SRC="config/ghostty/ghostty.config"
+ local GHOSTTY_SRC="$base/config/ghostty/ghostty.config"
local GHOSTTY_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ghostty"
local GHOSTTY_DEST="$GHOSTTY_DIR/config"
if [ -f "$GHOSTTY_SRC" ]; then
@@ -75,7 +81,7 @@ install_terminal_configs() {
fi
# WezTerm
- local WEZTERM_SRC="config/wezterm/wezterm.lua"
+ local WEZTERM_SRC="$base/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
@@ -88,10 +94,11 @@ install_terminal_configs() {
choose_default_editor() {
local log="$1"
+ local base="${DOTFILES_DIR:-.}"
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
+ sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" "$base/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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage