1
0
Fork 0

add mimeapps

This commit is contained in:
Vladimír Dudr 2023-06-23 09:27:11 +02:00
parent f0dd8585f8
commit a0f3d841e1
3 changed files with 35 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#!/bin/php
<?php
$url = parse_url($argv[1] ?? '');
if (($url['scheme'] ?? 'hovno') != 'vscode') {
exec('notify-send "Unknown scheme " "'.$url['scheme'].'" -u critical');
exit;
}
parse_str($url['query'], $query);
$remote = $query['url'];
preg_match('|/(?<repo>[^/]*)\.git$|', $remote, $res);
$repo = $res['repo'];
chdir('/home/vladimir/jopixel/');
exec("git clone '$remote'");
chdir('/home/vladimir/jopixel/'.$repo);
pcntl_exec('/bin/zsh');

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Man
Comment=Manual pages reader
Terminal=true
Exec=/home/vladimir/bin/manurlhandler %u

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Vscode
Comment=open vscode urls
Terminal=true
Exec=/home/vladimir/bin/handle_vscode %u