You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
551 B
16 lines
551 B
function xdg-set
|
|
set filename (f)
|
|
if test "$filename" = ""
|
|
else
|
|
set beforeprogram (xdg-mime query default (xdg-mime query filetype $filename))
|
|
set program (find /usr/share/applications/ -type f | f)
|
|
if test "$program" = ""
|
|
else
|
|
echo "Open with $beforeprogram before changing"
|
|
xdg-mime default (echo $program | sed 's/.*\///g') (xdg-mime query filetype $filename)
|
|
set afterprogram (xdg-mime query default (xdg-mime query filetype $filename))
|
|
echo "Open with $afterprogram after change"
|
|
end
|
|
end
|
|
end
|