Giter Club home page Giter Club logo

xfiles's Introduction

                       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.

xfiles's People

Contributors

20mattia02 avatar alpheratz0 avatar apprehensions avatar morgant avatar phillbush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xfiles's Issues

Change the process' working directory

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.

symbolic link identification

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

Thumbnails not working - convert-im6.q16: unable to open image

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.

undefined references

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.

err.log

/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

two selection bugs

  • part of the selection rectangle is not rendered (I think that the problem is here)
  • the last item is selected but it should not

A video is worth a thousand images...

selection_bug.mp4

XEmbedding terminals and editors via xfilesctl is broken

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.

xfiles should exit on unexpected error

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.

Virtual root

The ability to limit navigation to a specific folder and its subfolders, like in xplr.

Virtual filesystem

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.

All XFiles windows have 'Untitled' title when running MLVWM window manager

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:

screenshot-20230712-174459

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.

Seg fault on close

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.

feature request: icons should be installed and easily picked up by xfiles

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

List view

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?

[Feature Request] Support zooming or changing the icon size

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.

Could support for the Freedesktop.org Thumbnail specification be added?

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.

Pahtes seem not to be send to XFILES_CONTEXTCMD

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?

using mime types instead of extensions

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.

thumbnailing will fail if thumbnaildir does not exist

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.

Xfiles crash when launched trough xclickroot

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

Select files as prompt

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.

xfiles crashing when launched while a window is in fullscreen mode

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.

Feature Request: Make Thumbnails Follow Sym Links

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.