diff options
Diffstat (limited to 'gemfeed/examples/conf/dotfiles')
51 files changed, 0 insertions, 3056 deletions
diff --git a/gemfeed/examples/conf/dotfiles/README.md b/gemfeed/examples/conf/dotfiles/README.md deleted file mode 100644 index 6fdd2c25..00000000 --- a/gemfeed/examples/conf/dotfiles/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# dotfiles - -These are all my dotfiles. I can install them locally on my laptop and/or workstation as well as remotely on any server. - -For local installation, also have a read through https://blog.ferki.it/2023/08/11/local-management-with-rex/ diff --git a/gemfeed/examples/conf/dotfiles/Rexfile b/gemfeed/examples/conf/dotfiles/Rexfile deleted file mode 100644 index e0e002e5..00000000 --- a/gemfeed/examples/conf/dotfiles/Rexfile +++ /dev/null @@ -1,225 +0,0 @@ -use Rex -feature => [ '1.14', 'exec_autodie' ]; -use Rex::Logger; - -our $HOME = $ENV{HOME}; - -# In a public Git rapository. -our $DOT = "$HOME/git/conf/dotfiles"; - -# In a private Git repository. -our $DOT_PRIVATE = "$HOME/git/conf_private/dotfiles"; - -sub ensure_dir { - my ( $src_glob, $dst_dir, $file_mode ) = @_; - Rex::Logger::info("Ensure dir glob $src_glob"); - - file $dst_dir, - ensure => 'directory', - mode => '0700'; - - file "$dst_dir/" . basename($_), - ensure => 'present', - source => $_, - mode => $file_mode // '0640' - for glob $src_glob; -} - -sub ensure_file { - my ( $src_file, $dst_file, $file_mode ) = @_; - - file $dst_file, - ensure => 'present', - source => $src_file, - mode => $file_mode // '0640'; -} - -sub ensure { - my ( $src, $dst, $mode ) = @_; - ( $dst =~ /\/$/ ? \&ensure_dir : \&ensure_file )->( $src, $dst, $mode ); -} - -desc 'Install packages on Termux'; -task 'pkg_termux', sub { - my @pkgs = qw/ - ack-grep - ctags - fzf - golang - htop - make - nodejs - ripgrep - rsync - ruby - starship - tig - /; - - for my $pkg (@pkgs) { - Rex::Logger::info("Installing package $pkg"); - pkg $pkg, ensure => 'installed'; - } -}; - -desc 'Install packages on FreeBSD'; -task 'pkg_freebsd', sub { - my @pkgs = qw/ - bat - ctags - fzf - gmake - go - gron - htop - lynx - node - p5-ack - ripgrep - starship - tig - tmux - /; - - for my $pkg (@pkgs) { - Rex::Logger::info("Installing package $pkg"); - pkg $pkg, ensure => 'installed'; - } -}; - -desc 'Install packages on Fedora Linux'; -task 'pkg_fedora', sub { - my @pkgs = qw/ - opendoas - fd-find - nodejs-bash-language-server - fortune-mod - syncthing - ncdu - ack - fish - bat - ctags - fzf - golang - golang-x-tools-gopls - gpaste - gron - htop - java-latest-openjdk-devel - lynx - make - nodejs - perl-File-Slurp - procs - rakudo - Rex - ripgrep - ruby - strace - task2 - tig - tmux - dialect - chromium - strawberry - gnumeric - sway-config-fedora - sway - waybar - zathura - /; - - for my $pkg (@pkgs) { - Rex::Logger::info("Installing package $pkg"); - pkg $pkg, ensure => 'installed'; - } -}; - -desc 'Install ~/.config/helix'; -task 'home_helix', sub { ensure "$DOT/helix/*" => "$HOME/.config/helix/" }; - -desc 'Install ~/.config/ghostty'; -task 'home_ghostty', sub { ensure "$DOT/ghostty/*" => "$HOME/.config/ghostty/" }; - -desc 'Install ~/scripts'; -task 'home_scripts', sub { ensure "$DOT/scripts/*" => "$HOME/scripts/", '0750' }; - -desc 'Install ~/.ssh files'; -task 'home_ssh', sub { ensure "$DOT/ssh/config" => "$HOME/.ssh/config", '0600' }; - -desc 'Install BASH configuration'; -task 'home_bash', sub { - ensure "$DOT/bash/bash_profile" => "$HOME/.bash_profile"; - ensure "$DOT/bash/bashrc" => "$HOME/.bashrc"; -}; - -desc 'Install fish configuration'; -task 'home_fish', sub { - - # ensure "$DOT/fish/conf.d/*" => "$HOME/.config/fish/conf.d/"; - my $dest_dir = "$HOME/.config/fish/conf.d"; - if ( !-l $dest_dir ) { - if ( -d $dest_dir ) { - rename $dest_dir, "$dest_dir.old" or die "Could not rename $dest_dir: $!"; - } - symlink "$DOT/fish/conf.d" => $dest_dir or die "Could not create symlink: $!"; - } -}; - -desc 'Install gitsyncer configuration'; -task 'home_gitsyncer', sub { - my $dest_dir = "$HOME/.config/gitsyncer"; - symlink "$DOT/gitsyncer/" => $dest_dir or die "Could not create symlink: $!"; -}; - -sub isFileSymlink() { - my $file = shift; - return -l $file && -e $file; -} - -desc 'Vale and proselint'; -task 'home_vale', sub { - ensure "$DOT/vale.ini" => "$HOME/.vale.ini"; - say 'Now you can run "vale sync"'; -}; - -desc 'Install tmux configuration'; -task 'home_tmux', sub { - ensure "$DOT/tmux/*" => "$HOME/.config/tmux/"; -}; - -desc 'Install Sway configuration'; -task 'home_sway', sub { - ensure "$DOT/sway/config.d/*" => "$HOME/.config/sway/config.d/"; - ensure "$DOT/waybar/*" => "$HOME/.config/waybar/"; -}; - -desc 'Install my signature'; -task 'home_signature', sub { - ensure "$DOT/signature" => "$HOME/.signature"; -}; - -desc 'Install my calendar files'; -task 'home_calendar', sub { - unless ( -d $DOT_PRIVATE ) { - Rex::Logger::info( "$DOT_PRIVATE not there, skipping task", 'warn' ); - } - else { - ensure "$DOT_PRIVATE/calendar/*" => "$HOME/.calendar/"; - } -}; - -desc 'Install my Pipewire tuned for High-Res config'; -task 'home_pipewire', sub { - file "$HOME/.config/pipewire" => ensure => 'directory', - mode => '0750'; - ensure - "$DOT/pipewire/pipewire.conf" => "$HOME/.config/pipewire/pipewire.conf", - '0600'; -}; - -desc 'Install all my ~ files'; -task 'home', sub { - require Rex::TaskList; - run_task $_ for Rex::TaskList->create()->get_all_tasks('^home_'); -}; diff --git a/gemfeed/examples/conf/dotfiles/bash/bash_profile b/gemfeed/examples/conf/dotfiles/bash/bash_profile deleted file mode 100644 index 004a7b32..00000000 --- a/gemfeed/examples/conf/dotfiles/bash/bash_profile +++ /dev/null @@ -1,3 +0,0 @@ -if [ -f $HOME/.bashrc ]; then - source $HOME/.bashrc -fi diff --git a/gemfeed/examples/conf/dotfiles/bash/bashrc b/gemfeed/examples/conf/dotfiles/bash/bashrc deleted file mode 100644 index ec2b10c3..00000000 --- a/gemfeed/examples/conf/dotfiles/bash/bashrc +++ /dev/null @@ -1,15 +0,0 @@ -# If shell is interactive -if [[ ! -z "$PS1" && ! -f $HOME/.nofish ]]; then - # Use fish if it's installed - if [ -e /opt/local/bin/fish ]; then - exec /opt/local/bin/fish - elif [ -e /bin/fish ]; then - exec /bin/fish - elif [ -e /usr/bin/fish ]; then - exec /usr/bin/fish - elif [ -e /data/data/com.termux/files/usr/bin/fish ]; then - exec /data/data/com.termux/files/usr/bin/fish - fi - - echo 'I might want to install fish on this host' -fi diff --git a/gemfeed/examples/conf/dotfiles/claude/CLAUDE.md b/gemfeed/examples/conf/dotfiles/claude/CLAUDE.md deleted file mode 100644 index ffda0b71..00000000 --- a/gemfeed/examples/conf/dotfiles/claude/CLAUDE.md +++ /dev/null @@ -1,2 +0,0 @@ -- Whenever updating code, also update the comments in the code to reflect the reality and the reasoning. -- When a function reaches 50 lines of code or more, try to refactor it into several functions of about 30 lines each. In case of a go project, when main.go becomes too large, move code into the ./internal package. diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/ai.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/ai.fish deleted file mode 100644 index 23ce2b20..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/ai.fish +++ /dev/null @@ -1,39 +0,0 @@ -abbr -a gpt chatgpt -abbr -a gpti "chatgpt --interactive" -abbr -a suggest hexai -abbr -a explain 'hexai explain' -abbr -a aic 'aichat -e' - -# helix-gpt env vars used -# set -gx COPILOT_MODEL gpt-4.1 # can be changed with aimodels function -set -gx COPILOT_MODEL gpt-4o # can be changed with aimodels function -set -gx HANDLER copilot - -# TODO: also reconfigure aichat tool using this function -function aimodels - # nvim for the ai tool wrapper so i can use Copilot Chat from the command line. - set -l NVIM_DIR "$HOME/.config/nvim/" - set -l COPILOT_CHAT_DIR "$NVIM_DIR/pack/copilotchat/start/CopilotChat.nvim/lua/CopilotChat" - - printf "gpt-4o -gpt-5 -gpt-o3 -gpt-4.1 -claude-3.7-sonnet -claude-3.7-sonnet-thought -claude-4.0-sonnet -gemini-2.5-pro" >~/.aimodels - - set -gx COPILOT_MODEL (cat ~/.aimodels | fzf) - set -gx OPENAI_MODEL $COPILOT_MODEL - - if test -d $COPILOT_CHAT_DIR - set -l model_config "$COPILOT_CHAT_DIR/config-$COPILOT_MODEL.lua" - if test -f "$model_config" - echo "Using CopilotChat config from $model_config" - cp -v $model_config "$COPILOT_CHAT_DIR/config.lua" - else - echo "No config found at $model_config" - end - end -end diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/alternatives.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/alternatives.fish deleted file mode 100644 index 491cf1fe..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/alternatives.fish +++ /dev/null @@ -1,17 +0,0 @@ -if type -q bat - alias Cat=/usr/bin/cat - alias cat=bat -end -if type -q see - alias ca=see -end -if type -q bit - alias Git=/usr/bin/git - alias git=bit -end -if type -q procs - alias p='procs' -end -if type -q carl - alias cal='carl' -end diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/config.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/config.fish deleted file mode 100644 index 670ca861..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/config.fish +++ /dev/null @@ -1,31 +0,0 @@ -fish_vi_key_bindings - -# Add paths to PATH -set -U fish_user_paths ~/bin ~/scripts ~/go/bin ~/.cargo/bin $fish_user_paths - -if command -q -v doas >/dev/null - abbr -a s doas -else - abbr -a s sudo -end - -abbr -a g 'grep -E -i' -abbr -a no 'grep -E -i -v' -abbr -a not 'grep -E -i -v' -abbr -a gl 'git log --pretty=oneline --graph --decorate --all' -abbr -a gp 'begin; git commit -a; and git pull; and git push; end' - -for dir in ~/.config/fish/conf.d.work ~/.config/fish/conf.d.local - if test -d $dir - for file in $dir/*.fish - source $file - end - end -end - -if test -d /home/linuxbrew/.linuxbrew - if status is-interactive - # Commands to run in interactive sessions can go here - end - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" -end diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/dotfiles.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/dotfiles.fish deleted file mode 100644 index 6304d321..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/dotfiles.fish +++ /dev/null @@ -1,48 +0,0 @@ -set -gx DOTFILES_DIR ~/git/rexfiles/dotfiles - -function dotfiles::update - set -l prev_pwd (pwd) - cd $DOTFILES_DIR - rex home - cd "$prev_pwd" -end - -function dotfiles::update::git - set -l prev_pwd (pwd) - cd $DOTFILES_DIR - git pull - git commit -a - git push - rex home - cd "$prev_pwd" -end - -function dotfiles::fuzzy::edit - set -l prev_pwd (pwd) - cd $DOTFILES_DIR - set -l dotfile (find . -type f -not -path '*/.git/*' | fzf) - $EDITOR "$dotfile" - if echo "$dotfile" | grep -F -q .fish - echo "Sourcing $dotfile" - source "$dotfile" - end - cd "$prev_pwd" -end - -function dotfiles::rexify - cd $DOTFILES_DIR - rex home - cd - -end - -function dotfiles::random::edit - $EDITOR (find $DOTFILES_DIR -type f -not -path '*/.git/*' | shuf -n 1) -end - -abbr -a .u 'dotfiles::update' -abbr -a .ug 'dotfiles::update::git' -abbr -a .e 'dotfiles::fuzzy::edit' -abbr -a .rex 'dotfiles::rexify' -abbr -a .re 'dotfiles::random::edit' -abbr -a cdconf "cd $HOME/git/conf" -abbr -a cdotfiles "cd $HOME/git/conf/dotfiles" diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/editor.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/editor.fish deleted file mode 100644 index bda46448..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/editor.fish +++ /dev/null @@ -1,44 +0,0 @@ -set -gx EDITOR hx -set -gx VISUAL $EDITOR -set -gx GIT_EDITOR $EDITOR -set -gx HELIX_CONFIG_DIR $HOME/.config/helix - -function editor::helix::open_with_lock - set -l file $argv[1] - set -l lock "$file.lock" - if test -f "$lock" - echo "File lock $lock exists! Another instance is editing it?" - return 2 - end - touch $lock - hx $file $argv[2..-1] - rm $lock -end - -function editor::helix::open_with_lock::force - set -l file $argv[1] - set -l lock "$file.lock" - if test -f "$lock" - echo "File lock $lock exists! Force deleting it and terminating all $EDITOR instances?" - rm -f $lock - pkill -f $EDITOR - end - touch $lock - hx $file $argv[2..-1] - rm $lock -end - -function editor::helix::edit::remote - set -l local_path $argv[1] - set -l remote_uri $argv[2] - scp $local_path $remote_uri; or return 1 - echo "LOCAL_PATH=$local_path; REMOTE_URI=$remote_uri" >~/.hx.remote.source - hx $local_path -end - -abbr -a lhx 'editor::helix::open_with_lock' -abbr -a hxl 'editor::helix::open_with_lock' -abbr -a hxlf 'editor::helix::open_with_lock::force' -abbr -a lhxf 'editor::helix::open_with_lock::force' -abbr -a rhx 'editor::helix::edit::remote' -abbr -a x hx diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/fuzzy.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/fuzzy.fish deleted file mode 100644 index 7683a0e7..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/fuzzy.fish +++ /dev/null @@ -1,5 +0,0 @@ -function __tv_git - tv git-repos -end - -bind \cg __tv_git diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/games.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/games.fish deleted file mode 100644 index 291a798f..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/games.fish +++ /dev/null @@ -1,15 +0,0 @@ -function games::colorscript - if test -e ~/git/shell-color-scripts - cd ~/git/shell-color-scripts - set -x DEV 1 - ./colorscript.sh --random - cd - - else - echo 'No colorscripts installed. Go to:' - echo ' https://gitlab.com/dwt1/shell-color-scripts' - end -end - -if not test -f ~/.colorscript.disable - games::colorscript -end diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/gos.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/gos.fish deleted file mode 100644 index a23d7a7b..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/gos.fish +++ /dev/null @@ -1,6 +0,0 @@ -set -x GOS_BIN ~/go/bin/gos -set -x GOS_DIR ~/.gosdir - -if test -f $GOS_BIN - alias cdgos "cd $GOS_DIR" -end diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/k8s.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/k8s.fish deleted file mode 100644 index ee1584bf..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/k8s.fish +++ /dev/null @@ -1,76 +0,0 @@ -function kcompletions - if command -q -v kubectl >/dev/null - kubectl completion fish | source - end -end - -# Check if the directory $HOME/.krew exists and update PATH -if test -d $HOME/.krew - set -x PATH (set -q KREW_ROOT; and echo $KREW_ROOT; or echo $HOME/.krew)/bin $PATH -end - -function kpod - set pattern "." - if test -n "$argv[1]" - set pattern "$argv[1]" - end - set -gx POD (kubectl get pods | grep "$pattern" | sort -R | head -n 1 | cut -d' ' -f1) - echo "Pod is $POD" -end - -function klogsf - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl logs -f $POD -end - -function klogs - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl logs $POD -end - -function kbash - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl exec -it $POD -- /bin/bash -end - -function kshell - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl exec -it $POD -- /bin/sh -end - -function kdesc - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl describe pod $POD -end - -function kedit - if test -z "$POD" -o -n "$argv[1]" - kpod $argv - end - kubectl edit pod $POD -end - -function k8s::kubectl::config::contexts - kubectl config get-contexts | sed '1d; /\*/d' | awk '{ print $1 }' | sort -end -alias kcontexts="k8s::kubectl::config::contexts" - -function k8s::kubectl::config::use_context - kubectl config use-context (kubectl config get-contexts | sed '1d; /\*/d' | awk '{ print $1 }' | sort | fzf) -end -alias kcontext="k8s::kubectl::config::use_context" - -function k8s::kubectl::config::set_namespace - kubectl config set-context --current --namespace=(kubectl get ns | sed 1d | awk '{ print $1 }' | sort | fzf) -end -alias knamespace="k8s::kubectl::config::set_namespace" diff --git a/gemfeed/examples/conf/dotfiles/fish/conf.d/quickedit.fish b/gemfeed/examples/conf/dotfiles/fish/conf.d/quickedit.fish deleted file mode 100644 index c722acc6..00000000 --- a/gemfeed/examples/conf/dotfiles/fish/conf.d/quickedit.fish +++ /dev/null @@ -1,93 +0,0 @@ -set -gx QUICKEDIT_DIR ~/QuickEdit - -function quickedit::postaction - set -l file_path $argv[1] - set -l make_run 0 - - if test -f Makefile - make - set make_run 1 - end - - # Go to git toplevel dir (if exists) - cd (dirname $file_path) - set -l git_dir (git rev-parse --show-toplevel 2>/dev/null) - if test $status -eq 0 - cd $git_dir - end - if not test $make_run -eq 1 - if test -f Makefile - make - end - end - if test -d .git - git commit -a -m Update - git pull - git push - end -end - -function quickedit - set -l prev_dir (pwd) - set -l grep_pattern . - - if test (count $argv) -gt 0 - set grep_pattern $argv[1] - end - - cd $QUICKEDIT_DIR - set files (find -L . -type f -not -path '*/.*' | grep -E "$grep_pattern") - - switch (count $files) - case 0 - echo No result found - return - case 1 - set file_path $files[1] - case '*' - set file_path (printf '%s\n' $files | fzf) - end - - if editor::helix::open_with_lock $file_path - quickedit::postaction $file_path - end - - cd $prev_dir -end - -function quickedit::direct - set -l dir $argv[1] - set -l file $argv[2] - cd $dir - - if editor::helix::open_with_lock $file - quickedit::postaction $file - end - - cd - -end - -function quickedit::scratchpad - quickedit::direct ~/Notes Scratchpad.md -end - -function quickedit::quicknote - quickedit::direct ~/Notes QuickNote.md -end - -function quickedit::performance - quickedit::direct ~/Notes Performance.md -end - -abbr -a e quickedit -abbr -a scratch quickedit::scratchpad -abbr -a S quickedit::scratchpad -abbr -a quicknote quickedit::quicknote -abbr -a performance quickedit::performance -abbr -a goals quickedit::performance< |
