better pingo(?)

This commit is contained in:
2025-12-22 23:08:08 +01:00
parent 7186539675
commit af0f4c83ba
2 changed files with 23 additions and 18 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png"
debug { debug {
render-drm-device "/dev/dri/card2" render-drm-device "/dev/dri/card0"
} }
// gestures { // gestures {
+22 -17
View File
@@ -116,24 +116,29 @@ if type -q git
git clone $repo git clone $repo
end end
if type -q idea function pingo
function pingo cd "$HOME/Repositories/PGdP" || return 1
cd "$HOME/Repositories/PGdP" || return 1 set -l repo (wl-paste)
set -l repo (wl-paste) if not string match -r '^(http|https|git|ssh)://|^git@' "$repo" >/dev/null 2>&1
if not string match -r '^(http|https|git|ssh)://|^git@' "$repo" >/dev/null 2>&1 echo "Error: Clipboard does not contain a valid git repository URL." >&2
echo "Error: Clipboard does not contain a valid git repository URL." >&2 echo "Error: Clipboard content: $repo" >&2
echo "Error: Clipboard content: $repo" >&2 read -P "Enter a valid git repository URL: " repo
read -P "Enter a valid git repository URL: " repo if not string match -r '^(http|https|git|ssh)://|^git@' "$repo"
if not string match -r '^(http|https|git|ssh)://|^git@' "$repo" echo "Error: Invalid git repository URL." >&2
echo "Error: Invalid git repository URL." >&2 return 1
return 1
end
end end
set -l dir_name (basename $repo .git) end
if ! test -d $dir_name set -l dir_name (basename "$repo" .git)
git clone $repo || return 1 if ! test -d "$dir_name"
end git clone $repo || return 1
nohup idea $dir_name >/dev/null 2>&1 & disown end
set -l app $argv[1]
if test -n "$app"; and type -q "$app"
echo Opening project with "$app"
nohup $app $dir_name >/dev/null 2>&1 & disown
else
echo Opening method missing or invalid
cd $dir_name
end end
end end
end end