diff --git a/modules/home-config.nix b/modules/home-config.nix index 8d369b6..907eebb 100644 --- a/modules/home-config.nix +++ b/modules/home-config.nix @@ -1,8 +1,6 @@ # Inject the right home-manager config for the machine. { - config, pkgs, - lib, ... }: let @@ -239,7 +237,9 @@ in shellAliases = { #tmux = "tmux -f ~/.config/tmux/tmux.conf attach || tmux -f ~/.config/tmux/tmux.conf new"; bunx = "bun --bun x"; + c = "/home/mrflos/Code/nixos-config/scripts/tmux-sessionizer"; g = "lazygit"; + n = "/home/mrflos/Code/nixos-config/scripts/open-notes"; s = "/home/mrflos/Code/nixos-config/scripts/ssh-connect"; t = "/home/mrflos/Code/nixos-config/scripts/tmux-sessionizer"; kdenix = "nix run github:pjones/plasma-manager --extra-experimental-features nix-command --extra-experimental-features flakes > /home/mrflos/Developpements/nixos-config/modules/home-plasma.nix"; diff --git a/scripts/open-notes b/scripts/open-notes new file mode 100755 index 0000000..a7f8d32 --- /dev/null +++ b/scripts/open-notes @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +pushd ~/Nextcloud/Notes/ > /dev/null +if [[ $# -eq 1 ]]; then + selected=$1 +else + selected=$(rg . --files --glob "*.md" | sort -r -f | fzf) +fi + +if [[ -z $selected ]]; then + exit 0 +fi + +nvim "$selected" +popd > /dev/null diff --git a/scripts/tmux-sessionizer b/scripts/tmux-sessionizer index 12b00ff..f215fb7 100755 --- a/scripts/tmux-sessionizer +++ b/scripts/tmux-sessionizer @@ -1,6 +1,6 @@ #!/usr/bin/env bash -pushd ~/Code +pushd ~/Code > /dev/null if [[ $# -eq 1 ]]; then selected=$1 else @@ -15,13 +15,13 @@ selected_name=$(basename "$selected" | tr . _) tmux_running=$(pgrep tmux) if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then - tmux new-session -s $selected_name -c $selected + tmux new-session -s $selected_name -c $selected -d 'nvim .' + tmux a exit 0 fi if ! tmux has-session -t=$selected_name 2> /dev/null; then - tmux new-session -ds $selected_name -c $selected + tmux new-session -ds $selected_name -c $selected -d 'nvim .' fi - tmux switch-client -t $selected_name -popd +popd > /dev/null