mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-17 12:27:22 +00:00
Add conky config; add alias, global var, binding; update fish scripts
This commit is contained in:
parent
662cf1bcdc
commit
91ebbe8be8
10 changed files with 234 additions and 83 deletions
74
swim
Executable file
74
swim
Executable file
|
|
@ -0,0 +1,74 @@
|
|||
#!/usr/bin/env -S fish --private
|
||||
|
||||
set general_help '
|
||||
A collection of useful functions for this project.
|
||||
|
||||
Either run a function like ./swim.fish <function> [arg [arg [...]]
|
||||
or source the file and run them as commands:
|
||||
$ source ./swim.fish
|
||||
$ lint [args]
|
||||
|
||||
Run ./swim help <function_name> to see it\'s definition.
|
||||
'
|
||||
|
||||
# Configuration
|
||||
|
||||
set src_fish_files \
|
||||
./install_arch \
|
||||
./provision_linux \
|
||||
./sync \
|
||||
./upgrade_debian \
|
||||
./**.fish \
|
||||
./.**.fish
|
||||
|
||||
# Commands
|
||||
|
||||
function lint -d 'Lint fish scripts'
|
||||
fish --no-execute $src_fish_files
|
||||
end
|
||||
|
||||
function format -d 'Format fish scripts'
|
||||
fish_indent --write $src_fish_files
|
||||
end
|
||||
|
||||
function sync -d 'Run the sync script'
|
||||
./sync $argv
|
||||
end
|
||||
|
||||
function install_arch -d 'Run the install_arch script'
|
||||
./install_arch $argv
|
||||
end
|
||||
|
||||
function upgrade_debi -d 'Run the debian_upgrade script'
|
||||
./upgrade_debian $argv
|
||||
end
|
||||
|
||||
function provision -d 'Run the provision_linux script with the specified distro'
|
||||
argparse 'd/distro=' -- $argv
|
||||
|
||||
if test -n "$_flag_d"
|
||||
set -g distro $_flag_d
|
||||
end
|
||||
|
||||
./provision_linux $argv[2..-1]
|
||||
end
|
||||
|
||||
# --- execution/help handling ---
|
||||
|
||||
function help -a function_name -d 'Displays help for internal function'
|
||||
if test -n "$function_name"
|
||||
functions $function_name
|
||||
else
|
||||
echo $general_help
|
||||
end
|
||||
end
|
||||
|
||||
argparse --ignore-unknown h/help -- $argv
|
||||
|
||||
if test -n "$_flag_h"
|
||||
help $argv
|
||||
else if test -n "$argv"
|
||||
$argv
|
||||
else
|
||||
echo $general_help
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue