From f408ae894e4e10bbf4358c7c07bb9618ef1353e4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 7 Feb 2026 23:46:42 +0200 Subject: rename --- README.md | 5 + Rexfile | 291 ++++++++++++++++++ bash/bash_profile | 3 + bash/bashrc | 15 + claude/CLAUDE.md | 2 + cursor/commands/commit-and-push-to-git.md | 3 + cursor/commands/increment-version-and-push.md | 3 + dotfiles/README.md | 5 - dotfiles/Rexfile | 291 ------------------ dotfiles/bash/bash_profile | 3 - dotfiles/bash/bashrc | 15 - dotfiles/claude/CLAUDE.md | 2 - dotfiles/cursor/commands/commit-and-push-to-git.md | 3 - .../cursor/commands/increment-version-and-push.md | 3 - dotfiles/fish/conf.d/.gitignore | 1 - dotfiles/fish/conf.d/ai.fish | 30 -- dotfiles/fish/conf.d/alternatives.fish | 20 -- dotfiles/fish/conf.d/config.fish | 31 -- dotfiles/fish/conf.d/dotfiles.fish | 48 --- dotfiles/fish/conf.d/editor.fish | 44 --- dotfiles/fish/conf.d/fuzzy.fish | 5 - dotfiles/fish/conf.d/games.fish | 15 - dotfiles/fish/conf.d/gos.fish | 6 - dotfiles/fish/conf.d/java.fish | 6 - dotfiles/fish/conf.d/k8s.fish | 76 ----- dotfiles/fish/conf.d/quickedit.fish | 118 -------- dotfiles/fish/conf.d/supersync.fish | 125 -------- dotfiles/fish/conf.d/taskwarrior.fish | 143 --------- dotfiles/fish/conf.d/timr.fish | 26 -- dotfiles/fish/conf.d/tmputils.fish | 63 ---- dotfiles/fish/conf.d/tmux.fish | 94 ------ dotfiles/fish/conf.d/update.fish | 75 ----- dotfiles/fish/conf.d/utils.fish | 155 ---------- dotfiles/fish/conf.d/worktime.fish | 122 -------- dotfiles/fish/conf.d/zoxide.fish | 5 - dotfiles/fish/conf.d/zsh.fish | 6 - dotfiles/ghostty/config | 17 -- dotfiles/gitsyncer/config.json | 33 --- dotfiles/helix/config.toml | 88 ------ dotfiles/helix/languages.toml | 206 ------------- dotfiles/nvim/init.lua | 70 ----- dotfiles/pipewire/pipewire.conf | 257 ---------------- dotfiles/scripts/README.md | 3 - dotfiles/scripts/ai | 7 - dotfiles/scripts/brokenlinkfinder | 73 ----- dotfiles/scripts/gvim | 7 - dotfiles/scripts/hx.aichat-prompt | 9 - dotfiles/scripts/hx.chatgpt-prompt | 3 - dotfiles/scripts/hx.goformatter | 3 - dotfiles/scripts/hx.hexai-prompt | 9 - dotfiles/scripts/hx.nvim-copilot-prompt | 32 -- dotfiles/scripts/hx.prompt | 14 - dotfiles/scripts/randomnote.rb | 30 -- dotfiles/scripts/taskwarriorfeeder.rb | 220 -------------- dotfiles/scripts/tmux-edit-send | 246 ---------------- dotfiles/scripts/wol-f3s | 86 ------ dotfiles/signature | 2 - dotfiles/ssh/config | 26 -- dotfiles/sway/config.d/keyboard.conf | 6 - dotfiles/tmux/tmux.conf | 38 --- dotfiles/tmux/tmux.local.conf | 2 - dotfiles/vale.ini | 6 - dotfiles/waybar/config.jsonc | 194 ------------ dotfiles/waybar/style.css | 326 --------------------- dotfiles/zsh/zshrc | 22 -- fish/conf.d/.gitignore | 1 + fish/conf.d/ai.fish | 30 ++ fish/conf.d/alternatives.fish | 20 ++ fish/conf.d/config.fish | 31 ++ fish/conf.d/dotfiles.fish | 48 +++ fish/conf.d/editor.fish | 44 +++ fish/conf.d/fuzzy.fish | 5 + fish/conf.d/games.fish | 15 + fish/conf.d/gos.fish | 6 + fish/conf.d/java.fish | 6 + fish/conf.d/k8s.fish | 76 +++++ fish/conf.d/quickedit.fish | 118 ++++++++ fish/conf.d/supersync.fish | 125 ++++++++ fish/conf.d/taskwarrior.fish | 143 +++++++++ fish/conf.d/timr.fish | 26 ++ fish/conf.d/tmputils.fish | 63 ++++ fish/conf.d/tmux.fish | 94 ++++++ fish/conf.d/update.fish | 75 +++++ fish/conf.d/utils.fish | 155 ++++++++++ fish/conf.d/worktime.fish | 122 ++++++++ fish/conf.d/zoxide.fish | 5 + fish/conf.d/zsh.fish | 6 + ghostty/config | 17 ++ gitsyncer/config.json | 33 +++ helix/config.toml | 88 ++++++ helix/languages.toml | 206 +++++++++++++ nvim/init.lua | 70 +++++ pipewire/pipewire.conf | 257 ++++++++++++++++ scripts/README.md | 3 + scripts/ai | 7 + scripts/brokenlinkfinder | 73 +++++ scripts/gvim | 7 + scripts/hx.aichat-prompt | 9 + scripts/hx.chatgpt-prompt | 3 + scripts/hx.goformatter | 3 + scripts/hx.hexai-prompt | 9 + scripts/hx.nvim-copilot-prompt | 32 ++ scripts/hx.prompt | 14 + scripts/randomnote.rb | 30 ++ scripts/taskwarriorfeeder.rb | 220 ++++++++++++++ scripts/tmux-edit-send | 246 ++++++++++++++++ scripts/wol-f3s | 86 ++++++ signature | 2 + ssh/config | 26 ++ sway/config.d/keyboard.conf | 6 + tmux/tmux.conf | 38 +++ tmux/tmux.local.conf | 2 + vale.ini | 6 + waybar/config.jsonc | 194 ++++++++++++ waybar/style.css | 326 +++++++++++++++++++++ zsh/zshrc | 22 ++ 116 files changed, 3571 insertions(+), 3571 deletions(-) create mode 100644 README.md create mode 100644 Rexfile create mode 100644 bash/bash_profile create mode 100644 bash/bashrc create mode 100644 claude/CLAUDE.md create mode 100644 cursor/commands/commit-and-push-to-git.md create mode 100644 cursor/commands/increment-version-and-push.md delete mode 100644 dotfiles/README.md delete mode 100644 dotfiles/Rexfile delete mode 100644 dotfiles/bash/bash_profile delete mode 100644 dotfiles/bash/bashrc delete mode 100644 dotfiles/claude/CLAUDE.md delete mode 100644 dotfiles/cursor/commands/commit-and-push-to-git.md delete mode 100644 dotfiles/cursor/commands/increment-version-and-push.md delete mode 100644 dotfiles/fish/conf.d/.gitignore delete mode 100644 dotfiles/fish/conf.d/ai.fish delete mode 100644 dotfiles/fish/conf.d/alternatives.fish delete mode 100644 dotfiles/fish/conf.d/config.fish delete mode 100644 dotfiles/fish/conf.d/dotfiles.fish delete mode 100644 dotfiles/fish/conf.d/editor.fish delete mode 100644 dotfiles/fish/conf.d/fuzzy.fish delete mode 100644 dotfiles/fish/conf.d/games.fish delete mode 100644 dotfiles/fish/conf.d/gos.fish delete mode 100644 dotfiles/fish/conf.d/java.fish delete mode 100644 dotfiles/fish/conf.d/k8s.fish delete mode 100644 dotfiles/fish/conf.d/quickedit.fish delete mode 100644 dotfiles/fish/conf.d/supersync.fish delete mode 100644 dotfiles/fish/conf.d/taskwarrior.fish delete mode 100644 dotfiles/fish/conf.d/timr.fish delete mode 100644 dotfiles/fish/conf.d/tmputils.fish delete mode 100644 dotfiles/fish/conf.d/tmux.fish delete mode 100644 dotfiles/fish/conf.d/update.fish delete mode 100644 dotfiles/fish/conf.d/utils.fish delete mode 100644 dotfiles/fish/conf.d/worktime.fish delete mode 100644 dotfiles/fish/conf.d/zoxide.fish delete mode 100644 dotfiles/fish/conf.d/zsh.fish delete mode 100644 dotfiles/ghostty/config delete mode 100644 dotfiles/gitsyncer/config.json delete mode 100644 dotfiles/helix/config.toml delete mode 100644 dotfiles/helix/languages.toml delete mode 100644 dotfiles/nvim/init.lua delete mode 100644 dotfiles/pipewire/pipewire.conf delete mode 100644 dotfiles/scripts/README.md delete mode 100755 dotfiles/scripts/ai delete mode 100644 dotfiles/scripts/brokenlinkfinder delete mode 100755 dotfiles/scripts/gvim delete mode 100755 dotfiles/scripts/hx.aichat-prompt delete mode 100755 dotfiles/scripts/hx.chatgpt-prompt delete mode 100755 dotfiles/scripts/hx.goformatter delete mode 100755 dotfiles/scripts/hx.hexai-prompt delete mode 100755 dotfiles/scripts/hx.nvim-copilot-prompt delete mode 100755 dotfiles/scripts/hx.prompt delete mode 100644 dotfiles/scripts/randomnote.rb delete mode 100644 dotfiles/scripts/taskwarriorfeeder.rb delete mode 100755 dotfiles/scripts/tmux-edit-send delete mode 100755 dotfiles/scripts/wol-f3s delete mode 100644 dotfiles/signature delete mode 100644 dotfiles/ssh/config delete mode 100644 dotfiles/sway/config.d/keyboard.conf delete mode 100644 dotfiles/tmux/tmux.conf delete mode 100644 dotfiles/tmux/tmux.local.conf delete mode 100644 dotfiles/vale.ini delete mode 100644 dotfiles/waybar/config.jsonc delete mode 100644 dotfiles/waybar/style.css delete mode 100644 dotfiles/zsh/zshrc create mode 100644 fish/conf.d/.gitignore create mode 100644 fish/conf.d/ai.fish create mode 100644 fish/conf.d/alternatives.fish create mode 100644 fish/conf.d/config.fish create mode 100644 fish/conf.d/dotfiles.fish create mode 100644 fish/conf.d/editor.fish create mode 100644 fish/conf.d/fuzzy.fish create mode 100644 fish/conf.d/games.fish create mode 100644 fish/conf.d/gos.fish create mode 100644 fish/conf.d/java.fish create mode 100644 fish/conf.d/k8s.fish create mode 100644 fish/conf.d/quickedit.fish create mode 100644 fish/conf.d/supersync.fish create mode 100644 fish/conf.d/taskwarrior.fish create mode 100644 fish/conf.d/timr.fish create mode 100644 fish/conf.d/tmputils.fish create mode 100644 fish/conf.d/tmux.fish create mode 100644 fish/conf.d/update.fish create mode 100644 fish/conf.d/utils.fish create mode 100644 fish/conf.d/worktime.fish create mode 100644 fish/conf.d/zoxide.fish create mode 100644 fish/conf.d/zsh.fish create mode 100644 ghostty/config create mode 100644 gitsyncer/config.json create mode 100644 helix/config.toml create mode 100644 helix/languages.toml create mode 100644 nvim/init.lua create mode 100644 pipewire/pipewire.conf create mode 100644 scripts/README.md create mode 100755 scripts/ai create mode 100644 scripts/brokenlinkfinder create mode 100755 scripts/gvim create mode 100755 scripts/hx.aichat-prompt create mode 100755 scripts/hx.chatgpt-prompt create mode 100755 scripts/hx.goformatter create mode 100755 scripts/hx.hexai-prompt create mode 100755 scripts/hx.nvim-copilot-prompt create mode 100755 scripts/hx.prompt create mode 100644 scripts/randomnote.rb create mode 100644 scripts/taskwarriorfeeder.rb create mode 100755 scripts/tmux-edit-send create mode 100755 scripts/wol-f3s create mode 100644 signature create mode 100644 ssh/config create mode 100644 sway/config.d/keyboard.conf create mode 100644 tmux/tmux.conf create mode 100644 tmux/tmux.local.conf create mode 100644 vale.ini create mode 100644 waybar/config.jsonc create mode 100644 waybar/style.css create mode 100644 zsh/zshrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fdd2c2 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# 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/Rexfile b/Rexfile new file mode 100644 index 0000000..4c1f5b0 --- /dev/null +++ b/Rexfile @@ -0,0 +1,291 @@ +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/ + zoxide + dust + lazygit + taskwarrior + bat + ctags + fzf + gmake + go + gron + htop + lynx + node + p5-ack + ripgrep + tig + doas + 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 ~/.cursor'; +task 'home_cursor', sub { + file "$HOME/.cursor" => ensure => 'directory', mode => '0750'; + ensure "$DOT/cursor/commands/*" => "$HOME/.cursor/commands/", '0750'; +}; + +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 ZSH configuration'; +task 'home_zsh', sub { + if ( $^O eq 'darwin' ) { + ensure "$DOT/zsh/zshrc" => "$HOME/.zshrc"; + } + else { + Rex::Logger::info( 'Skipping ZSH configuration (not on macOS)', 'warn' ); + } +}; + +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 'Manage ~/QuickEdit directory and symlinks'; +task 'home_quickedit', sub { + if ( $^O eq 'linux' || $^O eq 'freebsd' ) { + Rex::Logger::info('Setting up ~/QuickEdit'); + + file "$HOME/QuickEdit", + ensure => 'directory', + mode => '0700'; + + my %symlinks = ( + 'data' => "$HOME/data/", + 'Documents' => "$HOME/Documents//", + 'dotfiles' => "$HOME/git/conf/dotfiles/", + 'foo.zone-gemtext' => "$HOME/git/foo.zone-content/gemtext//", + 'Notes' => "$HOME/Notes/", + 'public-snippets' => "$HOME/git/conf/snippets//", + 'worktime' => "$HOME/git/worktime/", + ); + + for my $name ( keys %symlinks ) { + my $link_path = "$HOME/QuickEdit/$name"; + my $target = $symlinks{$name}; + + # Remove existing symlink if it points to a different target + if ( -l $link_path ) { + my $current_target = readlink($link_path); + if ( $current_target ne $target ) { + unlink $link_path or die "Could not remove $link_path: $!"; + symlink $target => $link_path or die "Could not create symlink $link_path: $!"; + } + } + elsif ( -e $link_path ) { + Rex::Logger::info( "$link_path exists but is not a symlink, skipping", 'warn' ); + } + else { + symlink $target => $link_path or die "Could not create symlink $link_path: $!"; + } + } + } + elsif ( $^O eq 'darwin' ) { + Rex::Logger::info('QuickEdit placeholder for macOS (not yet implemented)'); + + # TODO: Implement QuickEdit management for macOS + } +}; + +desc 'Install all my ~ files'; +task 'home', sub { + require Rex::TaskList; + run_task $_ for Rex::TaskList->create()->get_all_tasks('^home_'); +}; diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 0000000..004a7b3 --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,3 @@ +if [ -f $HOME/.bashrc ]; then + source $HOME/.bashrc +fi diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..ec2b10c --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,15 @@ +# 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/claude/CLAUDE.md b/claude/CLAUDE.md new file mode 100644 index 0000000..ffda0b7 --- /dev/null +++ b/claude/CLAUDE.md @@ -0,0 +1,2 @@ +- 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/cursor/commands/commit-and-push-to-git.md b/cursor/commands/commit-and-push-to-git.md new file mode 100644 index 0000000..42132bd --- /dev/null +++ b/cursor/commands/commit-and-push-to-git.md @@ -0,0 +1,3 @@ +# Commit and push to git + +Commit and push to git all changes you made. diff --git a/cursor/commands/increment-version-and-push.md b/cursor/commands/increment-version-and-push.md new file mode 100644 index 0000000..015038b --- /dev/null +++ b/cursor/commands/increment-version-and-push.md @@ -0,0 +1,3 @@ +# Increment version and push + +Increment the version of the project, tag it in git, commit, and push. For Go-based projects, look for the internal/version.go file. For bug fixes, increment only the minor version. We are using semantic versioning, e.g., x.y.z, where z is the minor version. For new features, increment y. Never increment x (the major version) unless specified. diff --git a/dotfiles/README.md b/dotfiles/README.md deleted file mode 100644 index 6fdd2c2..0000000 --- a/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/dotfiles/Rexfile b/dotfiles/Rexfile deleted file mode 100644 index 4c1f5b0..0000000 --- a/dotfiles/Rexfile +++ /dev/null @@ -1,291 +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/ - zoxide - dust - lazygit - taskwarrior - bat - ctags - fzf - gmake - go - gron - htop - lynx - node - p5-ack - ripgrep - tig - doas - 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 ~/.cursor'; -task 'home_cursor', sub { - file "$HOME/.cursor" => ensure => 'directory', mode => '0750'; - ensure "$DOT/cursor/commands/*" => "$HOME/.cursor/commands/", '0750'; -}; - -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 ZSH configuration'; -task 'home_zsh', sub { - if ( $^O eq 'darwin' ) { - ensure "$DOT/zsh/zshrc" => "$HOME/.zshrc"; - } - else { - Rex::Logger::info( 'Skipping ZSH configuration (not on macOS)', 'warn' ); - } -}; - -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 'Manage ~/QuickEdit directory and symlinks'; -task 'home_quickedit', sub { - if ( $^O eq 'linux' || $^O eq 'freebsd' ) { - Rex::Logger::info('Setting up ~/QuickEdit'); - - file "$HOME/QuickEdit", - ensure => 'directory', - mode => '0700'; - - my %symlinks = ( - 'data' => "$HOME/data/", - 'Documents' => "$HOME/Documents//", - 'dotfiles' => "$HOME/git/conf/dotfiles/", - 'foo.zone-gemtext' => "$HOME/git/foo.zone-content/gemtext//", - 'Notes' => "$HOME/Notes/", - 'public-snippets' => "$HOME/git/conf/snippets//", - 'worktime' => "$HOME/git/worktime/", - ); - - for my $name ( keys %symlinks ) { - my $link_path = "$HOME/QuickEdit/$name"; - my $target = $symlinks{$name}; - - # Remove existing symlink if it points to a different target - if ( -l $link_path ) { - my $current_target = readlink($link_path); - if ( $current_target ne $target ) { - unlink $link_path or die "Could not remove $link_path: $!"; - symlink $target => $link_path or die "Could not create symlink $link_path: $!"; - } - } - elsif ( -e $link_path ) { - Rex::Logger::info( "$link_path exists but is not a symlink, skipping", 'warn' ); - } - else { - symlink $target => $link_path or die "Could not create symlink $link_path: $!"; - } - } - } - elsif ( $^O eq 'darwin' ) { - Rex::Logger::info('QuickEdit placeholder for macOS (not yet implemented)'); - - # TODO: Implement QuickEdit management for macOS - } -}; - -desc 'Install all my ~ files'; -task 'home', sub { - require Rex::TaskList; - run_task $_ for Rex::TaskList->create()->get_all_tasks('^home_'); -}; diff --git a/dotfiles/bash/bash_profile b/dotfiles/bash/bash_profile deleted file mode 100644 index 004a7b3..0000000 --- a/dotfiles/bash/bash_profile +++ /dev/null @@ -1,3 +0,0 @@ -if [ -f $HOME/.bashrc ]; then - source $HOME/.bashrc -fi diff --git a/dotfiles/bash/bashrc b/dotfiles/bash/bashrc deleted file mode 100644 index ec2b10c..0000000 --- a/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/dotfiles/claude/CLAUDE.md b/dotfiles/claude/CLAUDE.md deleted file mode 100644 index ffda0b7..0000000 --- a/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/dotfiles/cursor/commands/commit-and-push-to-git.md b/dotfiles/cursor/commands/commit-and-push-to-git.md deleted file mode 100644 index 42132bd..0000000 --- a/dotfiles/cursor/commands/commit-and-push-to-git.md +++ /dev/null @@ -1,3 +0,0 @@ -# Commit and push to git - -Commit and push to git all changes you made. diff --git a/dotfiles/cursor/commands/increment-version-and-push.md b/dotfiles/cursor/commands/increment-version-and-push.md deleted file mode 100644 index 015038b..0000000 --- a/dotfiles/cursor/commands/increment-version-and-push.md +++ /dev/null @@ -1,3 +0,0 @@ -# Increment version and push - -Increment the version of the project, tag it in git, commit, and push. For Go-based projects, look for the internal/version.go file. For bug fixes, increment only the minor version. We are using semantic versioning, e.g., x.y.z, where z is the minor version. For new features, increment y. Never increment x (the major version) unless specified. diff --git a/dotfiles/fish/conf.d/.gitignore b/dotfiles/fish/conf.d/.gitignore deleted file mode 100644 index 70a0a68..0000000 --- a/dotfiles/fish/conf.d/.gitignore +++ /dev/null @@ -1 +0,0 @@ -omf.fish diff --git a/dotfiles/fish/conf.d/ai.fish b/dotfiles/fish/conf.d/ai.fish deleted file mode 100644 index 01993c4..0000000 --- a/dotfiles/fish/conf.d/ai.fish +++ /dev/null @@ -1,30 +0,0 @@ -# set -gx HEXAI_PROVIDER copilot - -function ai::cursor_agent - set last_updated_file ~/.cursor_agent_last_updated - if not test -e $last_updated_file - cursor-agent update - touch $last_updated_file - else - set current_time (date +%s) - if test (uname) = Darwin - set file_time (stat -f %m $last_updated_file 2>/dev/null) - else - set file_time (stat -c %Y $last_updated_file 2>/dev/null) - end - set time_diff (math "$current_time - $file_time") - if test $time_diff -gt 86400 - cursor-agent update - touch $last_updated_file - end - end - touch ~/.nofish - cursor-agent -end - -function a - ai::cursor_agent -end - -abbr -a suggest hexai -abbr -a explain 'hexai explain' diff --git a/dotfiles/fish/conf.d/alternatives.fish b/dotfiles/fish/conf.d/alternatives.fish deleted file mode 100644 index 75c6e05..0000000 --- a/dotfiles/fish/conf.d/alternatives.fish +++ /dev/null @@ -1,20 +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 - -# To change my habits -alias tig=lazygit diff --git a/dotfiles/fish/conf.d/config.fish b/dotfiles/fish/conf.d/config.fish deleted file mode 100644 index 670ca86..0000000 --- a/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/dotfiles/fish/conf.d/dotfiles.fish b/dotfiles/fish/conf.d/dotfiles.fish deleted file mode 100644 index cf944a1..0000000 --- a/dotfiles/fish/conf.d/dotfiles.fish +++ /dev/null @@ -1,48 +0,0 @@ -set -gx DOTFILES_DIR ~/git/conf/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/dotfiles/fish/conf.d/editor.fish b/dotfiles/fish/conf.d/editor.fish deleted file mode 100644 index bda4644..0000000 --- a/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/dotfiles/fish/conf.d/fuzzy.fish b/dotfiles/fish/conf.d/fuzzy.fish deleted file mode 100644 index 7683a0e..0000000 --- a/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/dotfiles/fish/conf.d/games.fish b/dotfiles/fish/conf.d/games.fish deleted file mode 100644 index 291a798..0000000 --- a/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/dotfiles/fish/conf.d/gos.fish b/dotfiles/fish/conf.d/gos.fish deleted file mode 100644 index a23d7a7..0000000 --- a/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/dotfiles/fish/conf.d/java.fish b/dotfiles/fish/conf.d/java.fish deleted file mode 100644 index 5a4968c..0000000 --- a/dotfiles/fish/conf.d/java.fish +++ /dev/null @@ -1,6 +0,0 @@ -if test (uname) = Linux - set -gx JAVA_HOME /usr/lib/jvm/java-latest-openjdk - if not test -d $JAVA_HOME - echo "Warning: JAVA_HOME path '$JAVA_HOME' does not exist." - end -end diff --git a/dotfiles/fish/conf.d/k8s.fish b/dotfiles/fish/conf.d/k8s.fish deleted file mode 100644 index ee1584b..0000000 --- a/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/dotfiles/fish/conf.d/quickedit.fish b/dotfiles/fish/conf.d/quickedit.fish deleted file mode 100644 index f1c0f15..0000000 --- a/dotfiles/fish/conf.d/quickedit.fish +++ /dev/null @@ -1,118 +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::current_dir - set -l grep_pattern . - - if test (count $argv) -gt 0 - set grep_pattern $argv[1] - end - - 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 -end - -function quickedit - set -l prev_dir (pwd) - - cd $QUICKEDIT_DIR - if test (count $argv) -gt 0 - quickedit::current_dir $argv[1] - else - quickedit::current_dir - end - - cd $prev_dir -end - -function quickedit::snippets - set -l prev_dir (pwd) - - cd ~/Notes/snippets - if test (count $argv) -gt 0 - set grep_pattern $argv[1] - quickedit::current_dir $argv[1] - else - quickedit::current_dir - 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 perf quickedit::performance -abbr -a performance quickedit::performance -abbr -a goals quickedit::performance -abbr -a er "ranger $QUICKEDIT_DIR" -abbr -a cdquickedit "cd $QUICKEDIT_DIR" -abbr -a cdnotes 'cd ~/Notes' -abbr -a cdfish 'cd ~/.config/fish/conf.d' -abbr -a cddocs 'cd ~/Documents' -abbr -a cdocs 'cd ~/Documents' -abbr -a snippets quickedit::snippets diff --git a/dotfiles/fish/conf.d/supersync.fish b/dotfiles/fish/conf.d/supersync.fish deleted file mode 100644 index 320afcd..0000000 --- a/dotfiles/fish/conf.d/supersync.fish +++ /dev/null @@ -1,125 +0,0 @@ -set -x SUPERSYNC_STAMP_FILE ~/.supersync.last - -# Only sync the HabitsAndQuotes when it's asked for via function parameter -function supersync::worktime - set -l worktime_dir ~/git/worktime - - if not test -d $worktime_dir - echo "Warning: Directory $worktime_dir does not exist" - return 1 - end - cd $worktime_dir - - if test (count $argv) -gt 0 -a $argv[1] = sync_quotes - if test -d ~/Notes/HabitsAndQuotes - echo "" >work-wisdoms.md.tmp - for notes in ~/Notes/HabitsAndQuotes/{Productivity,Mentoring}.md - grep '^\* ' $notes >>work-wisdoms.md.tmp - end - sort -u work-wisdoms.md.tmp >work-wisdoms.md - rm work-wisdoms.md.tmp - git add work-wisdoms.md - grep '^\* ' ~/Notes/HabitsAndQuotes/Exercise.md >exercises.md - git add exercises.md - end - end - - find . -name '*.txt' -exec git add {} \; - find . -name '*.json' -exec git add {} \; - find . -name '*.csv' -exec git add {} \; - git commit -a -m sync - - git pull origin master - git push origin master - - cd - -end - -function supersync::uprecords - set -l uprecords_dir ~/git/uprecords - set -l uprecords_repo git@codeberg.org:snonux/uprecords.git - - if not test -d $uprecords_dir - git clone $uprecords_repo $uprecords_dir - cd $uprecords_dir - else - cd $uprecords_dir - git pull - end - - make update - git commit -a -m Update - git push - cd - -end - -function supersync::taskwarrior - if test -f ~/scripts/taskwarriorfeeder.rb - ruby ~/scripts/taskwarriorfeeder.rb - end - - taskwarrior::export - taskwarrior::export::gos - taskwarrior::export::bd - taskwarrior::import - taskwarrior::db::prune -end - -function supersync::gitsyncer - set enable_file ~/.gitsyncer_enable - set now (date +%s) - set weekly_interval (math 7 \* 24 \* 60 \* 60) - - if not test -f $enable_file - # echo Gitsyncer is not enabled - return - end - - set last_run (cat $enable_file) - if test (math $now - $last_run) -lt $weekly_interval - return - end - - if test -f ~/go/bin/gitsyncer - ~/go/bin/gitsyncer sync bidirectional --auto-create-releases --create-repos --throttle && ~/go/bin/gitsyncer showcase - end - if test $status -eq 0 - echo $now >$enable_file - end -end - -function supersync - if test -f ~/.supersync_disable - echo Supersync is disabled - return - end - - supersync::worktime sync_quotes - supersync::taskwarrior - supersync::worktime no_sync_quotes - supersync::uprecords - - if test -f ~/.gos_enable - gos - end - - supersync::gitsyncer - update::tools - - date +%s >$SUPERSYNC_STAMP_FILE.tmp - mv $SUPERSYNC_STAMP_FILE.tmp $SUPERSYNC_STAMP_FILE -end - -function supersync::is_it_time_to_sync - set -l max_age 86400 - set -l now (date +%s) - if test -f $SUPERSYNC_STAMP_FILE - set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE)) - if test $diff -lt $max_age - return 0 - end - end - read -P "It's time to run supersync! Run it? (y/n) " answer; and test "$answer" = y; and supersync -end - -abbr -a supersynct 'supersync; track' diff --git a/dotfiles/fish/conf.d/taskwarrior.fish b/dotfiles/fish/conf.d/taskwarrior.fish deleted file mode 100644 index 17240a3..0000000 --- a/dotfiles/fish/conf.d/taskwarrior.fish +++ /dev/null @@ -1,143 +0,0 @@ -function taskwarrior::fuzzy::_select - sed -n '/^[0-9]/p' | sort -rn | fzf | cut -d' ' -f1 -end - -function taskwarrior::fuzzy::find - set -g TASK_ID (task ready | taskwarrior::fuzzy::_select) -end - -function taskwarrior::select - set -l task_id "$argv[1]" - if test -n "$task_id" - set -g TASK_ID "$task_id" - end - if test "$TASK_ID" = - -o -z "$TASK_ID" - taskwarrior::fuzzy::find - end -end - -function taskwarrior::due::count - set -l due_count (task status:pending due.before:now count) - - if test $due_count -gt 0 - echo "There are $due_count tasks due!" - end -end - -function taskwarrior::add::track - if test (count $argv) -gt 0 - task add priority:L +personal +track $argv - else - tasksamurai +track - end -end - -function taskwarrior::add::standup - if test (count $argv) -gt 0 - task add priority:L +work +standup +sre +nosched $argv - task add priority:L +work +standup +storage +nosched $argv - - if test -f ~/git/helpers/jira/jira.rb - echo "Do you want to raise a Jira ticket? (y/n)" - read -l user_input - if test "$user_input" = y - ruby ~/git/helpers/jira/jira.rb --raise "$argv" - end - end - - else - tasksamurai +standup - end -end - -function taskwarrior::add::standup::editor - set -l tmpfile (mktemp /tmp/standup.XXXXXX.txt) - $EDITOR $tmpfile - taskwarrior::add::standup (cat $tmpfile) -end - -function _taskwarrior::set_import_export_tags - if test (uname) = Darwin - set -gx TASK_IMPORT_TAG work - set -gx TASK_EXPORT_TAG personal - else - set -gx TASK_IMPORT_TAG personal - set -gx TASK_EXPORT_TAG work - end -end - -function taskwarrior::export::bd - if test -d ~/Notes/Bulgarian - # Export bulgarian dumi - set -l outfile ~/Notes/Bulgarian/bd-(date +%s).txt - task +bd status:pending export | jq -r '.[].description' >$outfile - yes | task +bd status:pending delete - cat ~/Notes/Bulgarian/bd-*.txt | sort -u >~/Notes/Bulgarian/compact-(date +%s).tmp && rm ~/Notes/Bulgarian/bd-*.txt - sort -u ~/Notes/Bulgarian/compact-*.tmp >~/Notes/Bulgarian/bd-compacted.txt && rm ~/Notes/Bulgarian/compact-*.tmp - end -end - -function taskwarrior::export::gos - task +share status:pending export >"$WORKTIME_DIR/tw-gos-export-$(date +%s).json" - yes | task +share status:pending delete -end - -function taskwarrior::export - _taskwarrior::set_import_export_tags - set -l count (task +$TASK_EXPORT_TAG status:pending count) - - if test $count -eq 0 - return - end - - echo "Exporting $count tasks to $TASK_EXPORT_TAG" - task +$TASK_EXPORT_TAG status:pending export >"$WORKTIME_DIR/tw-$TASK_EXPORT_TAG-export-$(date +%s).json" - yes | task +$TASK_EXPORT_TAG status:pending delete -end - -function taskwarrior::import - _taskwarrior::set_import_export_tags - - find $WORKTIME_DIR -name "tw-$TASK_IMPORT_TAG-export-*.json" | while read -l import - task import $import - rm $import - end - - find $WORKTIME_DIR -name "tw-(hostname)-export-*.json" | while read -l import - task import $import - rm $import - end -end - -function taskwarrior::db::prune - yes | task +random status:completed delete -end - -function taskwarrior::invoke - if test -f ~/scripts/taskwarriorfeeder.rb - ruby ~/scripts/taskwarriorfeeder.rb - end - tasksamurai -end - -abbr -a t task -abbr -a L 'task add +log' -abbr -a tlog 'task add +log' -abbr -a log 'task add +log' -abbr -a tdue 'tasksamurai status:pending due.before:now' -abbr -a thome 'tasksamurai +home' -abbr -a tasks 'tasksamurai -track' -abbr -a tread 'tasksamurai +read' -abbr -a track 'taskwarrior::add::track' -abbr -a tra 'taskwarrior::add::track' -abbr -a trat 'timr track' -abbr -a tfind 'taskwarrior::fuzzy::find' -abbr -a ts 'taskwarrior::invoke' - -# Virtual standup abbrs -abbr -a V 'taskwarrior::add::standup' -abbr -a Vstorage 'tasksamurai +standup +storage' -abbr -a Vsre 'tasksamurai +standup +sre' -abbr -a Ved 'taskwarrior::add::standup::editor' - -taskwarrior::due::count diff --git a/dotfiles/fish/conf.d/timr.fish b/dotfiles/fish/conf.d/timr.fish deleted file mode 100644 index 8c92462..0000000 --- a/dotfiles/fish/conf.d/timr.fish +++ /dev/null @@ -1,26 +0,0 @@ -function timr_prompt -d "Display timr timr_status in the prompt" - if command -v timr >/dev/null - set -l timr_status (timr prompt) - if test -n "$timr_status" - set -l icon (string sub -l 1 -- "$timr_status") - set -l time (string sub -s 2 -- "$timr_status") - if test "$icon" = "▶" - set_color green - else - set_color yellow - end - printf '%s' "$icon" - set_color normal - printf ' %s' "$time" - end - end -end - -complete -c timr -n __fish_use_subcommand -a start -d "Start the timer" -complete -c timr -n __fish_use_subcommand -a stop -d "Stop the timer" -complete -c timr -n __fish_use_subcommand -a pause -d "Pause the timer" -complete -c timr -n __fish_use_subcommand -a status -d "Show the timer status" -complete -c timr -n __fish_use_subcommand -a reset -d "Reset the timer" -complete -c timr -n __fish_use_subcommand -a live -d "Show the live timer" -complete -c timr -n __fish_use_subcommand -a prompt -d "Show the prompt status" - diff --git a/dotfiles/fish/conf.d/tmputils.fish b/dotfiles/fish/conf.d/tmputils.fish deleted file mode 100644 index 87d8bde..0000000 --- a/dotfiles/fish/conf.d/tmputils.fish +++ /dev/null @@ -1,63 +0,0 @@ -set -gx TMPUTILS_DIR ~/data/tmp -set -gx TMPUTILS_TMPFILE ~/.tmpfile - -function tmpdir - set -l name $argv[1] - set -l dir "$TMPUTILS_DIR/$name" - if not test -d $dir - mkdir -p $dir - end - cd $dir -end - -function tmpls - if not test -d $TMPUTILS_DIR - return - end - ls $TMPUTILS_DIR -end - -function tmptee - set -l name $argv[1] - if test -z "$name" - set name (date +%s) - else - set -e argv[1] - end - set -l file "$TMPUTILS_DIR/$name" - if not test -d $TMPUTILS_DIR - mkdir -p $TMPUTILS_DIR - end - tee $argv $file - echo $file >$TMPUTILS_TMPFILE -end - -function tmpcat - set -l name $argv[1] - if test -z "$name" - cat (tmpfile) - return - end - cat "$TMPUTILS_DIR/$name" -end - -function tmpedit - set -l name $argv[1] - if test -z "$name" - $EDITOR (tmpfile) - return - end - $EDITOR "$TMPUTILS_DIR/$name" -end - -function tmpgrep - set -l name $argv[1] - set -e argv[1] - tmcpat $name | grep $argv -end - -function tmpfile - cat $TMPUTILS_TMPFILE -end - -abbr -a cdtmp "cd $TMPUTILS_DIR" diff --git a/dotfiles/fish/conf.d/tmux.fish b/dotfiles/fish/conf.d/tmux.fish deleted file mode 100644 index e65960e..0000000 --- a/dotfiles/fish/conf.d/tmux.fish +++ /dev/null @@ -1,94 +0,0 @@ -function _tmux::cleanup_default - tmux list-sessions | string match -r '^T.*: ' | string match -v -r attached | string split ':' | while read -l s - echo "Killing $s" - tmux kill-session -t "$s" - end -end - -function _tmux::connect_command - set -l server_or_pod $argv[1] - if test -z "$TMUX_KEXEC" - echo "ssh -A -t $server_or_pod" - else - echo "kubectl exec -it $server_or_pod -- /bin/bash" - end -end - -function tmux::new - set -l session $argv[1] - _tmux::cleanup_default - if test -z "$session" - tmux::new (string join "" T (date +%s)) - else - tmux new-session -d -s $session - tmux -2 attach-session -t $session || tmux -2 switch-client -t $session - end -end - -function tmux::attach - set -l session $argv[1] - if test -z "$session" - tmux attach-session || tmux::new - else - tmux attach-session -t $session || tmux::new $session - end -end - -function tmux::remote - set -l server $argv[1] - tmux new -s $server "ssh -A -t $server 'tmux attach-session || tmux'" || tmux attach-session -d -t $server -end - -function tmux::search - set -l session (tmux list-sessions | fzf | cut -d: -f1) - if test -z "$TMUX" - tmux attach-session -t $session - else - tmux switch -t $session - end -end - -function tmux::cluster_ssh - if test -f "$argv[1]" - tmux::tssh_from_file $argv[1] - return - end - tmux::tssh_from_argument $argv -end - -function tmux::tssh_from_argument - set -l session $argv[1] - set first_server_or_container $argv[2] - set remaining_servers $argv[3..-1] - if test -z "$first_server_or_container" - set first_server_or_container $session - end - - tmux new-session -d -s $session (_tmux::connect_command "$first_server_or_container") - if not tmux list-session | grep "^$session:" - echo "Could not create session $session" - return 2 - end - for server_or_container in $remaining_servers - tmux split-window -t $session "tmux select-layout tiled; $(_tmux::connect_command "$server_or_container")" - end - tmux setw -t $session synchronize-panes on - tmux -2 attach-session -t $session || tmux -2 switch-client -t $session -end - -function tmux::tssh_from_file - set -l serverlist $argv[1] - set -l session (basename $serverlist | cut -d. -f1) - tmux::tssh_from_argument $session (awk '{ print $1 }' $serverlist | sed 's/.lan./.lan/g') -end - -alias tn 'tmux::new' -alias ta 'tmux::attach' -alias tx 'tmux::remote' -alias ts 'tmux::search' -alias tssh 'tmux::cluster_ssh' -alias tm tmux -alias tl 'tmux list-sessions' -alias foo 'tmux::new foo' -alias bar 'tmux::new bar' -alias baz 'tmux::new baz' diff --git a/dotfiles/fish/conf.d/update.fish b/dotfiles/fish/conf.d/update.fish deleted file mode 100644 index abe9da0..0000000 --- a/dotfiles/fish/conf.d/update.fish +++ /dev/null @@ -1,75 +0,0 @@ -function update::tools - set pids - - echo "Installing/updating gofumpt" - go install mvdan.cc/gofumpt@latest & - set -a pids $last_pid - - echo "Installing/updating mage" - go install github.com/magefile/mage@latest & - set -a pids $last_pid - - echo "Installing/updating golangci-lint" - go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest & - set -a pids $last_pid - - echo "Installing/updating goimports" - go install golang.org/x/tools/cmd/goimports@latest & - set -a pids $last_pid - - for prog in hexai hexai-lsp hexai-tmux-action - echo "Installing/updating $prog from codeberg.org/snonux/hexai/cmd/$prog@latest" - go install codeberg.org/snonux/hexai/cmd/$prog@latest & - set -a pids $last_pid - end - - for prog in tasksamurai timr perc - echo "Installing/updating $prog from codeberg.org/snonux/$prog/cmd/$prog@latest" - go install codeberg.org/snonux/$prog/cmd/$prog@latest & - set -a pids $last_pid - end - - if test (uname) = Darwin - echo 'Updating cursor-agent on macOS' - cursor-agent update & - end - set -a pids $last_pid - - echo 'Updating claude' - claude update & - set -a pids $last_pid - - if test (uname) = Linux - echo "Installing/updating tgpt" - go install github.com/aandrew-me/tgpt/v2@latest & - set -a pids $last_pid - - for prog in gos gitsyncer yoga totalrecall - echo "Installing/updating $prog from codeberg.org/snonux/$prog/cmd/$prog@latest" - go install codeberg.org/snonux/$prog/cmd/$prog@latest - end - - # doas npm uninstall -g @qwen-code/qwen-code@latest - # doas npm install -g @qwen-code/qwen-code@latest - - echo "Installing/updating @openai/codex globally via npm" - doas npm uninstall -g @openai/codex - doas npm install -g @openai/codex - - echo "Installing/updating @google/gemini-cli globally via npm" - doas npm uninstall -g @google/gemini-cli - doas npm install -g @google/gemini-cli - - echo "Installing/updating @sourcegraph/amp globally via npm" - doas npm uninstall -g @sourcegraph/amp - doas npm install -g @sourcegraph/amp - - echo "Installing/updating opencode-ai globally via npm" - doas npm uninstall -g opencode-ai - doas npm install -g opencode-ai - end - - for pid in $pids - wait $pid - end -end diff --git a/dotfiles/fish/conf.d/utils.fish b/dotfiles/fish/conf.d/utils.fish deleted file mode 100644 index 33854a5..0000000 --- a/dotfiles/fish/conf.d/utils.fish +++ /dev/null @@ -1,155 +0,0 @@ -function fullest_i - df -i | sort -n -k 5 -end - -function fullest_h - df -h | sort -n -k 5 -end - -function usortn - sort | uniq -c | sort -n -end - -function asum - awk '{ sum += $1 } END { print sum }' -end - -function stop - set -l service $argv[1] - sudo service $service stop $argv -end - -function start - set -l service $argv[1] - sudo service $service start $argv -end - -function restart - set -l service $argv[1] - sudo service $service restart $argv -end - -function statuss - set -l service $argv[1] - sudo service $service status $argv -end - -function loop - set -l sleep 10 - if set -q SLEEP - set sleep $SLEEP - end - echo "sleep is $sleep" 1>&2 - while true - $argv - sleep $sleep - end -end - -function f - find . -iname "*$argv*" -end - -function random - set -l upto $argv[1] - set -l random (math $RANDOM % $upto) - echo "Sleeping $random seconds" - sleep $random -end - -function dedup - set -l file $argv[1] - if test -z $file - awk '{ if (line[$0] != 42) { print $0 }; line[$0] = 42; }' - else - awk '{ if (line[$0] != 42) { print $0 }; line[$0] = 42; }' $file | sudo tee $file.dedup >/dev/null - if test ! -f $file.dedupbak - sudo mv $file $file.dedupbak - end - sudo mv $file.dedup $file - wc -l $file $file.dedupbak - sudo gzip --best $file.dedupbak & - end -end - -function dedup_no_bak - set -l file $argv[1] - if test -z $file - awk '{ if (line[$0] != 42) { print $0 }; line[$0] = 42; }' - else - awk '{ if (line[$0] != 42) { print $0 }; line[$0] = 42; }' $file | sudo tee $file.dedup >/dev/null - if test ! -f $file.dedupbak - sudo mv $file $file.dedupbak - end - sudo mv $file.dedup $file - wc -l $file $file.dedupbak - sudo rm -v $file.dedupbak & - end -end - -function drop_caches - echo 3 | sudo tee /proc/sys/vm/drop_caches -end - -function ssl_connect - set -l address $argv[1] - openssl s_client -connect $address -end - -function ssl_dates - ssl_connect $argv | openssl x509 -noout -dates -end - -function lastu - last | grep -E -v '(root|cron|nagios)' -end - -function lastl - lastu | less -end - -abbr wetter 'curl http://wttr.in' - -abbr tf terraform - -function touchtype - tt --noskip --noreport --showwpm --bold --theme (tt -list themes | sort -R | head -n1) $argv -end - -function touchtype::quote - while true - touchtype -quotes en - sleep 0.2 - end -end - -function touchtype::scifi - find ~/git/scifi/summaries/ -type f -name \*.md | sort -R | head -n 1 | xargs cat | touchtype -end - -function checkcert - set host $argv[1] - set port $argv[2] - openssl s_client \ - -connect $host:$port \ - -servername $host \ - -showcerts /dev/null | openssl x509 -noout -dates -subject -end - -abbr typing 'touchtype::quote' - -function sway_config_view - less /etc/sway/config -end - -function ssh::force - set -l server $argv[1] - ssh-keygen -R $server - ssh -A $server -end - -if test -f ~/git/geheim/geheim.rb - function geheim - ruby ~/gi