testing ghostty and lock update, which results in some build errors. rocmrocmrocm

This commit is contained in:
cnst
2024-12-28 15:06:50 +01:00
parent 3fb3398f59
commit 76e1fb5028
16 changed files with 398 additions and 135 deletions

View File

@@ -1,13 +1,11 @@
# Define TERMINAL if not set
TERMINAL="${TERMINAL:-foot}"
# Path to the tuirun executable
TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun"
# Use absolute paths for commands
PGREP="/run/current-system/sw/bin/pgrep"
PKILL="/run/current-system/sw/bin/pkill"
HYPRCTL="/etc/profiles/per-user/$USER/bin/hyprctl"
UWSM="/run/current-system/sw/bin/uwsm"
TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun"
# Determine OPTIONS based on TERMINAL
if [ "$TERMINAL" = "foot" ]; then
@@ -20,17 +18,20 @@ fi
# Matching pattern for the process
MATCH_PATTERN="$TERMINAL --title tuirun"
if "$PGREP" -f "$MATCH_PATTERN" >/dev/null; then
echo "$(date): Killing existing process"
"$PKILL" -f "$MATCH_PATTERN"
else
# Construct the command
CMD="$TERMINAL --title tuirun"
# Log the environment for debugging
env >/tmp/script_env.txt
# Construct the command as an array for proper argument handling
CMD=("$TERMINAL" "--title" "tuirun")
if [ -n "$OPTIONS" ]; then
CMD="$CMD $OPTIONS"
CMD+=("$OPTIONS")
fi
CMD="$CMD -e $TUIRUN_PATH"
CMD+=("-e" "$TUIRUN_PATH")
# Launch the terminal with OPTIONS
"$HYPRCTL" dispatch exec "$CMD"
echo "$(date): Executing command: ${CMD[*]}"
# Use eval to expand the command or pass the arguments directly
"$UWSM" app -- "${CMD[@]}"
fi

33
scripts/bin/tuirun-toggle.shbak Executable file
View File

@@ -0,0 +1,33 @@
# Define TERMINAL if not set
TERMINAL="${TERMINAL:-foot}"
# Use absolute paths for commands
PGREP="/run/current-system/sw/bin/pgrep"
PKILL="/run/current-system/sw/bin/pkill"
HYPRCTL="/etc/profiles/per-user/$USER/bin/hyprctl"
TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun"
# Determine OPTIONS based on TERMINAL
if [ "$TERMINAL" = "foot" ]; then
OPTIONS="--override=main.pad=0x0"
elif [ "$TERMINAL" = "alacritty" ]; then
OPTIONS="--option window.padding.x=0 --option window.padding.y=0"
else
OPTIONS=""
fi
# Matching pattern for the process
MATCH_PATTERN="$TERMINAL --title tuirun"
if "$PGREP" -f "$MATCH_PATTERN" >/dev/null; then
"$PKILL" -f "$MATCH_PATTERN"
else
# Construct the command
CMD="$TERMINAL --title tuirun"
if [ -n "$OPTIONS" ]; then
CMD="$CMD $OPTIONS"
fi
# Use login shell to ensure proper environment
CMD="$CMD -e $SHELL -l -c '$TUIRUN_PATH'"
# Launch the terminal with OPTIONS
"$HYPRCTL" dispatch exec "$CMD"
fi

View File

@@ -23,16 +23,21 @@ in {
".local/bin/tuirun-toggle.sh" = {
source = getExe (pkgs.writeShellApplication {
name = "tuirun-toggle";
runtimeInputs = with pkgs; [hyprland];
runtimeInputs = with pkgs; [hyprland uwsm];
text = readFile ./bin/tuirun-toggle.sh;
});
};
".local/bin/tuirun-debug.sh" = {
".local/bin/tuirun-debugger.sh" = {
source = getExe (pkgs.writeShellApplication {
name = "tuirun-debug";
name = "tuirun-debugger";
runtimeInputs = with pkgs; [hyprland];
text = readFile ./bin/tuirun-debug.sh;
text = ''
# Save environment to file
env > /tmp/tuirun-env.txt
# Run tuirun
/etc/profiles/per-user/cnst/bin/tuirun
'';
});
};