Compare commits
24
Commits
fbf80f998e
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bd4128229 | ||
|
|
79f7de709b | ||
|
|
df9c7af7da | ||
|
|
d908668eb7 | ||
|
|
e1869613cb | ||
|
|
c3bb25368a | ||
|
|
86ee065654 | ||
|
|
dd8cb18988 | ||
|
|
3f7fe4eb1c | ||
|
|
7d13a9a5a8 | ||
|
|
e79533e2b3 | ||
|
|
37be19d798 | ||
|
|
2585b99600 | ||
|
|
b4cc65f859 | ||
|
|
1ac70e8b31 | ||
|
|
2db2310c00 | ||
|
|
6591f6b020 | ||
|
|
74f4b9b1be | ||
|
|
d21bd1caac | ||
|
|
3a931d41d8 | ||
|
|
590cf94393 | ||
|
|
d02587437d | ||
|
|
95cf86ae5f | ||
|
|
f4ab71c1fc |
@@ -0,0 +1,4 @@
|
|||||||
|
configs/colors.fish
|
||||||
|
fish_variables
|
||||||
|
fish_variables*
|
||||||
|
themes
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
# fish completion for copilot
|
||||||
|
# Generated by `copilot completion fish`. Do not edit by hand.
|
||||||
|
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'login' -d 'Authenticate with Copilot'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'help' -d 'Display help information'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'init' -d 'Initialize Copilot instructions'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'update' -d 'Download the latest version'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'version' -d 'Display version information'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'plugin' -d 'Manage plugins'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'mcp' -d 'Manage MCP servers'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'plugins' -d 'Inspect configured plugins across kinds'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'skill' -d 'Manage skills'
|
||||||
|
complete -c copilot -n '__fish_use_subcommand' -f -a 'completion' -d 'Generate a shell completion script'
|
||||||
|
complete -c copilot -l version -s v -f -d 'show version information'
|
||||||
|
complete -c copilot -l interactive -s i -r -d 'Start interactive mode and automatically execute this prompt'
|
||||||
|
complete -c copilot -l prompt -s p -r -d 'Execute a prompt in non-interactive mode (exits after completion)'
|
||||||
|
complete -c copilot -l silent -s s -f -d 'Output only the agent response (no stats), useful for scripting with -p'
|
||||||
|
complete -c copilot -l enable-memory -f -d 'Enable memory in prompt mode (disabled by default)'
|
||||||
|
complete -c copilot -l model -r -d 'Set the AI model to use (use \'auto\' to let Copilot pick automatically)'
|
||||||
|
complete -c copilot -l effort -l reasoning-effort -r -d 'Set the reasoning effort level' -a 'none minimal low medium high xhigh max'
|
||||||
|
complete -c copilot -l context -r -d 'Set the context window tier (overrides persisted setting)' -a 'default long_context'
|
||||||
|
complete -c copilot -l enable-reasoning-summaries -f -d 'Request reasoning summaries for OpenAI models'
|
||||||
|
complete -c copilot -l agent -r -d 'Specify a custom agent to use'
|
||||||
|
complete -c copilot -l resume -s r -r -d 'Resume from a previous session (optionally specify existing session ID, task ID, ID prefix, or name; name matching is exact, case-insensitive)'
|
||||||
|
complete -c copilot -l continue -f -d 'Resume the most recent session'
|
||||||
|
complete -c copilot -l name -s n -r -d 'Set a name for the new session'
|
||||||
|
complete -c copilot -l session-id -r -d 'Resume an existing session or task by ID, or set the UUID for a new session'
|
||||||
|
complete -c copilot -l connect -r -d 'Connect directly to a remote session (optionally specify session ID or task ID)'
|
||||||
|
complete -c copilot -l allow-all-tools -f -d 'Allow all tools to run automatically without confirmation; required for non-interactive mode'
|
||||||
|
complete -c copilot -l allow-all-paths -f -d 'Disable file path verification and allow access to any path'
|
||||||
|
complete -c copilot -l disallow-temp-dir -f -d 'Prevent automatic access to the system temporary directory'
|
||||||
|
complete -c copilot -l no-custom-instructions -f -d 'Disable loading of custom instructions from AGENTS.md and related files'
|
||||||
|
complete -c copilot -l no-auto-update -f -d 'Disable downloading CLI update automatically (disabled by default in CI environments)'
|
||||||
|
complete -c copilot -l no-ask-user -f -d 'Disable the ask_user tool (agent works autonomously without asking questions)'
|
||||||
|
complete -c copilot -l banner -f -d 'Show the startup banner'
|
||||||
|
complete -c copilot -l no-color -f -d 'Disable all color output'
|
||||||
|
complete -c copilot -l screen-reader -f -d 'Enable screen reader optimizations'
|
||||||
|
complete -c copilot -l plain-diff -f -d 'Disable rich diff rendering (syntax highlighting via diff tool specified by git config)'
|
||||||
|
complete -c copilot -s C -r -d 'Change working directory before doing anything else'
|
||||||
|
complete -c copilot -l log-dir -r -d 'Set log file directory (default: ~/.copilot/logs/)'
|
||||||
|
complete -c copilot -l extension-sdk-path -r -d 'Override the bundled @github/copilot-sdk injected into extension subprocesses with a local `copilot-sdk/` folder. Invalid paths fall back to the bundled SDK.'
|
||||||
|
complete -c copilot -l log-level -r -d 'Set the log level' -a 'none error warning info debug all default'
|
||||||
|
complete -c copilot -l stream -r -d 'Enable or disable streaming mode' -a 'on off'
|
||||||
|
complete -c copilot -l output-format -r -d 'Output format: \'text\' (default) or \'json\' (JSONL, one JSON object per line)' -a 'text json'
|
||||||
|
complete -c copilot -l share -r -d 'Share session to markdown file after completion in non-interactive mode (default: ./copilot-session-<id>.md)'
|
||||||
|
complete -c copilot -l share-gist -f -d 'Share session to a secret GitHub gist after completion in non-interactive mode'
|
||||||
|
complete -c copilot -l add-dir -r -d 'Add a directory to the allowed list for file access (can be used multiple times)'
|
||||||
|
complete -c copilot -l attachment -r -d 'Attach a file (image or native document) to the initial prompt; only valid in non-interactive mode (can be used multiple times)'
|
||||||
|
complete -c copilot -l disable-mcp-server -r -d 'Disable a specific MCP server (can be used multiple times)'
|
||||||
|
complete -c copilot -l disable-builtin-mcps -f -d 'Disable all built-in MCP servers (currently: github-mcp-server)'
|
||||||
|
complete -c copilot -l enable-all-github-mcp-tools -f -d 'Enable all GitHub MCP server tools instead of the default CLI subset. Overrides --add-github-mcp-toolset and --add-github-mcp-tool options.'
|
||||||
|
complete -c copilot -l add-github-mcp-toolset -r -d 'Add a toolset to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "all" for all toolsets.'
|
||||||
|
complete -c copilot -l add-github-mcp-tool -r -d 'Add a tool to enable for the GitHub MCP server instead of the default CLI subset (can be used multiple times). Use "*" for all tools.'
|
||||||
|
complete -c copilot -l plugin-dir -r -d 'Load a plugin from a local directory (can be used multiple times)'
|
||||||
|
complete -c copilot -l additional-mcp-config -r -d 'Additional MCP servers configuration as JSON string or file path (prefix with @) (can be used multiple times; augments config from ~/.copilot/mcp-config.json for this session)'
|
||||||
|
complete -c copilot -l allow-all-mcp-server-instructions -f -d 'Include initialization instructions from all MCP servers in the system prompt instead of only allowlisted servers'
|
||||||
|
complete -c copilot -l allow-tool -r -d 'Tools the CLI has permission to use; will not prompt for permission'
|
||||||
|
complete -c copilot -l deny-tool -r -d 'Tools the CLI does not have permission to use; will not prompt for permission'
|
||||||
|
complete -c copilot -l available-tools -r -d 'Only these tools will be available to the model'
|
||||||
|
complete -c copilot -l excluded-tools -r -d 'These tools will not be available to the model'
|
||||||
|
complete -c copilot -l secret-env-vars -r -d 'Environment variable names whose values are stripped from shell and MCP server environments and redacted from output (e.g., --secret-env-vars=MY_KEY,OTHER_KEY)'
|
||||||
|
complete -c copilot -l allow-url -r -d 'Allow access to specific URLs or domains'
|
||||||
|
complete -c copilot -l deny-url -r -d 'Deny access to specific URLs or domains, takes precedence over --allow-url'
|
||||||
|
complete -c copilot -l allow-all-urls -f -d 'Allow access to all URLs without confirmation'
|
||||||
|
complete -c copilot -l allow-all -f -d 'Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)'
|
||||||
|
complete -c copilot -l yolo -f -d 'Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls)'
|
||||||
|
complete -c copilot -l max-autopilot-continues -r -d 'Maximum number of continuation messages in autopilot mode'
|
||||||
|
complete -c copilot -l mode -r -d 'Set the initial agent mode' -a 'interactive plan autopilot'
|
||||||
|
complete -c copilot -l autopilot -f -d 'Start in autopilot mode'
|
||||||
|
complete -c copilot -l plan -f -d 'Start in plan mode'
|
||||||
|
complete -c copilot -l experimental -f -d 'Enable experimental features'
|
||||||
|
complete -c copilot -l no-experimental -f -d 'Disable experimental features'
|
||||||
|
complete -c copilot -l bash-env -r -d 'Enable BASH_ENV support for bash shells (on|off)'
|
||||||
|
complete -c copilot -l no-bash-env -f -d 'Disable BASH_ENV support for bash shells'
|
||||||
|
complete -c copilot -l mouse -r -d 'Enable mouse support in alt screen mode (on|off)'
|
||||||
|
complete -c copilot -l no-mouse -f -d 'Disable mouse support in alt screen mode'
|
||||||
|
complete -c copilot -l acp -f -d 'Start as Agent Client Protocol server'
|
||||||
|
complete -c copilot -l remote -f -d 'Enable remote control of your session from GitHub web and mobile'
|
||||||
|
complete -c copilot -l no-remote -f -d 'Disable remote control of your session from GitHub web and mobile'
|
||||||
|
complete -c copilot -l remote-export -f -d 'Export your session to GitHub web and mobile (read-only; does not enable remote control)'
|
||||||
|
complete -c copilot -l no-remote-export -f -d 'Disable exporting your session to GitHub web and mobile (also disables remote control)'
|
||||||
|
complete -c copilot -l max-ai-credits -r -d 'Set max AI credits for this session'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from login' -l host -r -d 'GitHub host URL (default: https://github.com)'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'install' -d 'Install a plugin'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'uninstall' -d 'Uninstall a plugin'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'update' -d 'Update a plugin'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'list' -d 'List installed plugins'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'marketplace' -d 'Manage plugin marketplaces'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from update' -l all -f -d 'Update all installed plugins'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'add' -d 'Add a marketplace'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'remove' -d 'Remove a marketplace'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'list' -d 'List registered marketplaces'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'browse' -d 'Browse plugins in a marketplace'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'update' -d 'Update marketplace plugin catalogs'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace; and __fish_seen_subcommand_from remove' -l force -s f -f -d 'Force removal even if plugins are installed'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'list' -d 'List configured MCP servers'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'get' -d 'Show server details'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'add' -d 'Add an MCP server'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'remove' -d 'Remove an MCP server'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from list' -l json -f -d 'Output as JSON'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l json -f -d 'Output as JSON'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l show-secrets -f -d 'Show full environment variable and header values (masked by default)'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l transport -r -d 'Server transport' -a 'stdio http sse'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l env -r -d 'Environment variable (KEY=VALUE, can be repeated)'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l header -r -d 'HTTP header for remote servers, can be repeated'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l tools -r -d 'Tool filter: "*" for all, comma-separated list, or "" for none'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l timeout -r -d 'Timeout in milliseconds'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l json -f -d 'Output added config as JSON'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from add' -l show-secrets -f -d 'Show full environment variable and header values in output, masked by default'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'list' -d 'List configured plugins across kinds'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'enable' -d 'Enable a configured tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'disable' -d 'Disable a configured tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'remove' -d 'Remove an installed tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'rm' -d 'Remove an installed tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'install' -d 'Install a new tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins' -f -a 'add' -d 'Install a new tool'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from list' -l kind -r -d 'Filter by kind. Repeatable or comma-separated. Supported: plugin, mcp, skill, instruction, lsp.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from list' -l scope -r -d 'Filter by scope. Repeatable or comma-separated. Supported: user, repository, organization, plugin, builtin, unknown.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from list' -l json -f -d 'Emit machine-readable JSON instead of grouped text'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from enable' -l kind -r -d 'Kind of tool to enable. One of: plugin, mcp, skill.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from disable' -l kind -r -d 'Kind of tool to disable. One of: plugin, mcp, skill.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from remove' -l kind -r -d 'Kind of tool to remove. One of: plugin, mcp.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from rm' -l kind -r -d 'Kind of tool to remove. One of: plugin, mcp.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from install' -l kind -r -d 'Kind of tool to install. Currently only \'plugin\' is supported.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from plugins; and __fish_seen_subcommand_from add' -l kind -r -d 'Kind of tool to install. Currently only \'plugin\' is supported.'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from skill' -f -a 'list' -d 'List available skills'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from skill' -f -a 'add' -d 'Add a skill from a file, URL, or directory'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from skill' -f -a 'remove' -d 'Remove a skill or custom skill directory'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from skill; and __fish_seen_subcommand_from list' -l json -f -d 'Output as JSON'
|
||||||
|
complete -c copilot -n '__fish_seen_subcommand_from skill; and __fish_seen_subcommand_from add' -l project -f -d 'Install the skill into the project\'s .github/skills directory'
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# Completions for custom scripts from https://git.honney333.work/honney/custom_scripts
|
||||||
|
function __fish_custom_scripts_complete_video_files
|
||||||
|
__fish_complete_suffix .mp4 .mkv .avi .mov .webm .m4v .flv .ts .mts .m2ts .wmv
|
||||||
|
end
|
||||||
|
|
||||||
|
# === Scripts with no arguments ===
|
||||||
|
complete -c deinterlacing_cpu.sh -f -d "Deinterlace hardcoded MKV file using CPU (yadif/x264)"
|
||||||
|
complete -c deinterlacing_gpu.sh -f -d "Deinterlace hardcoded file using VAAPI GPU acceleration"
|
||||||
|
complete -c generate-thumb -f -d "Generate thumbnails for video files via scene detection"
|
||||||
|
complete -c list_folder_empty -f -d "List non-empty subdirectories and file extension types"
|
||||||
|
complete -c show_path -f -d "Display each PATH entry on a separate line"
|
||||||
|
complete -c time_add.py -f -d "Sum space-separated timecodes from user input"
|
||||||
|
complete -c sub_dub -f -d "Analyze MKV files and update Excel spreadsheet"
|
||||||
|
|
||||||
|
# === Scripts with mode as first argument ===
|
||||||
|
complete -c append -n "not __fish_seen_subcommand_from front back ext" -k -a "front" -d "Prepend string to filename"
|
||||||
|
complete -c append -n "not __fish_seen_subcommand_from front back ext" -k -a "back" -d "Append string to filename"
|
||||||
|
complete -c append -n "not __fish_seen_subcommand_from front back ext" -k -a "ext" -d "Add string before file extension"
|
||||||
|
complete -c append -n "__fish_seen_subcommand_from front back ext" -a "(__fish_complete_directories)" -d "Target directory"
|
||||||
|
complete -c deappend -n "not __fish_seen_subcommand_from front back ext" -k -a "front" -d "Remove prefix from filename"
|
||||||
|
complete -c deappend -n "not __fish_seen_subcommand_from front back ext" -k -a "back" -d "Remove suffix from filename"
|
||||||
|
complete -c deappend -n "not __fish_seen_subcommand_from front back ext" -k -a "ext" -d "Remove file extension"
|
||||||
|
complete -c deappend -n "__fish_seen_subcommand_from front back ext" -a "(__fish_complete_directories)" -d "Target directory"
|
||||||
|
complete -c tracker.py -n "not __fish_seen_subcommand_from add sub ranking" -k -a "add" -d "Increment usage count"
|
||||||
|
complete -c tracker.py -n "not __fish_seen_subcommand_from add sub ranking" -k -a "sub" -d "Decrement usage count"
|
||||||
|
complete -c tracker.py -n "not __fish_seen_subcommand_from add sub ranking" -k -a "ranking" -d "Show usage ranking"
|
||||||
|
complete -c video-audio -n "not __fish_seen_subcommand_from extract include" -k -a "extract" -d "Extract audio from MKV files"
|
||||||
|
complete -c video-audio -n "not __fish_seen_subcommand_from extract include" -k -a "include" -d "Re-include extracted audio into MKVs"
|
||||||
|
complete -c video-audio -n "__fish_seen_subcommand_from extract include" -a "(__fish_complete_directories)" -d "Video directory"
|
||||||
|
|
||||||
|
# === Scripts with flags ===
|
||||||
|
complete -c count_files -l undo -d "Undo previous numbering"
|
||||||
|
complete -c remove_fname_last_n -l undo -d "Undo previous rename"
|
||||||
|
complete -c split_mkv_by_chapter -l only_between -d "Only output between given timestamps"
|
||||||
|
complete -c split_mkv_by_chapter -a "(__fish_custom_scripts_complete_video_files)" -d "Input MKV file"
|
||||||
|
complete -c substract_episode_num.py -s n -l dry-run -d "Dry run (show without modifying)"
|
||||||
|
|
||||||
|
# === Scripts accepting video files and/or directories ===
|
||||||
|
complete -c ff -d "Display detailed media info (codec, resolution, audio, subs, bitrate)"
|
||||||
|
complete -c ff -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c set_1_ger -d "Set first audio track language to German in MKV files"
|
||||||
|
complete -c set_1_ger -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c set_audio_lang -d "Set/overwrite audio track language metadata"
|
||||||
|
complete -c set_audio_lang -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c simple_ffprobe_script -d "Display detailed video file info"
|
||||||
|
complete -c simple_ffprobe_script -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c extract_audio -d "Extract audio tracks from video files"
|
||||||
|
complete -c extract_audio -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c extract_audio.py -d "Extract all audio tracks as MP3"
|
||||||
|
complete -c extract_audio.py -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c extract_subtitles -d "Extract subtitle tracks from video files"
|
||||||
|
complete -c extract_subtitles -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
complete -c extract_subtitles.py -d "Extract all subtitle tracks as SRT"
|
||||||
|
complete -c extract_subtitles.py -a "(__fish_custom_scripts_complete_video_files) (__fish_complete_directories)"
|
||||||
|
|
||||||
|
# === Scripts accepting video files only ===
|
||||||
|
complete -c ffbitrate -d "Display overall bitrate of a video file"
|
||||||
|
complete -c ffbitrate -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
complete -c ffsplit -d "Split video file into segments at given timestamps"
|
||||||
|
complete -c ffsplit -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
complete -c split_mkv_by_chapter.py -d "Split MKV at chapter boundaries"
|
||||||
|
complete -c split_mkv_by_chapter.py -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
complete -c embed_audio -d "Embed MP3 audio track into video file"
|
||||||
|
complete -c embed_audio -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
complete -c embed_subtitles -d "Embed subtitle file into video file"
|
||||||
|
complete -c embed_subtitles -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
complete -c embed_subtitles.py -d "Embed matching .srt subtitles into video"
|
||||||
|
complete -c embed_subtitles.py -a "(__fish_custom_scripts_complete_video_files)"
|
||||||
|
|
||||||
|
# === Scripts accepting directories ===
|
||||||
|
complete -c recount_files -d "Re-number files starting from given offset"
|
||||||
|
complete -c recount_files -a "(__fish_complete_directories)"
|
||||||
|
complete -c remove_fname_last_n -d "Remove last N characters from filenames (before ext)"
|
||||||
|
complete -c remove_fname_last_n -a "(__fish_complete_directories)"
|
||||||
|
complete -c rename_to_first_n -d "Truncate filenames to first N characters (before ext)"
|
||||||
|
complete -c rename_to_first_n -a "(__fish_complete_directories)"
|
||||||
|
complete -c rename_filtered -d "Rename files using character scheme"
|
||||||
|
complete -c rename_filtered -a "(__fish_complete_directories)"
|
||||||
|
|
||||||
|
# === Scripts with special argument patterns ===
|
||||||
|
complete -c create_folder_counting -d "Create folders with counting range"
|
||||||
|
complete -c create_folder_date -d "Create folders for each date in date range"
|
||||||
|
complete -c filter_extra -d "Move MKVs shorter than duration to extra folder"
|
||||||
|
complete -c grayjay -d "Launch Grayjay desktop application"
|
||||||
|
complete -c sub_dub.py -d "Update spreadsheet row with media info"
|
||||||
|
complete -c substract_episode_num.py -a "(__fish_complete_directories)"
|
||||||
|
|
||||||
|
# Skipped (folder-only):
|
||||||
|
# fftesting, sync_delete, rename_episodes
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# 1. Point to your custom Fisher repository
|
||||||
|
set -gx fisher_path ~/.config/fisher
|
||||||
|
if test -d $fisher_path
|
||||||
|
# 2. Append the custom folders to Fish's native search lists if they aren't already there
|
||||||
|
if not contains $fisher_path/functions $fish_function_path
|
||||||
|
set fish_function_path $fisher_path/functions $fish_function_path
|
||||||
|
end
|
||||||
|
|
||||||
|
if not contains $fisher_path/completions $fish_complete_path
|
||||||
|
set fish_complete_path $fisher_path/completions $fish_complete_path
|
||||||
|
end
|
||||||
|
|
||||||
|
# 3. Simulate the conf.d execution by natively sourcing third-party configuration files
|
||||||
|
for file in $fisher_path/conf.d/*.fish
|
||||||
|
if not test -s $file
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
source $file
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
function fish_user_key_bindings
|
||||||
|
# Word movement
|
||||||
|
bind ctrl-right forward-word
|
||||||
|
bind ctrl-left backward-word
|
||||||
|
|
||||||
|
# Deletes a standard word (matches the movement of ctrl-left/right)
|
||||||
|
bind ctrl-backspace backward-kill-word
|
||||||
|
|
||||||
|
# Deletes "more" - a big word (ignores punctuation, stops only at spaces)
|
||||||
|
bind alt-backspace backward-kill-bigword
|
||||||
|
bind shift-backspace backward-kill-bigword
|
||||||
|
|
||||||
|
# Your other existing bindings
|
||||||
|
bind alt-d kill-word
|
||||||
|
bind ctrl-w backward-kill-path-component
|
||||||
|
bind alt-. history-token-search-backward
|
||||||
|
bind ctrl-x,ctrl-e edit_command_buffer
|
||||||
|
end
|
||||||
+4
-2
@@ -3,5 +3,7 @@ set -q XDG_DATA_HOME
|
|||||||
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
|
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
|
||||||
or set -gx OMF_PATH "$HOME/.local/share/omf"
|
or set -gx OMF_PATH "$HOME/.local/share/omf"
|
||||||
|
|
||||||
# Load Oh My Fish configuration.
|
# Load Oh My Fish configuration if it exists.
|
||||||
source $OMF_PATH/init.fish
|
if test -f $OMF_PATH/init.fish
|
||||||
|
source $OMF_PATH/init.fish
|
||||||
|
end
|
||||||
|
|||||||
+49
-51
@@ -1,61 +1,59 @@
|
|||||||
# source ~/.config/fish/configs/aliases.fish
|
# Replace frozen key bindings migration (deletes fish_frozen_key_bindings.fish)
|
||||||
|
set --global fish_key_bindings fish_default_key_bindings
|
||||||
|
|
||||||
# if test -f $HOME/.config/fish/alias.fish ]
|
#
|
||||||
# source $HOME/.config/fish/alias.fish
|
# for fisher: ~/.config/fish/conf.d/00_fisher_path.fish
|
||||||
# end
|
#
|
||||||
|
|
||||||
set distro (cat /etc/os-release | grep ^ID= | cut -d '=' -f 2 | tr -d '"')
|
|
||||||
|
|
||||||
if status is-interactive
|
if status is-interactive
|
||||||
# Commands to run in interactive sessions can go here
|
# Get distro ID from /etc/os-release
|
||||||
|
if test -f /etc/os-release
|
||||||
|
set distro (grep '^ID=' /etc/os-release | cut -d= -f2 | string lower)
|
||||||
|
else
|
||||||
|
set distro unknown
|
||||||
|
end
|
||||||
|
|
||||||
# Load the theme
|
# Auto Complete
|
||||||
if test -f $HOME/.config/fish/configs/theme.fish
|
source ~/.config/fish/completions/*
|
||||||
source $HOME/.config/fish/configs/theme.fish
|
|
||||||
end
|
|
||||||
|
|
||||||
# Load the aliases
|
if test -f $HOME/.config/fish/configs/theme.fish
|
||||||
if test -f $HOME/.config/fish/configs/alias_custom-script.fish
|
source $HOME/.config/fish/configs/theme.fish
|
||||||
source $HOME/.config/fish/configs/alias_custom-script.fish
|
end
|
||||||
end
|
|
||||||
if test -f $HOME/.config/fish/configs/alias_fixing.fish
|
|
||||||
source $HOME/.config/fish/configs/alias_fixing.fish
|
|
||||||
end
|
|
||||||
if test -f $HOME/.config/fish/configs/alias_useful.fish
|
|
||||||
source $HOME/.config/fish/configs/alias_useful.fish
|
|
||||||
end
|
|
||||||
if test -f $HOME/.config/fish/configs/function_usefull.fish
|
|
||||||
source $HOME/.config/fish/configs/function_usefull.fish
|
|
||||||
end
|
|
||||||
|
|
||||||
# ~/.config/fish/config.fish
|
if test -f $HOME/.config/fish/configs/alias_custom-script.fish
|
||||||
|
source $HOME/.config/fish/configs/alias_custom-script.fish
|
||||||
|
end
|
||||||
|
if test -f $HOME/.config/fish/configs/alias_fixing.fish
|
||||||
|
source $HOME/.config/fish/configs/alias_fixing.fish
|
||||||
|
end
|
||||||
|
if test -f $HOME/.config/fish/configs/alias_useful.fish
|
||||||
|
source $HOME/.config/fish/configs/alias_useful.fish
|
||||||
|
end
|
||||||
|
|
||||||
# Get the distribution name and version
|
if test -f $HOME/.config/fish/configs/env.fish
|
||||||
|
source $HOME/.config/fish/configs/env.fish
|
||||||
|
end
|
||||||
|
|
||||||
switch $distro
|
switch $distro
|
||||||
case 'fedora'
|
case fedora
|
||||||
if test -f $HOME/.config/fish/configs/fedora_config.fish
|
if test -f $HOME/.config/fish/configs/fedora_config.fish
|
||||||
source $HOME/.config/fish/configs/fedora_config.fish
|
source $HOME/.config/fish/configs/fedora_config.fish
|
||||||
end
|
end
|
||||||
case 'arch'
|
case arch
|
||||||
if test -f $HOME/.config/fish/configs/arch_config.fish
|
if test -f $HOME/.config/fish/configs/arch_config.fish
|
||||||
source $HOME/.config/fish/configs/arch_config.fish
|
source $HOME/.config/fish/configs/arch_config.fish
|
||||||
end
|
end
|
||||||
case 'ubuntu'
|
case ubuntu
|
||||||
if test -f $HOME/.config/fish/configs/ubuntu_config.fish
|
if test -f $HOME/.config/fish/configs/ubuntu_config.fish
|
||||||
source $HOME/.config/fish/configs/ubuntu_config.fish
|
source $HOME/.config/fish/configs/ubuntu_config.fish
|
||||||
end
|
end
|
||||||
case '*'
|
case '*'
|
||||||
if test -f $HOME/.config/fish/configs/default_config.fish
|
if test -f $HOME/.config/fish/configs/default_config.fish
|
||||||
source $HOME/.config/fish/configs/default_config.fish
|
source $HOME/.config/fish/configs/default_config.fish
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if test -x /usr/bin/fastfetch
|
|
||||||
fastfetch
|
if test -e /usr/bin/fastfetch
|
||||||
|
fastfetch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX $HOME ; set -gx PATH $HOME/.cabal/bin $PATH /home/honney/.ghcup/bin # ghcup-env
|
|
||||||
# set -Ux PYENV_ROOT $HOME/.pyenv
|
|
||||||
# fish_add_path $PYENV_ROOT/bin
|
|
||||||
# pyenv init - | source
|
|
||||||
|
|||||||
+37
-10
@@ -3,17 +3,44 @@
|
|||||||
# Fixing some Programs that do not know Kitty or Alacritty
|
# Fixing some Programs that do not know Kitty or Alacritty
|
||||||
|
|
||||||
# Check if the local terminal supports color (kitty, alacritty, etc.)
|
# Check if the local terminal supports color (kitty, alacritty, etc.)
|
||||||
if test "$TERM" = "xterm-kitty" -o "$TERM" = "alacritty"
|
if test "$TERM" = "xterm-kitty"; or test "$TERM" = "alacritty"
|
||||||
# If we're in a non-standard terminal, force TERM=xterm-256color for SSH
|
alias ssh='env TERM=xterm-256color ssh'
|
||||||
alias ssh 'env TERM=xterm-256color ssh'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -f $HOME/.config/fish/alias.fish
|
# if command -q zoxide
|
||||||
source $HOME/.config/fish/alias.fish
|
# zoxide init fish | source
|
||||||
|
# alias cd='z'
|
||||||
|
# end
|
||||||
|
|
||||||
|
set -gx fisher_path ~/.config/fisher
|
||||||
|
|
||||||
|
################ FIX STEAM ####################################################
|
||||||
|
|
||||||
|
function steam_fix
|
||||||
|
if test -f /usr/share/applications/steam.desktop
|
||||||
|
# Check if the credential helper is already in the file
|
||||||
|
if ! grep -q "PrefersNonDefaultGPU=true" -q '/X-KDE-RunOnDiscreteGpu=true' /usr/share/applications/steam.desktop
|
||||||
|
echo "Steam is allready fixed"
|
||||||
|
else
|
||||||
|
echo "Fixing Steam"
|
||||||
|
# Remove the specific GPU lines using sudo and sed
|
||||||
|
sudo sed -i -e '/PrefersNonDefaultGPU=true/d' -e '/X-KDE-RunOnDiscreteGpu=true/d' /usr/share/applications/steam.desktop
|
||||||
|
echo "Steam has been fixed."
|
||||||
|
end
|
||||||
|
else
|
||||||
|
echo "no /usr/share/applications/steam.desktop file"
|
||||||
|
echo "could not fix steam"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -e /usr/bin/zoxide
|
################ FIX BRAVE ####################################################
|
||||||
eval (zoxide init fish)
|
|
||||||
zoxide init fish | source
|
function brave_fix
|
||||||
alias cd='z'
|
if test -f ~/.config/BraveSoftware/Brave-Browser/SingletonLock
|
||||||
end
|
# Check if the credential helper is already in the file
|
||||||
|
rm ~/.config/BraveSoftware/Brave-Browser/SingletonLock
|
||||||
|
else
|
||||||
|
echo "Brave not blocked by SingletonLock"
|
||||||
|
echo "could not fix brave"
|
||||||
|
end
|
||||||
|
end
|
||||||
+293
-132
@@ -2,195 +2,317 @@
|
|||||||
# In ~/.config/fish/configs/alias_useful.fish
|
# In ~/.config/fish/configs/alias_useful.fish
|
||||||
#
|
#
|
||||||
|
|
||||||
################# STUFF YOU HAVE INSTALLED #####################################
|
alias mount_all='sudo $HOME/.config/fish/scripts/mount.sh'
|
||||||
|
|
||||||
|
################ COMMON ALIASES ################################################
|
||||||
|
|
||||||
alias remount='sudo mount -a'
|
alias remount='sudo mount -a'
|
||||||
|
|
||||||
alias mount_config='sudo nano /etc/fstab'
|
alias mount_config='sudo nano /etc/fstab'
|
||||||
|
alias own='sudo chown -R "$USER":"$USER"'
|
||||||
alias force_delete='sudo rm -rf' # Delete Folder/Files with included Folder/Files
|
|
||||||
|
|
||||||
alias own='sudo chown -R "$USER":"$USER" themes'
|
|
||||||
alias right='sudo chmod -R 755'
|
alias right='sudo chmod -R 755'
|
||||||
|
function reload
|
||||||
|
if command -q omf
|
||||||
|
omf reload
|
||||||
|
else
|
||||||
|
clear
|
||||||
|
exec fish
|
||||||
|
end
|
||||||
|
end
|
||||||
|
alias fish_config='nano $HOME/.config/fish/config.fish'
|
||||||
|
alias ip='ip -color'
|
||||||
|
alias psmem='ps auxf | sort -nr -k 4'
|
||||||
|
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
|
||||||
|
alias jctl='journalctl -p 3 -xb'
|
||||||
|
alias ...='cd ../..'
|
||||||
|
alias ....='cd ../../..'
|
||||||
|
alias .....='cd ../../../..'
|
||||||
|
alias ......='cd ../../../../..'
|
||||||
|
alias dir='dir --color=auto'
|
||||||
|
alias vdir='vdir --color=auto'
|
||||||
|
alias tarnow='tar -acf'
|
||||||
|
alias untar='tar -zxvf'
|
||||||
|
|
||||||
alias reload='clear && omf reload'
|
################ HELPERS ######################################################
|
||||||
|
|
||||||
alias fish_config='nano $HOME/.config/fish/config.fish' # Open the fish Config in Text editor
|
|
||||||
|
|
||||||
alias ip 'ip -color'
|
|
||||||
|
|
||||||
alias psmem 'ps auxf | sort -nr -k 4'
|
|
||||||
alias psmem10 'ps auxf | sort -nr -k 4 | head -10'
|
|
||||||
|
|
||||||
alias jctl 'journalctl -p 3 -xb'
|
|
||||||
|
|
||||||
# Common use
|
|
||||||
alias ... 'cd ../..'
|
|
||||||
alias .... 'cd ../../..'
|
|
||||||
alias ..... 'cd ../../../..'
|
|
||||||
alias ...... 'cd ../../../../..'
|
|
||||||
|
|
||||||
alias dir 'dir --color=auto'
|
|
||||||
alias vdir 'vdir --color=auto'
|
|
||||||
|
|
||||||
alias tarnow 'tar -acf '
|
|
||||||
alias untar 'tar -zxvf '
|
|
||||||
|
|
||||||
################# HELPER #####################################################
|
|
||||||
|
|
||||||
function help_pdf
|
function help_pdf
|
||||||
echo "Best Tool to combine pdf: PDF Arranger"
|
echo "Best Tool to combine pdf: PDF Arranger"
|
||||||
echo "Best Tool for OCR: OCRMYPDF but you need to install the teseracts for your languages"
|
echo "Best Tool for OCR: OCRMYPDF but you need to install the tesseracts for your languages"
|
||||||
echo "Best Tool to write in PDFs: XOURNAL++"
|
echo "Best Tool to write in PDFs: XOURNAL++"
|
||||||
end
|
end
|
||||||
|
|
||||||
################# STUFF YOU MAY NOT HAVE #####################################
|
if test -e /usr/bin/rsync
|
||||||
|
function rcp
|
||||||
|
if test (count $argv) -lt 2
|
||||||
|
echo "Usage: rcp SOURCE... DESTINATION"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
rsync -avh --progress $argv
|
||||||
|
end
|
||||||
|
|
||||||
|
function rmv
|
||||||
|
if test (count $argv) -lt 2
|
||||||
|
echo "Usage: rmv SOURCE... DESTINATION"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
rsync -avh --progress --remove-source-files $argv
|
||||||
|
end
|
||||||
|
else
|
||||||
|
function rcp
|
||||||
|
echo "'rsync' is not installed. Install it via your package manager."
|
||||||
|
end
|
||||||
|
function rmv
|
||||||
|
echo "'rsync' is not installed. Install it via your package manager."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -e /usr/bin/nano
|
||||||
|
function nanorm
|
||||||
|
if test (count $argv) -lt 1
|
||||||
|
echo "Usage: nanorm {FILE}"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
nano $argv[1]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
function nanorm
|
||||||
|
echo "'nano' is not installed. Install it via your package manager."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function source --description "Source files with auto-detection (replaces builtin source)"
|
||||||
|
# --- 0. Handle standard input piping (Fixes background script sourcing) ---
|
||||||
|
if not isatty stdin
|
||||||
|
builtin source $argv
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
# --- 1. Handle Flags First ---
|
||||||
|
if test (count $argv) -gt 0; and string match -q -- "--*" $argv[1]
|
||||||
|
builtin source $argv
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
# --- 2. Check: Is a file/argument given? ---
|
||||||
|
if test (count $argv) -gt 0
|
||||||
|
set file $argv[1]
|
||||||
|
set -e argv[1]
|
||||||
|
|
||||||
|
# Check if the explicit path actually exists as a file
|
||||||
|
if not test -f "$file"
|
||||||
|
echo "source: No such file: '$file'" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
# Logic: Is it .fish?
|
||||||
|
if string match -q "*.fish" -- $file
|
||||||
|
builtin source $file $argv
|
||||||
|
return
|
||||||
|
# Logic: Is it .bash?
|
||||||
|
else if string match -q "*.bash" -- $file or string match -q "*.sh" -- $file
|
||||||
|
if command -q bass
|
||||||
|
bass source $file $argv
|
||||||
|
return
|
||||||
|
else
|
||||||
|
echo "source: 'bass' is not installed. Install it to source bash files." >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
# Logic: Else (unknown file type)
|
||||||
|
else
|
||||||
|
echo "source: Unknown file extension for '$file'. Please specify a .fish or .bash file." >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
# --- 3. No file given: Check for local venv directories ---
|
||||||
|
else
|
||||||
|
# Target directories to check in order of preference
|
||||||
|
set venv_dirs .venv venv
|
||||||
|
|
||||||
|
for dir in $venv_dirs
|
||||||
|
if test -d "$dir"
|
||||||
|
# Check for .fish activator first
|
||||||
|
if test -f "$dir/bin/activate.fish"
|
||||||
|
builtin source "$dir/bin/activate.fish"
|
||||||
|
return
|
||||||
|
|
||||||
|
# Check for .bash activator second
|
||||||
|
else if test -f "$dir/bin/activate" or test -f "$dir/bin/activate.bash"
|
||||||
|
# Resolve which bash file exists
|
||||||
|
set bash_act "$dir/bin/activate"
|
||||||
|
if test -f "$dir/bin/activate.bash"
|
||||||
|
set bash_act "$dir/bin/activate.bash"
|
||||||
|
end
|
||||||
|
|
||||||
|
if command -q bass
|
||||||
|
bass source $bash_act
|
||||||
|
return
|
||||||
|
else
|
||||||
|
echo "source: Found bash virtual env in '$dir', but 'bass' is not installed." >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Logic: Else error (No venv found and no args provided)
|
||||||
|
echo "source: No file specified and no local venv or .venv directory found." >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
################ TERMINAL-SPECIFIC ############################################
|
||||||
|
|
||||||
if test "$TERM" = "xterm-kitty"
|
if test "$TERM" = "xterm-kitty"
|
||||||
alias icat='kitty +kitten icat'
|
alias icat='kitty +kitten icat'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
################ PYTHON #######################################################
|
||||||
|
|
||||||
if test -e /usr/bin/python3
|
if test -e /usr/bin/python3
|
||||||
alias python='python3'
|
alias python='python3'
|
||||||
alias py='python3'
|
alias py='python3'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Easier Ollama Commands
|
if test -e /usr/bin/python3
|
||||||
if test -e /usr/bin/ollama
|
function mkvenv
|
||||||
alias llama_start='ollama serve' # Start the LLama server
|
if not python3 -c "import venv" ^/dev/null
|
||||||
alias llama3='ollama run llama3' # Start the LLama Chat
|
echo "Python3 'venv' module is not available. Install python3-venv via your package manager."
|
||||||
end
|
return 1
|
||||||
|
end
|
||||||
|
if test (count $argv) -lt 1
|
||||||
if test -e /usr/bin/btop
|
echo "Usage: mkvenv {folder name}"
|
||||||
alias tasks='btop'
|
return 1
|
||||||
end
|
end
|
||||||
|
python3 -m venv $argv[1]
|
||||||
if test -e /usr/bin/mpv
|
if test -f $argv[1]/bin/activate.fish
|
||||||
alias uni_play='mpv --vo=tct' # Plays a video in terminal with Unicode
|
source $argv[1]/bin/activate.fish
|
||||||
alias asci_play='mpv --vo=caca' # Plays a video in terminal with ASCII
|
else
|
||||||
else
|
echo "Error: Could not find activate.fish in $argv[1]/bin/"
|
||||||
for cmd in uni_play asci_play
|
return 1
|
||||||
function $cmd
|
|
||||||
echo "You need to install mpv Inorder to use these commands: https://github.com/mpv-player/mpv"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
|
function mkvenv
|
||||||
|
|
||||||
function mkvenv
|
|
||||||
if not type -q python3
|
|
||||||
echo "Python3 is not installed. Please install Python3 to use mkvenv."
|
echo "Python3 is not installed. Please install Python3 to use mkvenv."
|
||||||
return 1
|
|
||||||
end
|
|
||||||
if not python3 -c "import venv" ^/dev/null
|
|
||||||
echo "Python3 'venv' module is not available. Please install it (e.g., 'python3-venv' on Debian/Ubuntu)."
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
if test (count $argv) -lt 1
|
|
||||||
echo "Usage: mkvenv {folder name}"
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
python3 -m venv $argv[1]
|
|
||||||
if test -f $argv[1]/bin/activate.fish
|
|
||||||
source $argv[1]/bin/activate.fish
|
|
||||||
else
|
|
||||||
echo "Error: Could not find activate.fish in $argv[1]/bin/"
|
|
||||||
return 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check if eza exists in either location
|
if test -e /usr/bin/python3
|
||||||
if test -x /usr/bin/eza -o -x $HOME/.cargo/bin/eza
|
function src
|
||||||
|
if not test -d .venv
|
||||||
|
echo "Cannot activate: .venv directory does not exist."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
if not test -d .venv/bin
|
||||||
|
echo "Cannot activate: .venv/bin directory does not exist."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
if test -f .venv/bin/activate.fish
|
||||||
|
source .venv/bin/activate.fish
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
if test -f .venv/bin/activate.bash
|
||||||
|
if test -e /usr/bin/bass
|
||||||
|
bass source .venv/bin/activate.bash
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "'bass' is not installed. Install it via your package manager to source bash scripts."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
echo "No usable activation script found in .venv/bin/"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
function src
|
||||||
|
echo "Python3 is not installed. Please install Python3 to use src."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
################ OLLAMA ######################################################
|
||||||
|
|
||||||
|
if test -e /usr/bin/ollama
|
||||||
|
alias llama_start='ollama serve'
|
||||||
|
alias llama3='ollama run llama3'
|
||||||
|
end
|
||||||
|
|
||||||
|
################ EZA ##########################################################
|
||||||
|
|
||||||
|
if test -x /usr/bin/eza
|
||||||
function ls
|
function ls
|
||||||
command eza -a --color=always --group-directories-first --icons $argv # Just more beautiful
|
command eza -a --color=always --group-directories-first --icons=always $argv
|
||||||
end
|
end
|
||||||
function lr
|
function lr
|
||||||
command eza -al --color=always --group-directories-first --icons $argv # With rights and Owner
|
command eza -al --color=always --group-directories-first --icons=always $argv
|
||||||
end
|
end
|
||||||
function ll
|
function ll
|
||||||
command eza -l --color=always --group-directories-first --icons $argv # Hidden Stuff is hidden
|
command eza -l --color=always --group-directories-first --icons=always $argv
|
||||||
end
|
end
|
||||||
function lt
|
function lt
|
||||||
command eza -aT --color=always --group-directories-first --icons $argv # Tree View may take some time
|
command eza -aT --color=always --group-directories-first --icons=always $argv
|
||||||
end
|
end
|
||||||
function l.
|
function l.
|
||||||
command eza -ald --color=always --group-directories-first --icons .* $argv # Only Hidden Stuff
|
command eza -ald --color=always --group-directories-first --icons=always .* $argv
|
||||||
end
|
end
|
||||||
function lf
|
function lf
|
||||||
command eza -aD --color=always --group-directories-first --icons $argv # Only Folder
|
command eza -aD --color=always --group-directories-first --icons=always $argv
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# Define dummy functions that remind user to install eza
|
|
||||||
for cmd in lr ll lt l. lf
|
for cmd in lr ll lt l. lf
|
||||||
function $cmd
|
function $cmd --inherit-variable cmd
|
||||||
echo "The command 'eza' is not installed. Please install 'eza' to use this: https://github.com/eza-community/eza"
|
echo "The command 'eza' is not installed. Please install 'eza' to use this: https://github.com/eza-community/eza"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -e /usr/bin/ugrep
|
################ BTOP #########################################################
|
||||||
alias grep 'ugrep --color=auto'
|
|
||||||
alias egrep 'ugrep -E --color=auto'
|
if test -e /usr/bin/btop
|
||||||
alias fgrep 'ugrep -F --color=auto'
|
alias tasks='btop'
|
||||||
|
end
|
||||||
|
|
||||||
|
################ MPV ##########################################################
|
||||||
|
|
||||||
|
if test -e /usr/bin/mpv
|
||||||
|
alias uni_play='mpv --vo=tct'
|
||||||
|
alias asci_play='mpv --vo=caca'
|
||||||
else
|
else
|
||||||
for cmd in egrep fgrep
|
for cmd in uni_play asci_play
|
||||||
function $cmd
|
function $cmd --inherit-variable cmd
|
||||||
echo "The command 'ugrep' is not installed. Please install 'ugrep' to use this: https://github.com/Genivia/ugrep"
|
echo "The command 'mpv' is not installed. Please install mpv to use this: https://github.com/mpv-player/mpv"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -e /usr/bin/wget
|
################ GREP #########################################################
|
||||||
alias wget 'wget -c '
|
|
||||||
|
if test -e /usr/bin/ugrep
|
||||||
|
alias grep='ugrep --color=auto'
|
||||||
|
alias egrep='ugrep -E --color=auto'
|
||||||
|
alias fgrep='ugrep -F --color=auto'
|
||||||
|
else
|
||||||
|
alias egrep='grep -E'
|
||||||
|
alias fgrep='grep -F'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
################ WGET #########################################################
|
||||||
|
|
||||||
|
if test -e /usr/bin/wget
|
||||||
|
alias wget='wget -c'
|
||||||
|
end
|
||||||
|
|
||||||
|
################ OCRMYPDF #####################################################
|
||||||
|
|
||||||
if test -e /usr/bin/ocrmypdf
|
if test -e /usr/bin/ocrmypdf
|
||||||
alias ocrmypdf 'ocrmypdf --deskew --clean --rotate-pages'
|
alias ocrmypdf='ocrmypdf --deskew --clean --rotate-pages'
|
||||||
else
|
else
|
||||||
alias ocrmypdf 'echo "The command 'ocrmypdf' is not installed. Please install 'ocrmypdf' to use this: https://github.com/ocrmypdf/OCRmyPDF"'
|
function ocrmypdf
|
||||||
end
|
echo "The command 'ocrmypdf' is not installed. Install it via your package manager: https://github.com/ocrmypdf/OCRmyPDF"
|
||||||
|
|
||||||
function rcp
|
|
||||||
if test (count $argv) -lt 2
|
|
||||||
echo "Usage: rcp SOURCE... DESTINATION"
|
|
||||||
return 1
|
|
||||||
end
|
end
|
||||||
rsync -avh --progress $argv
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function rmv
|
################ YAZI #########################################################
|
||||||
if test (count $argv) -lt 2
|
|
||||||
echo "Usage: rmv SOURCE... DESTINATION"
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
rsync -avh --progress --remove-source-files $arg
|
|
||||||
end
|
|
||||||
|
|
||||||
function nanorm
|
if test -e /usr/bin/yazi
|
||||||
if test (count $argv) -lt 1
|
|
||||||
echo "Usage: nanorm {FILE}"
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
set arg $argv[1]
|
|
||||||
if test -f $arg
|
|
||||||
rm $arg
|
|
||||||
end
|
|
||||||
nano $arg
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e /usr/bin/reflector
|
|
||||||
alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist'
|
|
||||||
alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist'
|
|
||||||
alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist'
|
|
||||||
alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist'
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e $HOME/.config/sway/config
|
|
||||||
alias sway_config='nano $HOME/.config/sway/config' # Open the fish Config in Text editor
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e /usr/bin/yazi -o -e /usr/local/bin/yazi
|
|
||||||
function y
|
function y
|
||||||
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
set tmp (mktemp -t "yazi-cwd.XXXXXX")
|
||||||
yazi $argv --cwd-file="$tmp"
|
yazi $argv --cwd-file="$tmp"
|
||||||
@@ -200,7 +322,46 @@ if test -e /usr/bin/yazi -o -e /usr/local/bin/yazi
|
|||||||
rm -f -- "$tmp"
|
rm -f -- "$tmp"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
function yazi
|
for cmd in yazi y
|
||||||
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
|
function $cmd --inherit-variable cmd
|
||||||
|
echo "The command 'yazi' is not installed. Please install 'yazi' to use this: https://github.com/sxyazi/yazi"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
################ SUDO #########################################################
|
||||||
|
|
||||||
|
if test -e /usr/bin/sudo-rs
|
||||||
|
alias sudo=sudo-rs
|
||||||
|
end
|
||||||
|
|
||||||
|
################ FLASH ISO ####################################################
|
||||||
|
|
||||||
|
if test -e /usr/bin/dd
|
||||||
|
function flashiso --description "Flash an ISO to a target drive with dd"
|
||||||
|
if test (count $argv) -ne 2
|
||||||
|
echo "Usage: flashiso {ISO} {target drive}"
|
||||||
|
echo "Example: flashiso ubuntu-25.10-desktop-amd64.iso /dev/sdb"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
sudo dd if=$argv[1] of=$argv[2] bs=4M status=progress oflag=sync
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
################ GIT ##########################################################
|
||||||
|
|
||||||
|
function git_cred
|
||||||
|
if test -f .git/config
|
||||||
|
# Check if the credential helper is already in the file
|
||||||
|
if grep -q "git-honney333-work-cred" .git/config
|
||||||
|
echo "Credential helper is already configured in .git/config"
|
||||||
|
else
|
||||||
|
echo "Adding Password tool to git"
|
||||||
|
# Append the blocks with a clean newline separator
|
||||||
|
echo -e "\n[credential]\n helper = !"$HOME"/.bin/git-honney333-work-cred" >> .git/config
|
||||||
|
end
|
||||||
|
else
|
||||||
|
echo "no .git/config file"
|
||||||
|
echo "could not add the credentials helper"
|
||||||
|
end
|
||||||
|
end
|
||||||
+143
-34
@@ -2,57 +2,166 @@
|
|||||||
# ~/.config/fish/configs/arch_config.fish
|
# ~/.config/fish/configs/arch_config.fish
|
||||||
#
|
#
|
||||||
|
|
||||||
alias git_update='$HOME/.config/fish/scripts/git-update.sh'
|
source $HOME/.config/fish/configs/uni.fish
|
||||||
|
|
||||||
alias mount_all='$HOME/.config/fish/scripts/mount.sh'
|
function get_pkg_version
|
||||||
alias umount_all='$HOME/.config/fish/scripts/umount.sh'
|
set pkg $argv[1]
|
||||||
|
|
||||||
alias print_cam='ssh honney@192.168.1.184'
|
if pacman -Q $pkg >/dev/null 2>&1
|
||||||
|
pacman -Q $pkg
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function kernel_to_pkg
|
||||||
|
set kernel (uname -r)
|
||||||
|
|
||||||
|
if string match -q "*zen*" $kernel
|
||||||
|
echo linux-zen
|
||||||
|
else if string match -q "*lts*" $kernel
|
||||||
|
echo linux-lts
|
||||||
|
else if string match -q "*hardened*" $kernel
|
||||||
|
echo linux-hardened
|
||||||
|
else
|
||||||
|
echo linux
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function updateall
|
function updateall
|
||||||
# Get current Discord version (if installed)
|
######## Get current versions (if installed)
|
||||||
if pacman -Q discord >/dev/null 2>&1
|
if command -q discord
|
||||||
set version_before (pacman -Q discord)
|
set discord_version (get_pkg_version discord)
|
||||||
else
|
|
||||||
set version_before ""
|
|
||||||
end
|
end
|
||||||
|
set kernel_version (get_pkg_version (kernel_to_pkg))
|
||||||
|
|
||||||
# Run updates
|
######## Run PACMAN updates
|
||||||
|
set_color cyan
|
||||||
|
echo "#### Updating pacman ####"
|
||||||
|
set_color normal
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu
|
||||||
|
|
||||||
# Get new Discord version (if installed)
|
######## Do additional Discord Updates
|
||||||
if pacman -Q discord >/dev/null 2>&1
|
if command -q discord; and test "$discord_version" != "$(get_pkg_version discord)"
|
||||||
set version_after (pacman -Q discord)
|
set_color cyan
|
||||||
else
|
echo "Discord version changed: $discord_version -> $(get_pkg_version discord)"
|
||||||
set version_after ""
|
set_color normal
|
||||||
|
if test -e /usr/bin/curl
|
||||||
|
echo "Running Vencord installer..."
|
||||||
|
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
|
||||||
|
else
|
||||||
|
echo "'curl' is not installed. Install it to update Discord plugins."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compare versions
|
######## Run FLATPAK Updates
|
||||||
if test "$version_before" != "$version_after"
|
|
||||||
echo "Discord version changed: $version_before -> $version_after"
|
if test -e /usr/bin/flatpak
|
||||||
echo "Running extra command..."
|
set_color cyan
|
||||||
sh -c "$(curl -sS https://raw.githubusercontent.com/Vendicated/VencordInstaller/main/install.sh)"
|
echo "#### Updating flatpak ####"
|
||||||
|
set_color normal
|
||||||
|
flatpak update
|
||||||
end
|
end
|
||||||
|
|
||||||
flatpak update
|
######## Run GIT Updates
|
||||||
yay -Sua --sudoloop
|
|
||||||
|
set_color cyan
|
||||||
|
echo "#### Updating quickshell ####"
|
||||||
|
set_color normal
|
||||||
|
if test -d ~/.config/quickshell && test -d ~/.config/quickshell/.git
|
||||||
|
pushd ~/.config/quickshell/
|
||||||
|
git pull
|
||||||
|
popd
|
||||||
|
end
|
||||||
|
|
||||||
|
set_color cyan
|
||||||
|
echo "#### Updating fish ####"
|
||||||
|
set_color normal
|
||||||
|
if test -d ~/.config/fish && test -d ~/.config/fish/.git
|
||||||
|
pushd ~/.config/fish/
|
||||||
|
git pull
|
||||||
|
popd
|
||||||
|
end
|
||||||
|
|
||||||
|
set_color cyan
|
||||||
|
echo "#### Updating hyprland ####"
|
||||||
|
set_color normal
|
||||||
|
if test -d ~/.config/hypr && test -d ~/.config/hypr/.git
|
||||||
|
pushd ~/.config/hypr/
|
||||||
|
git pull
|
||||||
|
popd
|
||||||
|
end
|
||||||
|
|
||||||
|
######## Run AUR Updates
|
||||||
|
|
||||||
|
set_color cyan
|
||||||
|
echo "#### Updating AUR ####"
|
||||||
|
set_color normal
|
||||||
|
if test -e /usr/bin/paru
|
||||||
|
paru -Sua --sudoloop
|
||||||
|
else if test -e /usr/bin/yay
|
||||||
|
yay -Sua --sudoloop
|
||||||
|
end
|
||||||
|
|
||||||
|
######## Restart if Kernel Updated
|
||||||
|
|
||||||
|
if test "$kernel_version" != "$(get_pkg_version $(kernel_to_pkg))"
|
||||||
|
set_color cyan
|
||||||
|
echo "Kernel changed: $kernel_version -> $(get_pkg_version $(kernel_to_pkg))"
|
||||||
|
read -P "Reboot now? [y/N]: " answer
|
||||||
|
set_color normal
|
||||||
|
|
||||||
|
if test "$answer" = "y" -o "$answer" = "Y"
|
||||||
|
reboot
|
||||||
|
else
|
||||||
|
echo "Skipping reboot."
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias big='expac -H M "%m\t%n" | sort -h | nl' # Sort installed packages according to size in MB (expac must be installed)
|
alias fixpacman='sudo rm -f /var/lib/pacman/db.lck'
|
||||||
alias fixpacman='sudo rm /var/lib/pacman/db.lck'
|
|
||||||
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
|
|
||||||
|
|
||||||
alias rip 'expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl'
|
if test -e /usr/bin/expac
|
||||||
|
alias rip='expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nl'
|
||||||
|
alias big='expac -H M "%m\t%n" | sort -h | nl'
|
||||||
|
else
|
||||||
|
alias rip="echo 'expac is not installed. Install it to list last deinstalled packages.'"
|
||||||
|
alias big="echo 'expac is not installed. Install it to list biggest packages.'"
|
||||||
|
end
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
while pacman -Qdtq
|
while pacman -Qdtq >/dev/null 2>&1
|
||||||
sudo pacman -R (pacman -Qdtq)
|
set orphans (pacman -Qdtq 2>/dev/null)
|
||||||
|
if test -z "$orphans"
|
||||||
|
break
|
||||||
|
end
|
||||||
|
sudo pacman -R $orphans
|
||||||
|
end
|
||||||
|
echo "No more orphaned packages."
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -x $HOME/.local/python-3.11.9/bin/python3.11
|
||||||
|
alias py311="$HOME/.local/python-3.11.9/bin/python3.11"
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -e /usr/bin/tmux
|
||||||
|
function quickshell-reload
|
||||||
|
if test -e /usr/bin/quickshell
|
||||||
|
tmux kill-session -t qs 2>/dev/null
|
||||||
|
tmux new-session -d -s qs 'quickshell'
|
||||||
|
else
|
||||||
|
echo "'quickshell' is not installed. Install it via your package manager."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
function quickshell-reload
|
||||||
|
echo "'tmux' is not installed. Install it via your package manager."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set -x QT_QPA_PLATFORMTHEME qt5ct
|
if test -e /usr/bin/reflector
|
||||||
|
alias mirror='sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist'
|
||||||
set -x XCURSOR_THEME "DJ-FOX-C"
|
alias mirrora='sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist'
|
||||||
set -x XCURSOR_SIZE 24
|
alias mirrord='sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist'
|
||||||
|
alias mirrors='sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist'
|
||||||
alias py311="$HOME/.local/python-3.11.9/bin/python3.11"
|
end
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# ~/.config/fish/configs/env.fish
|
||||||
|
#
|
||||||
|
|
||||||
|
if test -d $HOME/.bin
|
||||||
|
fish_add_path $HOME/.bin
|
||||||
|
end
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# ── Fish + bobthefish color theme ────────────────────────────────────────────
|
||||||
|
# Edit the hex values below to customize. Each variable has a comment explaining
|
||||||
|
# what it controls so you can pick intuitive colors.
|
||||||
|
|
||||||
|
# ── Bobthefish prompt colors ─────────────────────────────────────────────────
|
||||||
|
|
||||||
|
set -g theme_username_color "#cba6f7" # Username text (try: purple, pink, cyan)
|
||||||
|
set -g theme_hostname_color "#89b4fa" # Hostname text (try: blue, cyan)
|
||||||
|
set -g theme_git_branch_color "#a6e3a1" # Git branch name (try: green, teal)
|
||||||
|
set -g theme_git_dirty_color "#f38ba8" # Git dirty/untracked (try: red, peach)
|
||||||
|
set -g theme_git_staged_color "#a6e3a1" # Git staged files (try: green)
|
||||||
|
set -g theme_pwd_color "#cba6f7" # Current directory (try: purple, yellow)
|
||||||
|
set -g theme_background_color "#1e1e2e" # Terminal background (darkest color)
|
||||||
|
set -g theme_foreground_color "#cdd6f4" # Default text (lightest color)
|
||||||
|
|
||||||
|
# ── Fish syntax highlighting ─────────────────────────────────────────────────
|
||||||
|
# These control how fish colors different parts of your command line.
|
||||||
|
|
||||||
|
set --global fish_color_normal "#cdd6f4" # Plain text
|
||||||
|
set --global fish_color_command "#89b4fa" # Valid commands like ls, git
|
||||||
|
set --global fish_color_param "#cdd6f4" # Command arguments and options
|
||||||
|
set --global fish_color_error "#f38ba8" # Invalid commands or syntax
|
||||||
|
set --global fish_color_cancel "#f38ba8" # Cancelled/aborted commands
|
||||||
|
|
||||||
|
set --global fish_color_quote "#a6e3a1" # Quoted strings '...' "..."
|
||||||
|
set --global fish_color_redirection "#cba6f7" --bold # Pipes | and redirects >
|
||||||
|
set --global fish_color_operator "#94e2d5" # && || and other operators
|
||||||
|
set --global fish_color_escape "#f5c2e7" # Escape sequences like \n
|
||||||
|
|
||||||
|
set --global fish_color_comment "#6c7086" # Comments starting with #
|
||||||
|
set --global fish_color_autosuggestion "#6c7086" # Auto-suggested text (dim)
|
||||||
|
|
||||||
|
set --global fish_color_selection "#cdd6f4" --bold --background="#45475a"
|
||||||
|
set --global fish_color_search_match "#1e1e2e" --background="#f9e2af"
|
||||||
|
|
||||||
|
set --global fish_color_status "#f38ba8" # Exit status of last command
|
||||||
|
set --global fish_color_cwd "#a6e3a1" # Current directory in prompt
|
||||||
|
set --global fish_color_cwd_root "#f38ba8" # Current dir when root
|
||||||
|
set --global fish_color_user "#cba6f7" # Username in prompt
|
||||||
|
set --global fish_color_host "#89b4fa" # Hostname in prompt
|
||||||
|
set --global fish_color_host_remote "#a6e3a1" # Remote SSH hostname
|
||||||
|
set --global fish_color_end "#94e2d5" # End-of-line markers
|
||||||
|
|
||||||
|
set --global fish_color_history_current --bold # History search current match
|
||||||
|
set --global fish_color_valid_path --underline # Valid paths (auto-underline)
|
||||||
|
|
||||||
|
# ── Pager (completions menu) colors ──────────────────────────────────────────
|
||||||
|
|
||||||
|
set --global fish_pager_color_completion "#a6adc8" # Completion items
|
||||||
|
set --global fish_pager_color_description "#6c7086" -i # Descriptions
|
||||||
|
set --global fish_pager_color_prefix "#cba6f7" --bold --underline
|
||||||
|
set --global fish_pager_color_progress "#cdd6f4" --background="#45475a"
|
||||||
|
set --global fish_pager_color_selected_background "#45475a"
|
||||||
@@ -5,6 +5,10 @@
|
|||||||
|
|
||||||
alias updateall='sudo dnf upgrade --refresh && flatpak update'
|
alias updateall='sudo dnf upgrade --refresh && flatpak update'
|
||||||
|
|
||||||
if test -e $HOME/.cargo/bin/eza
|
if test -x $HOME/.cargo/bin/eza
|
||||||
set -gx PATH $HOME/.cargo/bin $PATH $PATH
|
fish_add_path $HOME/.cargo/bin
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -f $HOME/.config/fish/configs/uni.fish
|
||||||
|
source $HOME/.config/fish/configs/uni.fish
|
||||||
end
|
end
|
||||||
|
|||||||
+8
-41
@@ -1,46 +1,13 @@
|
|||||||
# Load pywal colors (extract from ~/.cache/wal/colors.json)
|
# load matugen-generated colors
|
||||||
if test -e $HOME/.cache/wal/colors.json
|
if test -f $HOME/.config/fish/configs/colors.fish
|
||||||
set -g theme_0 (jq -r '.colors.color0' ~/.cache/wal/colors.json) # Primary color
|
source $HOME/.config/fish/configs/colors.fish
|
||||||
set -g theme_1 (jq -r '.colors.color1' ~/.cache/wal/colors.json) # Secondary color (e.g., for git, @)
|
|
||||||
set -g theme_2 (jq -r '.colors.color2' ~/.cache/wal/colors.json) # Third color (e.g., for hostname)
|
|
||||||
set -g background_color (jq -r '.special.background' ~/.cache/wal/colors.json) # Background color
|
|
||||||
set -g foreground_color (jq -r '.special.foreground' ~/.cache/wal/colors.json) # Foreground color
|
|
||||||
else
|
else
|
||||||
set -g background_color "#1e1e2e" # Dark slate
|
if test -f $HOME/.config/fish/configs/fallback_colors.fish
|
||||||
set -g foreground_color "#cdd6f4" # Soft white/light gray
|
source $HOME/.config/fish/configs/fallback_colors.fish
|
||||||
|
end
|
||||||
# Primary and accent colors
|
|
||||||
set -g theme_0 "#a6e3a1" # Green - success, directories
|
|
||||||
set -g theme_1 "#f38ba8" # Red - errors, git changes
|
|
||||||
set -g theme_2 "#89b4fa" # Blue - hostnames, info
|
|
||||||
|
|
||||||
# Extra accent colors
|
|
||||||
set -g theme_3 "#f9e2af" # Yellow - warnings
|
|
||||||
set -g theme_4 "#cba6f7" # Magenta - user prompts
|
|
||||||
set -g theme_5 "#94e2d5" # Cyan - secondary info
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# BOBTHEFISH COLORING: Apply pywal colors to the bobthefish theme
|
# Bobthefish display settings
|
||||||
|
|
||||||
# Username Color
|
|
||||||
set -g theme_username_color $theme_0
|
|
||||||
|
|
||||||
# Hostname Color
|
|
||||||
set -g theme_hostname_color $theme_2
|
|
||||||
|
|
||||||
# Git prompt color
|
|
||||||
set -g theme_git_branch_color $theme_1
|
|
||||||
set -g theme_git_dirty_color $theme_1
|
|
||||||
set -g theme_git_staged_color $theme_2
|
|
||||||
|
|
||||||
# Current directory color
|
|
||||||
set -g theme_pwd_color $theme_0
|
|
||||||
|
|
||||||
# Set background and foreground based on pywal theme
|
|
||||||
set -g theme_background_color $background_color
|
|
||||||
set -g theme_foreground_color $foreground_color
|
|
||||||
|
|
||||||
# Retain all existing theme settings (don't overwrite the options you have)
|
|
||||||
set -g theme_display_git yes
|
set -g theme_display_git yes
|
||||||
set -g theme_display_git_dirty no
|
set -g theme_display_git_dirty no
|
||||||
set -g theme_display_git_untracked no
|
set -g theme_display_git_untracked no
|
||||||
@@ -80,4 +47,4 @@ set -g theme_color_scheme dark
|
|||||||
set -g fish_prompt_pwd_dir_length 0
|
set -g fish_prompt_pwd_dir_length 0
|
||||||
set -g theme_project_dir_length 1
|
set -g theme_project_dir_length 1
|
||||||
set -g theme_newline_cursor yes
|
set -g theme_newline_cursor yes
|
||||||
set -g theme_newline_prompt '$ '
|
set -g theme_newline_prompt '$ '
|
||||||
@@ -4,3 +4,7 @@
|
|||||||
|
|
||||||
alias updateall='sudo apt upgrade -y && sudo apt update -y'
|
alias updateall='sudo apt upgrade -y && sudo apt update -y'
|
||||||
alias uninstall='sudo apt purge -y'
|
alias uninstall='sudo apt purge -y'
|
||||||
|
|
||||||
|
if test -f $HOME/.config/fish/configs/uni.fish
|
||||||
|
source $HOME/.config/fish/configs/uni.fish
|
||||||
|
end
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
if command -q pacman
|
||||||
|
if test -d ~/Nextcloud/UNI/26_TI/RISC-V
|
||||||
|
fish_add_path ~/Nextcloud/UNI/26_TI/RISC-V/xpack-riscv-none-elf-gcc-15.2.0-1-linux-x64/xpack-riscv-none-elf-gcc-15.2.0-1/bin
|
||||||
|
fish_add_path ~/Nextcloud/UNI/26_TI/RISC-V/verible-v0.0-4053-g89d4d98a-linux-static-x86_64/verible-v0.0-4053-g89d4d98a/bin
|
||||||
|
end
|
||||||
|
if test -d ~/Projects/RISC-V
|
||||||
|
set -gx XILINX_VIVADO ~/Projects/RISC-V/vivado/Vivado/2022.2
|
||||||
|
fish_add_path ~/Projects/RISC-V/vivado/Vivado/2022.2/bin
|
||||||
|
set -gx LM_LICENSE_FILE ~/Projects/RISC-V/intel/LR-160568_License.dat
|
||||||
|
set -gx SALT_LICENSE_SERVER $LM_LICENSE_FILE
|
||||||
|
fish_add_path ~/Projects/RISC-V/intel/questa_fse/bin
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -f /.dockerenv; or test -f /run/.containerenv
|
||||||
|
echo "In Container"
|
||||||
|
end
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
jorgebucaran/fisher
|
||||||
|
jorgebucaran/humantime.fish
|
||||||
|
ilancosman/tide@v6
|
||||||
|
patrickf1/fzf.fish
|
||||||
|
franciscolourenco/done
|
||||||
|
jhillyerd/plugin-git
|
||||||
|
icezyclon/zoxide.fish
|
||||||
|
jorgebucaran/spark.fish
|
||||||
|
meaningful-ooo/sponge
|
||||||
|
jorgebucaran/autopair.fish
|
||||||
|
nickeb96/puffer-fish
|
||||||
|
mattmc3/magic-enter.fish
|
||||||
|
gazorby/fish-abbreviation-tips
|
||||||
|
lgathy/google-cloud-sdk-fish-completion
|
||||||
|
ankitsumitg/docker-fish-completions
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# This file contains fish universal variable definitions.
|
|
||||||
# VERSION: 3.0
|
|
||||||
SETUVAR __done_min_cmd_duration:5000
|
|
||||||
SETUVAR __done_notify_sound:1
|
|
||||||
SETUVAR __done_sway_ignore_visible:0
|
|
||||||
SETUVAR __fish_initialized:4300
|
|
||||||
SETUVAR fish_user_paths:/home/honney/\x2ebin\x1e/home/honney/\x2elocal/bin
|
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
function addpaths
|
function addpaths
|
||||||
contains -- $argv $fish_user_paths
|
if test (count $argv) -lt 1
|
||||||
or set -U fish_user_paths $fish_user_paths $argv
|
echo "Usage: addpaths <path> [more paths...]"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
for p in $argv
|
||||||
|
if not contains -- $p $fish_user_paths
|
||||||
|
fish_add_path -U $p
|
||||||
|
end
|
||||||
|
end
|
||||||
echo "Updated PATH: $PATH"
|
echo "Updated PATH: $PATH"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
function compare_sha256
|
|
||||||
if test (count $argv) -ne 2
|
|
||||||
echo "Usage: compare_sha256 <file1> <file2>"
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
set hash1 (sha256sum $argv[1] | awk '{print $1}')
|
|
||||||
set hash2 (sha256sum $argv[2] | awk '{print $1}')
|
|
||||||
|
|
||||||
if test "$hash1" = "$hash2"
|
|
||||||
echo "Match"
|
|
||||||
else
|
|
||||||
echo "Different"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
+145
-25
@@ -1,54 +1,174 @@
|
|||||||
function extract
|
function extract --description "Extract various archive formats"
|
||||||
if test (count $argv) -lt 1
|
if test (count $argv) -lt 1
|
||||||
echo "Usage: extract <archive(s)> [output_directory]"
|
echo "Usage: extract <archive(s)> [output_directory]"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set output_dir "."
|
if not command -q file
|
||||||
set archives $argv
|
echo "extract: 'file' command is required. Install it via your package manager."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
# If there's more than one argument, check the last one for a directory
|
set archives $argv
|
||||||
if test (count $argv) -gt 1
|
set output_dir "."
|
||||||
set maybe_dir $argv[-1]
|
set use_custom_dir 0
|
||||||
if not test -f $maybe_dir
|
|
||||||
set output_dir $maybe_dir
|
if test (count $argv) -eq 2
|
||||||
mkdir -p $output_dir
|
set maybe_dir $argv[2]
|
||||||
set archives $argv[1..-2]
|
if test -d "$maybe_dir"; or not test -e "$maybe_dir"
|
||||||
end
|
set output_dir "$maybe_dir"
|
||||||
else
|
mkdir -p "$output_dir"
|
||||||
# If only one argument and it's a file, create directory with same name as archive (without extension)
|
set archives $argv[1]
|
||||||
set archive $argv[1]
|
set use_custom_dir 1
|
||||||
if test -f "$archive"
|
|
||||||
set output_dir (string replace -r '\.(tar\.gz|tgz|tar\.bz2|tbz2|tar\.xz|txz|gz|bz2|xz|zst|zip|7z|rar)$' '' (basename "$archive"))
|
|
||||||
mkdir -p $output_dir
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set multi 0
|
||||||
|
if test (count $archives) -gt 1
|
||||||
|
set multi 1
|
||||||
|
end
|
||||||
|
|
||||||
for archive in $archives
|
for archive in $archives
|
||||||
if not test -f "$archive"
|
if not test -f "$archive"
|
||||||
echo "extract: '$archive' is not a valid file"
|
echo "extract: '$archive' is not a valid file"
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set base (string replace -r '\.(tar\.(gz|bz2|xz|zst)|tar|tgz|tbz2|txz|tzst|gz|bz2|xz|zst|zip|7z|rar)$' '' (basename "$archive"))
|
||||||
|
|
||||||
|
if test $multi -eq 1
|
||||||
|
set target_dir "$base"
|
||||||
|
else if test $use_custom_dir -eq 1
|
||||||
|
set target_dir "$output_dir"
|
||||||
|
else
|
||||||
|
set target_dir "$base"
|
||||||
|
end
|
||||||
|
|
||||||
set mime (file --mime-type -b "$archive")
|
set mime (file --mime-type -b "$archive")
|
||||||
|
|
||||||
switch $mime
|
switch $mime
|
||||||
case 'application/x-tar'
|
case 'application/x-tar'
|
||||||
tar -xvf "$archive" -C "$output_dir"
|
if not command -q tar
|
||||||
|
echo "extract: 'tar' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
tar -xvf "$archive" -C "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
|
||||||
case 'application/gzip'
|
case 'application/gzip'
|
||||||
tar xvzf "$archive" -C "$output_dir"
|
if string match -q '*.tar.gz' -- "$archive"; or string match -q '*.tgz' -- "$archive"
|
||||||
|
if not command -q tar
|
||||||
|
echo "extract: 'tar' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
tar -xzf "$archive" -C "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
if not command -q gzip
|
||||||
|
echo "extract: 'gzip' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
set outname (string replace -r '\.gz$' '' (basename "$archive"))
|
||||||
|
gzip -dkc "$archive" > "$output_dir/$outname"
|
||||||
|
echo "extract: decompressed '$archive' to '$output_dir/$outname'"
|
||||||
|
end
|
||||||
|
|
||||||
case 'application/x-bzip2'
|
case 'application/x-bzip2'
|
||||||
tar xvjf "$archive" -C "$output_dir"
|
if string match -q '*.tar.bz2' -- "$archive"; or string match -q '*.tbz2' -- "$archive"
|
||||||
|
if not command -q tar
|
||||||
|
echo "extract: 'tar' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
tar -xjf "$archive" -C "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
if not command -q bzip2
|
||||||
|
echo "extract: 'bzip2' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
set outname (string replace -r '\.bz2$' '' (basename "$archive"))
|
||||||
|
bzip2 -dkc "$archive" > "$output_dir/$outname"
|
||||||
|
echo "extract: decompressed '$archive' to '$output_dir/$outname'"
|
||||||
|
end
|
||||||
|
|
||||||
case 'application/x-xz'
|
case 'application/x-xz'
|
||||||
tar xvJf "$archive" -C "$output_dir"
|
if string match -q '*.tar.xz' -- "$archive"; or string match -q '*.txz' -- "$archive"
|
||||||
|
if not command -q tar
|
||||||
|
echo "extract: 'tar' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
tar -xJf "$archive" -C "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
if not command -q xz
|
||||||
|
echo "extract: 'xz' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
set outname (string replace -r '\.xz$' '' (basename "$archive"))
|
||||||
|
xz -dkc "$archive" > "$output_dir/$outname"
|
||||||
|
echo "extract: decompressed '$archive' to '$output_dir/$outname'"
|
||||||
|
end
|
||||||
|
|
||||||
case 'application/zstd'
|
case 'application/zstd'
|
||||||
tar --zstd -xvf "$archive" -C "$output_dir"
|
if string match -q '*.tar.zst' -- "$archive"; or string match -q '*.tzst' -- "$archive"
|
||||||
|
if not command -q tar
|
||||||
|
echo "extract: 'tar' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
tar --zstd -xvf "$archive" -C "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
if not command -q zstd
|
||||||
|
echo "extract: 'zstd' is not installed. Install it via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
set outname (string replace -r '\.zst$' '' (basename "$archive"))
|
||||||
|
zstd -dkc "$archive" > "$output_dir/$outname"
|
||||||
|
echo "extract: decompressed '$archive' to '$output_dir/$outname'"
|
||||||
|
end
|
||||||
|
|
||||||
case 'application/zip'
|
case 'application/zip'
|
||||||
unzip -j "$archive" -d "$output_dir"
|
if not command -q unzip
|
||||||
|
echo "extract: 'unzip' is not installed. Install it via your package manager (e.g., 'unzip' on most distros)."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
unzip "$archive" -d "$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
|
||||||
case 'application/x-7z-compressed'
|
case 'application/x-7z-compressed'
|
||||||
7z x "$archive" -o"$output_dir"
|
if command -q 7z
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
7z x "$archive" -o"$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else if command -q 7zz
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
7zz x "$archive" -o"$target_dir"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
echo "extract: '7z' or '7zz' is not installed. Install p7zip via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
case 'application/x-rar' 'application/vnd.rar'
|
case 'application/x-rar' 'application/vnd.rar'
|
||||||
unrar x -o+ "$archive" "$output_dir"
|
if command -q unrar
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
unrar x -o+ "$archive" "$target_dir/"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else if command -q rar
|
||||||
|
mkdir -p "$target_dir"
|
||||||
|
rar x -o+ "$archive" "$target_dir/"
|
||||||
|
echo "extract: extracted '$archive' to '$target_dir'"
|
||||||
|
else
|
||||||
|
echo "extract: 'unrar' or 'rar' is not installed. Install unrar via your package manager."
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
case '*'
|
case '*'
|
||||||
echo "extract: unknown file type for '$archive' ($mime)"
|
echo "extract: unknown file type for '$archive' ($mime)"
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -3,8 +3,14 @@ function findstr
|
|||||||
echo "Usage: findstr <search-string>"
|
echo "Usage: findstr <search-string>"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
if not command -q find
|
||||||
|
echo "findstr: 'find' is not installed."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
if not command -q grep
|
||||||
|
echo "findstr: 'grep' is not installed."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
set query $argv[1]
|
find . -type f -exec grep -Hn "$argv[1]" {} \;
|
||||||
|
|
||||||
find . -type f -exec grep -Hn "$query" {} \;
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# Load pywal colors
|
|
||||||
set -g theme_0 (jq -r '.colors.color0' ~/.cache/wal/colors.json) # Color0 for general text
|
|
||||||
set -g theme_1 (jq -r '.colors.color1' ~/.cache/wal/colors.json) # Color1 for highlights (e.g., @ symbol)
|
|
||||||
set -g theme_2 (jq -r '.colors.color2' ~/.cache/wal/colors.json) # Color2 for hostname
|
|
||||||
set -g background_color (jq -r '.special.background' ~/.cache/wal/colors.json) # Background color
|
|
||||||
set -g foreground_color (jq -r '.special.foreground' ~/.cache/wal/colors.json) # Foreground color
|
|
||||||
|
|
||||||
# Customize your prompt
|
|
||||||
function fish_prompt
|
|
||||||
# Set background and foreground colors
|
|
||||||
echo -n (set_color $background_color) # Set background color
|
|
||||||
echo -n (set_color $foreground_color) # Set foreground color for text
|
|
||||||
echo -n (set_color $theme_0) 'user' (set_color $theme_1) '@' (set_color $theme_2) 'host' (set_color normal) '> '
|
|
||||||
end
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
function lost_window
|
||||||
|
if not command -q hyprctl
|
||||||
|
echo "Only works with Hyprland compositor."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if test (count $argv) -lt 1
|
||||||
|
echo "Usage: lost_window <number>"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if test (count $argv) -lt 2
|
||||||
|
set addr (hyprctl clients -j \
|
||||||
|
| jq -r '.[] | select(.workspace.id == '$argv[1]') | .address' \
|
||||||
|
| head -n1)
|
||||||
|
|
||||||
|
test -n "$addr"; or return 1
|
||||||
|
|
||||||
|
hyprctl dispatch "hl.dsp.focus({window = 'address:$addr'})"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Executable → Regular
+5
-2
@@ -3,12 +3,15 @@ function pack
|
|||||||
echo "Usage: pack <archive-name> <file-or-dir> [more files...]"
|
echo "Usage: pack <archive-name> <file-or-dir> [more files...]"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
if not command -q tar
|
||||||
|
echo "pack: 'tar' is not installed. Install it via your package manager."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
set archive $argv[1]
|
set archive $argv[1]
|
||||||
set targets $argv[2..-1]
|
set targets $argv[2..-1]
|
||||||
|
|
||||||
# Ensure .tar.xz extension
|
if not string match -q '*.tar.xz' -- $archive
|
||||||
if not string match -r '\.tar\.xz$' -- $archive
|
|
||||||
set archive "$archive.tar.xz"
|
set archive "$archive.tar.xz"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
function removepath
|
function removepath
|
||||||
|
if test (count $argv) -lt 1
|
||||||
|
echo "Usage: removepath <path>"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
if set -l index (contains -i $argv[1] $PATH)
|
if set -l index (contains -i $argv[1] $PATH)
|
||||||
set --erase --universal fish_user_paths[$index]
|
set --erase --universal fish_user_paths[$index]
|
||||||
echo "Updated PATH: $PATH"
|
echo "Removed '$argv[1]' from PATH."
|
||||||
else
|
else
|
||||||
echo "$argv[1] not found in PATH: $PATH"
|
echo "'$argv[1]' not found in PATH."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ function search
|
|||||||
echo "Usage: search <string> [directory]"
|
echo "Usage: search <string> [directory]"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
if not command -q rg
|
||||||
|
echo "search: 'rg' (ripgrep) is not installed. Install it via your package manager."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
set query $argv[1]
|
set query $argv[1]
|
||||||
set dir "."
|
set dir "."
|
||||||
|
|
||||||
if test (count $argv) -ge 2
|
if test (count $argv) -ge 2
|
||||||
set dir $argv[2]
|
set dir $argv[2]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
function verify_file
|
||||||
|
if test (count $argv) -ne 2
|
||||||
|
echo "Usage: verify_file <file> <expected_hash>"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set file $argv[1]
|
||||||
|
if not test -f "$file"
|
||||||
|
echo "verify_file: '$file' is not a valid file"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set expected $argv[2]
|
||||||
|
set len (string length "$expected")
|
||||||
|
|
||||||
|
switch $len
|
||||||
|
case 32
|
||||||
|
set cmd md5sum
|
||||||
|
case 40
|
||||||
|
set cmd sha1sum
|
||||||
|
case 56
|
||||||
|
set cmd sha224sum
|
||||||
|
case 64
|
||||||
|
set cmd sha256sum
|
||||||
|
case 96
|
||||||
|
set cmd sha384sum
|
||||||
|
case 128
|
||||||
|
if command -q sha512sum
|
||||||
|
set cmd sha512sum
|
||||||
|
else if command -q b2sum
|
||||||
|
set cmd b2sum
|
||||||
|
else
|
||||||
|
echo "verify_file: no tool available for 128-char hash (sha512sum or b2sum required)"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
case '*'
|
||||||
|
echo "verify_file: unknown hash length ($len chars). Supported: md5(32), sha1(40), sha224(56), sha256(64), sha384(96), sha512/b2(128)"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if not command -q $cmd
|
||||||
|
echo "verify_file: '$cmd' is not installed."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set actual ($cmd "$file" | string split -f1 " ")
|
||||||
|
|
||||||
|
if test "$actual" = "$expected"
|
||||||
|
echo "Match"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "Mismatch"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
Executable
+149
@@ -0,0 +1,149 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
CHOICE=""
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--fisher) CHOICE="fisher"; shift ;;
|
||||||
|
--omf) CHOICE="omf"; shift ;;
|
||||||
|
*) echo "Usage: $0 [--fisher|--omf]"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
detect_pkg_manager() {
|
||||||
|
if command -v apt &>/dev/null; then
|
||||||
|
echo "apt"
|
||||||
|
elif command -v dnf &>/dev/null; then
|
||||||
|
echo "dnf"
|
||||||
|
elif command -v pacman &>/dev/null; then
|
||||||
|
echo "pacman"
|
||||||
|
elif command -v zypper &>/dev/null; then
|
||||||
|
echo "zypper"
|
||||||
|
else
|
||||||
|
echo "unknown"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_fish() {
|
||||||
|
local pm
|
||||||
|
pm=$(detect_pkg_manager)
|
||||||
|
case "$pm" in
|
||||||
|
apt)
|
||||||
|
sudo apt update && sudo apt install -y fish
|
||||||
|
;;
|
||||||
|
dnf)
|
||||||
|
sudo dnf install -y fish
|
||||||
|
;;
|
||||||
|
pacman)
|
||||||
|
sudo pacman -S --noconfirm fish
|
||||||
|
;;
|
||||||
|
zypper)
|
||||||
|
sudo zypper install -y fish
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "No supported package manager found. Please install fish manually: https://fishshell.com"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
get_plugins_file() {
|
||||||
|
local user_plugins="$HOME/.config/fish/fish_plugins"
|
||||||
|
local repo_plugins="$(dirname "$0")/fish_plugins"
|
||||||
|
if [ -f "$user_plugins" ]; then
|
||||||
|
echo "$user_plugins"
|
||||||
|
elif [ -f "$repo_plugins" ]; then
|
||||||
|
echo "$repo_plugins"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_fisher_and_plugins() {
|
||||||
|
local fisher_path="$HOME/.config/fisher"
|
||||||
|
local fish_config_dir="$HOME/.config/fish"
|
||||||
|
|
||||||
|
echo "Creating Fisher directory structure..."
|
||||||
|
mkdir -p "$fisher_path"/{functions,completions,conf.d,themes}
|
||||||
|
|
||||||
|
echo "Symlinking themes directory..."
|
||||||
|
mkdir -p "$fish_config_dir"
|
||||||
|
ln -sf "$fisher_path/themes" "$fish_config_dir/themes"
|
||||||
|
|
||||||
|
echo "Installing Fisher plugin manager..."
|
||||||
|
fish -c 'curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher'
|
||||||
|
|
||||||
|
local plugins_file
|
||||||
|
plugins_file=$(get_plugins_file)
|
||||||
|
if [ -n "$plugins_file" ]; then
|
||||||
|
echo "Installing plugins from $(basename "$plugins_file")..."
|
||||||
|
fish -c "fisher install < $plugins_file"
|
||||||
|
else
|
||||||
|
echo "No fish_plugins file found. Skipping plugin installation."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_omf() {
|
||||||
|
if [ ! -d "$HOME/.local/share/omf" ]; then
|
||||||
|
echo "Installing Oh My Fish..."
|
||||||
|
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install > install
|
||||||
|
fish install --path=~/.local/share/omf --config=~/.config/omf
|
||||||
|
else
|
||||||
|
echo "Oh My Fish already installed."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_bobthefish() {
|
||||||
|
if command -v fish &>/dev/null && [ -f "$HOME/.local/share/omf/init.fish" ]; then
|
||||||
|
echo "Installing bobthefish theme..."
|
||||||
|
fish -c 'omf install bobthefish'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_default_shell() {
|
||||||
|
local fish_path
|
||||||
|
fish_path=$(command -v fish)
|
||||||
|
if [ "$SHELL" != "$fish_path" ]; then
|
||||||
|
echo "Setting default shell to fish..."
|
||||||
|
if grep -q "^$USER:" /etc/passwd 2>/dev/null; then
|
||||||
|
chsh -s "$fish_path"
|
||||||
|
else
|
||||||
|
echo "Run this manually: chsh -s $fish_path"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Fish is already your default shell."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [ -z "$CHOICE" ]; then
|
||||||
|
while true; do
|
||||||
|
read -p "Select fish plugin manager (fisher/omf): " CHOICE
|
||||||
|
case "$CHOICE" in
|
||||||
|
fisher|omf) break ;;
|
||||||
|
*) echo "Please enter 'fisher' or 'omf'" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_fish
|
||||||
|
|
||||||
|
case "$CHOICE" in
|
||||||
|
fisher)
|
||||||
|
install_fisher_and_plugins
|
||||||
|
;;
|
||||||
|
omf)
|
||||||
|
install_omf
|
||||||
|
install_bobthefish
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
set_default_shell
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "=== Installation complete ==="
|
||||||
|
echo "Log out and back in, or run: exec fish"
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
+45
-45
@@ -1,50 +1,50 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Source the functions file
|
# Function to mount CIFS share with error handling
|
||||||
source "$HOME/.config/function_helper.sh"
|
mount_cifs() {
|
||||||
|
local source="$1"
|
||||||
# Configuration
|
local mount_point="$2"
|
||||||
SERVER_IP="192.168.1.22"
|
local options="$3"
|
||||||
CRENDENTIALS="$HOME/.cred/.smbcred"
|
|
||||||
MOUNT_POINT_RAID="$HOME/Raid/"
|
# Create mount point if missing
|
||||||
MOUNT_POINT_SSD="$HOME/Server-SSD/"
|
if [ ! -d "$mount_point" ]; then
|
||||||
PASSWORD_FILE="$HOME/.cred/credentials.txt"
|
echo "Creating mount point: $mount_point"
|
||||||
|
sudo mkdir -p "$mount_point || { echo 'Mount point creation failed'; exit 1; }"
|
||||||
# Read the password from the file
|
|
||||||
PASSWORD=$(<"$PASSWORD_FILE")
|
|
||||||
|
|
||||||
# Function to mount all shares
|
|
||||||
function mount_all() {
|
|
||||||
if ping -c 1 -W 2 $SERVER_IP > /dev/null 2>&1; then
|
|
||||||
send_notification "low" "Ping Successful" "$SERVER_IP is Up and Running. Continuing to mount." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/connect_established.svg"
|
|
||||||
# Mount RAID
|
|
||||||
if ! is_mounted "$MOUNT_POINT_RAID"; then
|
|
||||||
if echo "$PASSWORD" | sudo -S mount -t cifs -o credentials="$CRENDENTIALS",uid=1000,gid=1000 //$SERVER_IP/RAID "$MOUNT_POINT_RAID"; then
|
|
||||||
send_notification "low" "Mount Successful" "Mounted RAID at $MOUNT_POINT_RAID successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
|
||||||
else
|
|
||||||
send_notification "high" "Mount Failed" "Failed to mount RAID at $MOUNT_POINT_RAID." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
send_notification "low" "Already Mounted" "RAID is already mounted at $MOUNT_POINT_RAID." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Mount SSD
|
|
||||||
if ! is_mounted "$MOUNT_POINT_SSD"; then
|
|
||||||
if echo "$PASSWORD" | sudo -S mount -t cifs -o credentials="$CRENDENTIALS",uid=1000,gid=1000 //$SERVER_IP/Server-SSD "$MOUNT_POINT_SSD"; then
|
|
||||||
send_notification "low" "Mount Successful" "Mounted SSD at $MOUNT_POINT_SSD successfully." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-encrypted-symbolic.svg"
|
|
||||||
else
|
|
||||||
send_notification "high" "Mount Failed" "Failed to mount SSD at $MOUNT_POINT_SSD." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk-symbolic.svg"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
send_notification "low" "Already Mounted" "SSD is already mounted at $MOUNT_POINT_SSD." "$HOME/.icons/BeautyLine-Garuda/devices/scalable/drive-harddisk.svg"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
send_notification "normal" "Connection Failed" "Could not connect to IP: $SERVER_IP." "$HOME/.icons/BeautyLine-Garuda/actions/scalable/network-disconnect.svg"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Mounting $source to $mount_point with options: $options"
|
||||||
|
sudo mount -t cifs -o "$options" "$source" "$mount_point" || {
|
||||||
|
echo "Mount failed for $source. Check credentials and network."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
echo "Successfully mounted: $mount_point"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Call the mount_all function
|
# Mount FRITZ.NAS (from fstab line 1)
|
||||||
mount_all
|
if ping -c 1 -W 1 "$HOST" >/dev/null 2>&1; then
|
||||||
|
mount_cifs "//192.168.1.1/FRITZ.NAS" \
|
||||||
|
"/home/honney/mount/fritzNAS" \
|
||||||
|
"credentials=/home/honney/.cred/samba_credentials,uid=1000,gid=1000,vers=3.0,cache=none,nounix,noserverino,file_mode=0755,dir_mode=0755"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ping -c 1 -W 1 "100.64.0.3" >/dev/null 2>&1; then
|
||||||
|
# Mount Data (from fstab line 2)
|
||||||
|
mount_cifs "//100.64.0.3/Data" \
|
||||||
|
"/home/honney/mount/Data" \
|
||||||
|
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
||||||
|
|
||||||
|
# Mount Media (from fstab line 3)
|
||||||
|
mount_cifs "//100.64.0.3/Media" \
|
||||||
|
"/home/honney/mount/Media" \
|
||||||
|
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
||||||
|
|
||||||
|
# Mount Ripping (from fstab line 4)
|
||||||
|
mount_cifs "//100.64.0.3/Ripping" \
|
||||||
|
"/home/honney/mount/Ripping" \
|
||||||
|
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
||||||
|
|
||||||
|
# Mount Apps (from fstab line 5)
|
||||||
|
mount_cifs "//100.64.0.3/Apps" \
|
||||||
|
"/home/honney/mount/Apps" \
|
||||||
|
"credentials=/home/honney/.cred/trueNAS_credentials,vers=3.1.1,iocharset=utf8,rw,uid=1000,gid=1000,nounix,noperm,file_mode=0660,dir_mode=0770,hard,intr,cache=loose"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user