mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Fix shell startup.
This commit is contained in:
83
bin/resign_for_debug.sh
Executable file
83
bin/resign_for_debug.sh
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Default values
|
||||
FORCE=false
|
||||
TARGET_PATH=""
|
||||
DEST_PATH=""
|
||||
|
||||
# Parse flags (looking for -f)
|
||||
while getopts "f" opt; do
|
||||
case $opt in
|
||||
f) FORCE=true ;;
|
||||
*) echo "Usage: $0 [-f] <binary_name_or_path> [destination]"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
# Check for first argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Error: No binary specified."
|
||||
echo "Usage: $0 [-f] <binary_name_or_path> [destination]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 1. Resolve the Source Binary
|
||||
if [[ "$1" == *"/"* ]]; then
|
||||
SOURCE_BIN="$1"
|
||||
else
|
||||
SOURCE_BIN=$(command -v "$1")
|
||||
fi
|
||||
|
||||
if [ ! -f "$SOURCE_BIN" ]; then
|
||||
echo "Error: Could not find binary at '$1'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 2. Determine Destination Path
|
||||
if [ -n "$2" ]; then
|
||||
DEST_PATH="$2"
|
||||
# If destination is a directory, append the basename
|
||||
if [ -d "$DEST_PATH" ]; then
|
||||
DEST_PATH="${DEST_PATH%/}/$(basename "$SOURCE_BIN")"
|
||||
fi
|
||||
else
|
||||
# No destination given: create a temp directory
|
||||
TMP_DIR=$(mktemp -d -t "debug_unlock_XXXXXX")
|
||||
DEST_PATH="$TMP_DIR/$(basename "$SOURCE_BIN")"
|
||||
echo "Notice: No destination provided. Using temp path: $DEST_PATH"
|
||||
fi
|
||||
|
||||
# 3. Check for Collision
|
||||
if [ -f "$DEST_PATH" ] && [ "$FORCE" = false ]; then
|
||||
echo "Error: Destination '$DEST_PATH' already exists. Use -f to overwrite."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 4. Copy and Sign
|
||||
cp -f "$SOURCE_BIN" "$DEST_PATH"
|
||||
chmod +x "$DEST_PATH"
|
||||
|
||||
ENTITLEMENTS_FILE=$(mktemp)
|
||||
cat <<EOF > "$ENTITLEMENTS_FILE"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.get-task-allow</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
echo "Unlocking: $SOURCE_BIN -> $DEST_PATH"
|
||||
codesign -s - --entitlements "$ENTITLEMENTS_FILE" -f "$DEST_PATH" 2>/dev/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ Success! You can now debug: $DEST_PATH"
|
||||
else
|
||||
echo "❌ Error: Code signing failed."
|
||||
fi
|
||||
|
||||
rm "$ENTITLEMENTS_FILE"
|
||||
14
dotfiles/config/fish/conf.d/fish_frozen_key_bindings.fish
Normal file
14
dotfiles/config/fish/conf.d/fish_frozen_key_bindings.fish
Normal file
@@ -0,0 +1,14 @@
|
||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
||||
# the 'fish_key_bindings' variable from its old default scope (universal)
|
||||
# to its new default scope (global). We recommend you delete this file
|
||||
# and configure key bindings in ~/.config/fish/config.fish if needed.
|
||||
|
||||
# set --global fish_key_bindings fish_default_key_bindings
|
||||
|
||||
# Prior to version 4.3, fish shipped an event handler that runs
|
||||
# `set --universal fish_key_bindings fish_default_key_bindings`
|
||||
# whenever the fish_key_bindings variable is erased.
|
||||
# This means that as long as any fish < 4.3 is still running on this system,
|
||||
# we cannot complete the migration.
|
||||
# As a workaround, erase the universal variable at every shell startup.
|
||||
set --erase --universal fish_key_bindings
|
||||
48
dotfiles/config/fish/conf.d/fish_frozen_theme.fish
Normal file
48
dotfiles/config/fish/conf.d/fish_frozen_theme.fish
Normal file
@@ -0,0 +1,48 @@
|
||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
||||
# theme variables from universal to global scope.
|
||||
# Don't edit this file, as it will be written by the web-config tool (`fish_config`).
|
||||
# To customize your theme, delete this file and see
|
||||
# help interactive#syntax-highlighting
|
||||
# or
|
||||
# man fish-interactive | less +/^SYNTAX.HIGHLIGHTING
|
||||
# for appropriate commands to add to ~/.config/fish/config.fish instead.
|
||||
# See also the release notes for fish 4.3.0 (run `help relnotes`).
|
||||
|
||||
set --global fish_color_autosuggestion 4D5566
|
||||
set --global fish_color_cancel --reverse
|
||||
set --global fish_color_command 39BAE6
|
||||
set --global fish_color_comment 626A73
|
||||
set --global fish_color_cwd 59C2FF
|
||||
set --global fish_color_cwd_root red
|
||||
set --global fish_color_end F29668
|
||||
set --global fish_color_error FF3333
|
||||
set --global fish_color_escape 95E6CB
|
||||
set --global fish_color_history_current --bold
|
||||
set --global fish_color_host normal
|
||||
set --global fish_color_host_remote yellow
|
||||
set --global fish_color_keyword 39BAE6
|
||||
set --global fish_color_match F07178
|
||||
set --global fish_color_normal B3B1AD
|
||||
set --global fish_color_operator E6B450
|
||||
set --global fish_color_option B3B1AD
|
||||
set --global fish_color_param B3B1AD
|
||||
set --global fish_color_quote C2D94C
|
||||
set --global fish_color_redirection FFEE99
|
||||
set --global fish_color_search_match --background=E6B450
|
||||
set --global fish_color_selection --background=E6B450
|
||||
set --global fish_color_status red
|
||||
set --global fish_color_user brgreen
|
||||
set --global fish_color_valid_path --underline
|
||||
set --global fish_pager_color_background
|
||||
set --global fish_pager_color_completion normal
|
||||
set --global fish_pager_color_description B3A06D
|
||||
set --global fish_pager_color_prefix normal --bold --underline
|
||||
set --global fish_pager_color_progress brwhite --background=cyan
|
||||
set --global fish_pager_color_secondary_background
|
||||
set --global fish_pager_color_secondary_completion
|
||||
set --global fish_pager_color_secondary_description
|
||||
set --global fish_pager_color_secondary_prefix
|
||||
set --global fish_pager_color_selected_background --background=E6B450
|
||||
set --global fish_pager_color_selected_completion
|
||||
set --global fish_pager_color_selected_description
|
||||
set --global fish_pager_color_selected_prefix
|
||||
@@ -1,48 +1,9 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR EDITOR:vim
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR __fish_initialized:4300
|
||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ewfxr/forgit
|
||||
SETUVAR _fisher_upgraded_to_4_4:\x1d
|
||||
SETUVAR _fisher_wfxr_2F_forgit_files:\x7e/\x2econfig/fish/conf\x2ed/bin\x1e\x7e/\x2econfig/fish/conf\x2ed/forgit\x2eplugin\x2efish\x1e\x7e/\x2econfig/fish/completions/_git\x2dforgit\x1e\x7e/\x2econfig/fish/completions/git\x2dforgit\x2ebash\x1e\x7e/\x2econfig/fish/completions/git\x2dforgit\x2efish
|
||||
SETUVAR fish_color_autosuggestion:4D5566
|
||||
SETUVAR fish_color_cancel:\x2d\x2dreverse
|
||||
SETUVAR fish_color_command:39BAE6
|
||||
SETUVAR fish_color_comment:626A73
|
||||
SETUVAR fish_color_cwd:59C2FF
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:F29668
|
||||
SETUVAR fish_color_error:FF3333
|
||||
SETUVAR fish_color_escape:95E6CB
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_keyword:39BAE6
|
||||
SETUVAR fish_color_match:F07178
|
||||
SETUVAR fish_color_normal:B3B1AD
|
||||
SETUVAR fish_color_operator:E6B450
|
||||
SETUVAR fish_color_option:B3B1AD
|
||||
SETUVAR fish_color_param:B3B1AD
|
||||
SETUVAR fish_color_quote:C2D94C
|
||||
SETUVAR fish_color_redirection:FFEE99
|
||||
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3dE6B450
|
||||
SETUVAR fish_color_selection:\x2d\x2dbackground\x3dE6B450
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell\x0aType\x20\x60help\x60\x20for\x20instructions\x20on\x20how\x20to\x20use\x20fish
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_background:\x1d
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_secondary_background:\x1d
|
||||
SETUVAR fish_pager_color_secondary_completion:\x1d
|
||||
SETUVAR fish_pager_color_secondary_description:\x1d
|
||||
SETUVAR fish_pager_color_secondary_prefix:\x1d
|
||||
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dE6B450
|
||||
SETUVAR fish_pager_color_selected_completion:\x1d
|
||||
SETUVAR fish_pager_color_selected_description:\x1d
|
||||
SETUVAR fish_pager_color_selected_prefix:\x1d
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Sourced by zshrc as well as bash.
|
||||
# Should only use POSIX shell constructs.
|
||||
# shellcheck shell=sh
|
||||
|
||||
umask 027
|
||||
|
||||
@@ -40,7 +42,7 @@ if [ -z "${BROWSER}" ] ; then
|
||||
fi
|
||||
|
||||
# For virtualenvwrapper
|
||||
export WORKON_HOME=$HOME/.virtualenvs
|
||||
export WORKON_HOME="$HOME/.virtualenvs"
|
||||
|
||||
# GPG full key id
|
||||
export GPG_ID=7FD58D9A196DCEEEAD671F94F4D7A7915DEA789B
|
||||
@@ -118,18 +120,13 @@ unset _SSH_AUTH_LINK
|
||||
# Setup XDG-like dirs on MacOS
|
||||
# Based on https://leebyron.com/til/mac-xdg/
|
||||
if [ "$(uname)" = "Darwin" ] ; then
|
||||
original_options=$(echo "$-")
|
||||
set -a
|
||||
# Anything set here will be exported
|
||||
: "${XDG_BIN_HOME:=$HOME/.local/bin}"
|
||||
: "${XDG_CACHE_HOME:=$HOME/Library/Caches}"
|
||||
: "${XDG_CONFIG_HOME:=$HOME/.config}"
|
||||
: "${XDG_DATA_HOME:=$HOME/.local/share}"
|
||||
: "${XDG_RUNTIME_DIR:=$TMPDIR/runtime-$UID}"
|
||||
: "${XDG_STATE_HOME:=$HOME/.local/state}"
|
||||
set -f # Temporarily disable globbing to handle options with special characters
|
||||
set -- "-$original_options"
|
||||
unset original_options
|
||||
export XDG_BIN_HOME="${XDG_BIN_HOME:-$HOME/.local/bin}"
|
||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/Library/Caches}"
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||
# Using id -u for better POSIX compatibility than $UID
|
||||
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-$TMPDIR/runtime-$(id -u)}"
|
||||
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||
fi
|
||||
|
||||
if test -e "$HOME/.localenv"; then
|
||||
|
||||
Reference in New Issue
Block a user