phillbush / xfiles Goto Github PK
View Code? Open in Web Editor NEWConfigurable and simple file manager for X11
License: MIT License
Configurable and simple file manager for X11
License: MIT License
XFiles: a X11 File Manager <https://github.com/phillbush/xfiles> Features: • Icons representing directory entries. • Icon view only (list/culumn/tree/etc view is not and will not be implemented). • Uncluttered interface (no toolbar, sidebar, etc but grid of icons). • Mouse interaction with drag-and-drop and selection actions. • Drag-and-drop within the same XFiles window. • Drag-and-drop between two XFiles windows. • Drag-and-drop between an XFiles window and another application. • Scroller widget (activated on middle mouse button) replacing scrollbars. • XEmbed support, to incorporate other application's windows as widgets (for example, dmenu can be used as an address bar). • File operations are delegated to a user-written script (xfilesctl). • Thumbnail (64x64 PPM image) generation delegated to a script (xfilesthumb). • Appearance (like colors and font) customizable by X resources. See ./demo.png for a illustration of XFiles in action. § INSTALLATION Build XFiles with “make”. Copy the built binary file ./xfiles into your system's $PATH. Optionally, copy the manual file `./xfiles.1` in your system's $MANPATH. Optionally, copy the scripts in ./examples/ in your system's $PATH. Dependencies: • C99 compiler, for building. • POSIX make, for building. • Mandoc, for the manual. • POSIX C standard library and headers. • X11 libraries and headers (Xlib, Xcursor, Xext, Xft, Xpm, Xrender). • Fontconfig library and headers. • Pthreads library and headers. • (NOTE: The xfilesctl and xfilesthumb scripts may depend on other programs). § QUICK-START Context menu. XFiles has no context menu; but it invokes “xfilesctl” at right-click. You can make a xfilesctl script open xmenu(1) or other pop-up menu program. On right-click, it is invoked as follows (%s is the paths to selected files): xfilesctl menu %s Address bar. XFiles has no address bar; but it invokes “xfilesctl” at Ctrl+key presses. You can make a xfilesctl script open dmenu(1) or other prompt program. On, say, Ctrl+L, it is invoked as follows (%s is the paths to selected files): xfilesctl ^L %s File operations. XFiles does no file operation; but it invokes “xfilesctl” at icon manipulation. You can make a xfilesctl script call cp(1) or other command on a drop action. On file dropping, it is invoked as follows (%s is the path to selected files): xfilesctl drop-ask %s Thumbnails. XFiles does not generate thumbnails; but it invokes “xfilesthumb” to do so. Thumbnails must be 64x64 pixels in size, and must be in the PPM format. You can make a xfilesthumb script call pdftoppm(1) to create a pdf thumbnail. The xfilesthumb script is invoked as follows: xfilesthumb /path/to/file /path/to/miniature.ppm Examples. See the ./examples/ directories for script and configuration examples: • ./examples/xfilesctl (example controller script). • ./examples/xfilesthumb (example thumbnailer script). • ./examples/Xresources (example X resources database). Read the manual at ./xfiles.1 for more information on usage. § CONTRIBUTING If possible, send feedback (positive or negative) via email or issue tracker. If possible, report bugs (possibly with a fix) via email or issue tracker. Feature requests and patches adding new features are welcome. But it is ultimately up to author's discretion to approve them or not. Keep in mind that this is a personal project and a work in progress. Read ./TODO for a list of known bugs and features intended to be added. § AUTHOR By Lucas de Sena <lucas at seninha dot org> © 2021-2024. Code and manual distributed under the MIT/X license. Icons are distributed under CC0/Public Domain. See ./LICENSE for more information.
self explanatory? i don't understand xfile's functions yet so i cant really see why this is the case.
If you would sync the view's current directory with the process' working directory we could use xcwd. This is useful for instance for the window manager in order to do something in the current directory.
I know that you provide the _CONTROL_CWD
property, but xcwd
already works with a number of applications.
as it is now you can't differentiate a file/directory from a symbolic link to a
file/directory, thats because the use of stat(2)
which will follow the symbolic link,
maybe add an extra flag to the mode, something like MODE_LINK
and use lstat(2)
to set that, which later can be used to draw an arrow or something similar at the
bottom right corner of the icon if it is a symlink, you know better the source so I'm
sure that you can think of a better way to do it :D
I can't get thumbnails to work. I just used 39b16e3 (latest commit)
and set XFILES_THUMBNAILDIR.
What am I missing?
ImageMagick 6.9.11-60
drwxrwxrwx xfiles
$echo $XFILES_THUMBNAILDIR
/home/j/.cache/xfile
just gave it all permissions to make sure drwxrwxrwx
$ xfiles
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Albedo.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Albedo_LOD4.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Albedo_LOD5.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Displacement.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Fuzz.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD0.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD1.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD2.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD3.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD4.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Normal_LOD5.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_4K_Roughness.jpg.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Megascans Library%Downloaded%3d%nature_tree_vfsocfubw%vfsocfubw_Preview.png.ppm': Datei oder Verzeichnis nicht gefunden @ error/blob.c/OpenBlob/2924.
Could not write image to /home/j/.cache/xfile/%home%j%Downloads%7.3inch_e-Paper_(G)_Specification.pdf.ppm; exiting
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads0og.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%image004.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%proxy-image.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%proxy-image.png.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%signal-2022-12-15-163536_002.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%signal-2022-12-15-163536_003.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%signal-2022-12-15-163536_004.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
convert-im6.q16: unable to open image `/home/j/.cache/xfile/%home%j%Downloads%signal-2022-12-16-124032_002.jpeg.ppm': No such file or directory @ error/blob.c/OpenBlob/2924.
Unlike #34 opening the directory is fine, but clicking on the file or moving to it with the arrow keys causes segmentation fault.
Hello Seninha,
your filemanger looks really cool! Wanted to give it try, but I was not able to compile xfiles. This is most likely my incompetence, but maybe consider adding some documentation on that topic.
/usr/bin/ld: widget.o: in function `createwin':
widget.c:(.text+0x9f): undefined reference to `XParseGeometry'
/usr/bin/ld: widget.c:(.text+0x2a6): undefined reference to `XCreateWindow'
/usr/bin/ld: widget.c:(.text+0x340): undefined reference to `XCreatePixmap'
/usr/bin/ld: widget.c:(.text+0x454): undefined reference to `XmbSetWMProperties'
/usr/bin/ld: widget.c:(.text+0x489): undefined reference to `XSetWMProtocols'
/usr/bin/ld: widget.c:(.text+0x4e7): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x539): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x584): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x5cc): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.o: in function `ealloccolor':
widget.c:(.text+0x646): undefined reference to `XftColorAllocName'
/usr/bin/ld: widget.o: in function `eallocfont':
widget.c:(.text+0x688): undefined reference to `XftFontOpenXlfd'
/usr/bin/ld: widget.c:(.text+0x6b7): undefined reference to `XftFontOpenName'
/usr/bin/ld: widget.o: in function `getresource':
widget.c:(.text+0x7a3): undefined reference to `XrmGetResource'
/usr/bin/ld: widget.o: in function `textwidth':
widget.c:(.text+0x7f1): undefined reference to `XftTextExtentsUtf8'
/usr/bin/ld: widget.o: in function `inittheme':
widget.c:(.text+0x8b7): undefined reference to `XResourceManagerString'
/usr/bin/ld: widget.c:(.text+0x8ce): undefined reference to `XrmGetStringDatabase'
/usr/bin/ld: widget.c:(.text+0xbf9): undefined reference to `XrmDestroyDatabase'
/usr/bin/ld: widget.c:(.text+0xcd6): undefined reference to `XftColorFree'
/usr/bin/ld: widget.c:(.text+0xd1f): undefined reference to `XftFontClose'
/usr/bin/ld: widget.c:(.text+0xd32): undefined reference to `XrmDestroyDatabase'
/usr/bin/ld: widget.o: in function `calcsize':
widget.c:(.text+0x103c): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x106a): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x110d): undefined reference to `XCreatePixmap'
/usr/bin/ld: widget.c:(.text+0x1170): undefined reference to `XCreatePixmap'
/usr/bin/ld: widget.o: in function `drawtext':
widget.c:(.text+0x1223): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x126b): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x1294): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x12dc): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x1348): undefined reference to `XftDrawCreate'
/usr/bin/ld: widget.c:(.text+0x1388): undefined reference to `XftDrawStringUtf8'
/usr/bin/ld: widget.c:(.text+0x1398): undefined reference to `XftDrawDestroy'
/usr/bin/ld: widget.o: in function `drawicon':
widget.c:(.text+0x16fa): undefined reference to `XPutImage'
/usr/bin/ld: widget.c:(.text+0x1750): undefined reference to `XSetFillStyle'
/usr/bin/ld: widget.c:(.text+0x1782): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x188c): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x18b9): undefined reference to `XSetFillStyle'
/usr/bin/ld: widget.c:(.text+0x1925): undefined reference to `XChangeGC'
/usr/bin/ld: widget.c:(.text+0x1975): undefined reference to `XCopyArea'
/usr/bin/ld: widget.c:(.text+0x19cb): undefined reference to `XSetFillStyle'
/usr/bin/ld: widget.c:(.text+0x19fd): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x1a44): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x1a71): undefined reference to `XSetFillStyle'
/usr/bin/ld: widget.c:(.text+0x1aa9): undefined reference to `XChangeGC'
/usr/bin/ld: widget.o: in function `drawlabel':
widget.c:(.text+0x1f25): undefined reference to `XCopyArea'
/usr/bin/ld: widget.c:(.text+0x1f8b): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x204d): undefined reference to `XDrawRectangle'
/usr/bin/ld: widget.c:(.text+0x21c5): undefined reference to `XCopyArea'
/usr/bin/ld: widget.c:(.text+0x22c2): undefined reference to `XCopyArea'
/usr/bin/ld: widget.o: in function `drawitem':
widget.c:(.text+0x2420): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x246f): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.o: in function `drawitems':
widget.c:(.text+0x24f5): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x2553): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.o: in function `commitdraw':
widget.c:(.text+0x25ee): undefined reference to `XClearWindow'
/usr/bin/ld: widget.c:(.text+0x2679): undefined reference to `XCopyArea'
/usr/bin/ld: widget.c:(.text+0x26e6): undefined reference to `XChangeGC'
/usr/bin/ld: widget.c:(.text+0x2718): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x2778): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x27c3): undefined reference to `XChangeGC'
/usr/bin/ld: widget.c:(.text+0x27d6): undefined reference to `XFlush'
/usr/bin/ld: widget.o: in function `settitle':
widget.c:(.text+0x2a1d): undefined reference to `XmbSetWMProperties'
/usr/bin/ld: widget.c:(.text+0x2a7e): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.o: in function `drawscroller':
widget.c:(.text+0x2b69): undefined reference to `XCreatePixmap'
/usr/bin/ld: widget.c:(.text+0x2ba1): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x2bd7): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x2c04): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x2c48): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x2c6e): undefined reference to `XSetWindowBackgroundPixmap'
/usr/bin/ld: widget.c:(.text+0x2c8c): undefined reference to `XClearWindow'
/usr/bin/ld: widget.c:(.text+0x2ca3): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.o: in function `initwidget':
widget.c:(.text+0x34dd): undefined reference to `XInitThreads'
/usr/bin/ld: widget.c:(.text+0x3512): undefined reference to `XSupportsLocale'
/usr/bin/ld: widget.c:(.text+0x3536): undefined reference to `XOpenDisplay'
/usr/bin/ld: widget.c:(.text+0x3586): undefined reference to `XSyncQueryExtension'
/usr/bin/ld: widget.c:(.text+0x35c1): undefined reference to `XSyncInitialize'
/usr/bin/ld: widget.c:(.text+0x3607): undefined reference to `XInternAtoms'
/usr/bin/ld: widget.c:(.text+0x3617): undefined reference to `XConnectionNumber'
/usr/bin/ld: widget.c:(.text+0x36b2): undefined reference to `XCreateGC'
/usr/bin/ld: widget.c:(.text+0x3805): undefined reference to `XCreateWindow'
/usr/bin/ld: widget.c:(.text+0x38ba): undefined reference to `XpmCreatePixmapFromData'
/usr/bin/ld: widget.c:(.text+0x3943): undefined reference to `XCreatePixmap'
/usr/bin/ld: widget.c:(.text+0x39bf): undefined reference to `XCreateGC'
/usr/bin/ld: widget.c:(.text+0x3a13): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x3a50): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x3a77): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x3ab4): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x3ae1): undefined reference to `XSetStipple'
/usr/bin/ld: widget.c:(.text+0x3af6): undefined reference to `XCreateFontCursor'
/usr/bin/ld: widget.c:(.text+0x3b16): undefined reference to `XCreateFontCursor'
/usr/bin/ld: widget.c:(.text+0x3b3b): undefined reference to `XSyncListSystemCounters'
/usr/bin/ld: widget.c:(.text+0x3bcf): undefined reference to `XSyncFreeSystemCounterList'
/usr/bin/ld: widget.c:(.text+0x3c09): undefined reference to `XSyncIntToValue'
/usr/bin/ld: widget.c:(.text+0x3c20): undefined reference to `XSyncIntToValue'
/usr/bin/ld: widget.c:(.text+0x3c57): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x3c85): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x3cb3): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x3ce1): undefined reference to `XDestroyWindow'
/usr/bin/ld: widget.c:(.text+0x3d0f): undefined reference to `XDestroyWindow'
/usr/bin/ld: widget.c:(.text+0x3d2c): undefined reference to `XCloseDisplay'
/usr/bin/ld: widget.o: in function `mapwidget':
widget.c:(.text+0x4042): undefined reference to `XMapWindow'
/usr/bin/ld: widget.o: in function `ownselection':
widget.c:(.text+0x4402): undefined reference to `XSetSelectionOwner'
/usr/bin/ld: widget.o: in function `getatompairs':
widget.c:(.text+0x446a): undefined reference to `XGetWindowProperty'
/usr/bin/ld: widget.c:(.text+0x44a1): undefined reference to `XFree'
/usr/bin/ld: widget.c:(.text+0x44f8): undefined reference to `XFree'
/usr/bin/ld: widget.o: in function `convert':
widget.c:(.text+0x4573): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x4613): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x4684): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x46f7): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.c:(.text+0x4793): undefined reference to `XChangeProperty'
/usr/bin/ld: widget.o:widget.c:(.text+0x47cd): more undefined references to `XChangeProperty' follow
/usr/bin/ld: widget.o: in function `sendselection':
widget.c:(.text+0x4b0c): undefined reference to `XSendEvent'
/usr/bin/ld: widget.o: in function `rectdraw':
widget.c:(.text+0x4cd0): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x4d21): undefined reference to `XFillRectangle'
/usr/bin/ld: widget.c:(.text+0x4e21): undefined reference to `XSetForeground'
/usr/bin/ld: widget.c:(.text+0x4e7a): undefined reference to `XDrawRectangle'
/usr/bin/ld: widget.o: in function `querypointer':
widget.c:(.text+0x566b): undefined reference to `XQueryPointer'
/usr/bin/ld: widget.o: in function `rectmotion':
widget.c:(.text+0x56fd): undefined reference to `XSyncCreateAlarm'
/usr/bin/ld: widget.c:(.text+0x5754): undefined reference to `XSyncDestroyAlarm'
/usr/bin/ld: widget.c:(.text+0x586a): undefined reference to `XSyncChangeAlarm'
/usr/bin/ld: widget.c:(.text+0x59ee): undefined reference to `XNextEvent'
/usr/bin/ld: widget.c:(.text+0x5a40): undefined reference to `XSyncDestroyAlarm'
/usr/bin/ld: widget.o: in function `scrollmotion':
widget.c:(.text+0x5c66): undefined reference to `XMoveWindow'
/usr/bin/ld: widget.c:(.text+0x5c8a): undefined reference to `XMapRaised'
/usr/bin/ld: widget.c:(.text+0x5cb0): undefined reference to `XSyncCreateAlarm'
/usr/bin/ld: widget.c:(.text+0x5d00): undefined reference to `XSyncDestroyAlarm'
/usr/bin/ld: widget.c:(.text+0x5da4): undefined reference to `XSyncChangeAlarm'
/usr/bin/ld: widget.c:(.text+0x5f92): undefined reference to `XNextEvent'
/usr/bin/ld: widget.c:(.text+0x5fcb): undefined reference to `XSyncDestroyAlarm'
/usr/bin/ld: widget.c:(.text+0x5fef): undefined reference to `XUnmapWindow'
/usr/bin/ld: widget.o: in function `pixmapfromdata':
widget.c:(.text+0x60fc): undefined reference to `XpmCreatePixmapFromData'
/usr/bin/ld: widget.o: in function `pixmapfromfile':
widget.c:(.text+0x61cd): undefined reference to `XpmReadFileToPixmap'
/usr/bin/ld: widget.o: in function `keypress':
widget.c:(.text+0x62e5): undefined reference to `XkbLookupKeySym'
/usr/bin/ld: widget.o: in function `mainmode':
widget.c:(.text+0x6b8e): undefined reference to `XUngrabPointer'
/usr/bin/ld: widget.c:(.text+0x6ba1): undefined reference to `XFlush'
/usr/bin/ld: widget.c:(.text+0x6ccc): undefined reference to `XNextEvent'
/usr/bin/ld: widget.o: in function `pollwidget':
widget.c:(.text+0x6d1a): undefined reference to `XNextEvent'
/usr/bin/ld: widget.c:(.text+0x6d6f): undefined reference to `XPending'
/usr/bin/ld: widget.o: in function `closewidget':
widget.c:(.text+0x6e28): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x6e76): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x6ebe): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x6edc): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.c:(.text+0x6efa): undefined reference to `XFreePixmap'
/usr/bin/ld: widget.o:widget.c:(.text+0x6f18): more undefined references to `XFreePixmap' follow
/usr/bin/ld: widget.o: in function `closewidget':
widget.c:(.text+0x6ff7): undefined reference to `XftColorFree'
/usr/bin/ld: widget.c:(.text+0x7031): undefined reference to `XftFontClose'
/usr/bin/ld: widget.c:(.text+0x704f): undefined reference to `XDestroyWindow'
/usr/bin/ld: widget.c:(.text+0x706d): undefined reference to `XDestroyWindow'
/usr/bin/ld: widget.c:(.text+0x708b): undefined reference to `XFreeGC'
/usr/bin/ld: widget.c:(.text+0x709b): undefined reference to `XCloseDisplay'
/usr/bin/ld: widget.o: in function `setthumbnail':
widget.c:(.text+0x7636): undefined reference to `XCreateImage'
/usr/bin/ld: widget.c:(.text+0x76a4): undefined reference to `XInitImage'
/usr/bin/ld: widget.o: in function `widgetcursor':
widget.c:(.text+0x7800): undefined reference to `XDefineCursor'
/usr/bin/ld: widget.c:(.text+0x7810): undefined reference to `XFlush'
/usr/bin/ld: util.o: in function `etcreate':
util.c:(.text+0x2c4): undefined reference to `pthread_create'
/usr/bin/ld: util.o: in function `etjoin':
util.c:(.text+0x313): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make: *** [Makefile:19: xfiles] Fehler 1
Could it be possible to “open every folder in its own window” like caja?
When starting at, or cd-ing into a directory that contains files owned by a user that isn't on the system xfiles exits with segmentation fault.
After a bit of trial and error, I found that it happens after the first statusbar commit:
ab8e0e3
A video is worth a thousand images...
I am on FreeBSD 14.1-RELEASE-p2.
In examples/xfilesctl you are apparently using XEmbed, for instance in edit()
.
This is broken for most XEmbed-conforming applications. For instance, simpleterm/st (st -w $WINDOWID
) does not work at all - it is not visible. Urxvt (urxvt -embed $WINDOWID
) somewhat works, but the window is never focused and does not react to font size changes properly.
SciTECO (gsciteco --xembed=$WINDOWID
), which is using GtkPlug, does not work at all - nothing is visible while the process is running in the background.
The same btw. is true when using dmenu -w
in prompt()
, although rofi -dmenu -w $WINDOWID
appears to work correctly.
It looks like the Xembed protocol is not fully implemented at the xfiles-side.
i've recently found myself having to manually kill XFiles in the terminal due to unexpected errors it faces, one of which are failing to thumbnail.
if the thumbnailer itself fails, and returns a non 0 return code, XFiles will just hang.
i've also faced this weird error:
xfiles: /home/sewn: No such file or directory
and XFiles just hangs, despite rendering my home directory correctly.
drop-ask /home/wael/.profile
The ability to limit navigation to a specific folder and its subfolders, like in xplr.
Linux provides an API for file changes called inotify, xfiles can use this API to refresh or reload the file view for new changes in the folder.
The icons for executable file and symlink directory are not loaded anymore, instead the default file/dir icons are shown.
Being able to have a virtual filesystem view created from list of paths from stdin or from a script would have uses. It would make it possible to create a trash bin, with #29. Or create a virtual view from Export File Format used by ncdu. If implemented, it maybe necessary to be able to set a custom xfilesctl script.
I do not know if this is in line with what you have been planning for xfiles, but I thought i'd atleast ask.
Again, huge thanks for XFiles, this is really a great tool! I'm currently testing using the MLVWM (Macintosh-Like Virtual Window Manager) window manager, which does not yet support Extended Window Manager Hints (EWMH; i.e. NetWM). Unfortunately, all the xfiles
windows have a title of 'Untitled' instead of the file path and app name:
xprop
on the window outputs the following:
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_CONTROL_CWD(UTF8_STRING) = "~"
_CONTROL_STATUS(UTF8_STRING) =
XdndAware(ATOM) = BITMAP
_NET_WM_PID(CARDINAL) = 33011
_NET_WM_ICON(CARDINAL) = Icon (16 x 16):
░░░░░░░░░░░░██
░░ ░░██
░░░░ ░░░░░░░░░░░░░░
░░ ░░░░░░░░░░░░ ░░██
░░ ░░ ░░██
░░ ░░██
░░ ░░ ░░ ░░██
░░ ░░ ░░██
░░ ░░ ░░ ░░ ░░██
░░ ░░ ░░ ░░██
░░ ░░██
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
████████████████████████████████
Icon (32 x 32):
░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░ ░░░░
░░ ░░░░░░
░░ ░░░░
░░ ░░ ░░ ░░░░░░░░░░░░░░░░░░░░░░
░░ ░░ ░░ ░░██
░░ ░░░░░░░░░░░░░░░░░░░░░░░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░ ░░██
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██
████████████████████████████████████████████████████████████████
Icon (64 x 64):
(not shown)
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_NAME(UTF8_STRING) = "~ - XFiles"
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "xfiles", "XFiles"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
WM_CLIENT_MACHINE(STRING) = "host.example.com"
WM_COMMAND(STRING) = { "xfiles" }
WM_ICON_NAME(STRING) = "XFiles"
WM_NAME(TEXT) = "~ - XFiles"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
It does appear that both WM_NAME
& _NET_WM_NAME
are set appropriately. This certainly may be a bug in MLVWM, but I haven't experienced this for other X11 applications the actually set both, so I figured I'd mention it here so we could test other window managers.
Sometimes I get a segmentation fault when I close the xfiles window with the 'X' button.
Apparently it crashes on line 3228 of widget.c where XCloseDisplay gets called.
if (widget->gc != NULL)
XFreeGC(widget->display, widget->gc);
if (widget->display != NULL)
XCloseDisplay(widget->display); // errors here
FREE(widget);
From what I found online, it could be an NVIDIA issue or a threading issue but I assume the former since no one else has reported on this yet.
This is not a super important issue, since xfiles gets closed anyway.
for example:
export FILE_ICONS="
d:..=$ICONPATH/64x64/folder-up.xpm
d:$HOME=$ICONPATH/64x64/folder-home.xpm
d:*=$ICONPATH/64x64/folder.xpm
-:*.zip|*.tar.*|*.tar|*.gz|*.rar=$ICONPATH/64x64/file-archive.xpm
-:*.mp4|*.webm|*.mkv|*.mov=$ICONPATH/64x64/file-video.xpm
-:*.xpm|*.xbm|*.png|*.jpg|*.ppm|*.jpeg|*.gif=$ICONPATH/64x64/file-image.xpm
-:*.mp[23]|*.ogg|*.opus|*.flac=$ICONPATH/64x64/file-music.xpm
-:*.pdf|*.epub|*.txt|*.ps|*.eps|*.djvu=$ICONPATH/64x64/file-text.xpm
*=$ICONPATH/64x64/file.xpm
"
ICONPATH
is unknown. (hopefully) if icons are going to be installed in PREFIX/share/xfiles/icons
; controlled by Makefile; could easily be picked up by xfiles for example like
d:..=folder-up
I have noticed that I tend to prefer list view when using file managers.
Would it be possible to get list view on xfiles, or is that out-of-scope?
The fixed icon size can be very small on high resolution displays, especially for the thumbnails. It would be cool, if we could increase the icon size and give more space to the thumbnails.
I guess that you don't want to support vector/SVG icons - and that's great - you should avoid code bloat. However, a simple linear interpolation of the pixbufs would suffice. Or even simpler: don't scale the XPM icons at all but just increase the grid spacing, giving thumbnails more space.
I propose support for the Freedesktop.org Thumbnail specification be added, its rather straightforward, it can even be implemented in a SH script, the only thing that would need to be added is a png library and an md5 library, for which I propose https://github.com/Zunawe/md5-c and stb_image.h be used, because they are simple and suckless
https://web.archive.org/web/20230304184025/https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html
https://specifications.freedesktop.org/thumbnail-spec/latest/
This is an example for determining the path of a thumbnail, POSIX SH (works with sbase
and toybox
, runs with ash
(busybox) and ksh93
in POSIX mode, didn't test with toysh
because it strives for complete bash
compability)
#!/bin/sh
# Function to calculate the MD5 hash of a URI
calculate_md5() {
if ! printf "%s" "$1" | md5sum | cut -d ' ' -f1; then
echo "There was an error calculating the MD5 hash. Quitting..."
exit 1
fi
# Return the hash value
echo "$hash"
}
# Function to determine the correct path to a thumbnail for a file
calc_thumbnail() {
input_file="$1"
thumbnail_file="$2"
# Ensure input file and thumbnail file are specified
if [ -z "$input_file" ] || [ -z "$thumbnail_file" ]; then
echo "Usage: $0 [file_to_thumbnail] [128x128thumbnail.png]"
exit 1
fi
# Check if the thumbnail file exists
if [ ! -f "$thumbnail_file" ]; then
echo "The thumbnail file does not exist."
exit 1
fi
# Determine the canonical URI of the input file
abs_path=$(readlink -f "$input_file")
uri="file://$abs_path"
# Calculate the MD5 hash of the URI
hash=$(calculate_md5 "$uri")
# Determine the target directory and filename for the thumbnail
thumbnail_dir="${XDG_CACHE_HOME:-$HOME/.cache}/thumbnails/normal"
thumbnail_path="$thumbnail_dir/$hash.png"
# Copy the provided thumbnail to the target path
echo "$thumbnail_file should have its thumb at: $thumbnail_path"
}
# Call the function with arguments
calc_thumbnail "$1" "$2"
The thumbnail xdg specification goes on and on about different sizes for thumbnails, but I don't think you would be interested in adding support for it, even if trivial, because xfiles
uses xpm
files.
title.
for example, xfilesctl can run with file .profile
as an argument, but that won't work due to PWD. is this intentional because xfilesctl will be spawned in the pwd of the xfiles gui?
To test the functionality of XFILES_CONTEXTCMD I've created this script:
#!/usr/bin/sh
notify-send "triggered"
echo "$@"
notify-send "$@"
When I rightclick in xfiles the notify-send command gets triggered, but the pathes seem not to be there.
Am I missing something?
in my eyes, mime types have existed simply to remove the need for having to add every single extension to every single program, when needed; instead of using a single database that can simply have one 'mime' type for various extensions.
for xfiles, this can save some effort in the configuration file, so the user doesnt have to know which extensions and have to go to the hassle of re-configuring and re-compiling. i had faced this earlier today with .webp files and .opus files.
it seems both linux and openbsd support magic(4), via magic.h
.
tl;dr
export XFILES_THUMBNAILDIR=/home/wael/.cache/xfiles
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
convert: unable to open image '/home/wael/.cache/xfiles/%foo%bar%baz.jpg.ppm': No such file or directory @ error/blob.c/OpenBlob/3570.
Launching xfiles with middle desktop click (xclickroot -m xfiles) causes xfiles crash every time right click menu (pmenu) is released.
Error message:
xfiles: waitpid: No child processes
Allow for xfiles to select a few files to stdout seperated by newlines, after xfiles quits.
nnn(1) has support for this via the -p
parameter.
Hi! Here is the error code:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Value in failed request: 0x0
Serial number of failed request: 385
Current serial number in output stream: 396
I did some debugging and it is caused by a call to calcsize with w
or h
set to 0
from the ConfigureNotify event handler.
The thumbnail path could follow system links. So thumbnails do not need to be regenerated.
I'm imagining of a workflow where we can use symlinks to make virtual folders, but do not regenerate thumbnails.
Examples are:
A file search presents its result in a "virtual folders" with the found files linked in it.
"Virtual folders" based on file tags.
The follow system links feature could be enabled with a flag.
Terminals spawned from XFiles inherit an umask of 0000, regardless of what it had been set previously.
Tested also with an original xfilesctl.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.