file-browser: Icons, identification of PDFs, little launcher wrapper
This commit is contained in:
parent
8d029531f8
commit
9ad23299c7
@ -667,6 +667,10 @@ static void load_directory(const char * path, int modifies_history) {
|
||||
sprintf(f->icon, "font");
|
||||
sprintf(f->launcher,"exec font-preview");
|
||||
sprintf(f->filetype, "TrueType Font");
|
||||
} else if (has_extension(f, ".pdf")) {
|
||||
sprintf(f->icon, "pdf");
|
||||
sprintf(f->launcher,"exec maybe-pdfviewer.krk");
|
||||
sprintf(f->filetype, "Portable Document Format");
|
||||
} else if (has_extension(f, ".tgz") || has_extension(f, ".tar.gz")) {
|
||||
sprintf(f->icon, "package_targz");
|
||||
sprintf(f->filetype, "Compressed Archive File");
|
||||
|
11
apps/maybe-pdfviewer.krk
Normal file
11
apps/maybe-pdfviewer.krk
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/kuroko
|
||||
import os
|
||||
import kuroko
|
||||
|
||||
try:
|
||||
os.stat('/usr/bin/pdfviewer')
|
||||
os.execl('/usr/bin/pdfviewer','pdfviewer',kuroko.argv[1])
|
||||
except os.OSError:
|
||||
if os.system('showdialog "PDF Viewer" "/usr/share/icons/48/pdf.png" "Do you want to install the PDF viewer from the Package Manager?"') == 0:
|
||||
os.system('terminal gsudo sh -c "msk update; msk install mupdf"')
|
||||
os.execl('/usr/bin/pdfviewer','pdfviewer',kuroko.argv[1])
|
BIN
base/usr/share/icons/48/pdf.png
Normal file
BIN
base/usr/share/icons/48/pdf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue
Block a user