add mimeapps
This commit is contained in:
parent
f0dd8585f8
commit
a0f3d841e1
3 changed files with 35 additions and 0 deletions
21
bin/executable_handle_vscode
Normal file
21
bin/executable_handle_vscode
Normal 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');
|
7
dot_local/share/applications/man.desktop
Normal file
7
dot_local/share/applications/man.desktop
Normal 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
|
7
dot_local/share/applications/vscode-url-handler.desktop
Normal file
7
dot_local/share/applications/vscode-url-handler.desktop
Normal 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
|
Loading…
Add table
Reference in a new issue