Giter Site home page Giter Site logo

xfiles's Introduction

XFiles

XFiles is a file manager for X11. It can navigate through directories, show icons for files, select files, call a command to open files, generate thumbnails, and call a command to run on right mouse button click.

Options

XFiles understand the following command-line options in addition to a directory given as argument.

  • -a: List all files, including dotfiles.
  • -N name: Specify a resource/instance name for XFiles.
  • -X resources: Specify X resources for XFiles.

Environment

XFiles depends on a few environment variables to be usable:

  • OPENER: Program to be called to open files. Defaults to xdg-open.
  • CACHEDIR or XDG_CACHE_HOME: Path to directory where thumbnails must be cached.

Scripting

XFiles depends on a few scripts that the user must have in their $PATH. XFiles comes with examples for those scripts.

  • xfilesctl: Script called when the user interacts with XFiles. This script can handle menus, file dropping and key presses. The example xfilesctl script that comes with XFiles uses xmenu for context menus and dmenu for the URL bar. It also uses xclip(1) for dealing with the clipboard.

  • xfilesthumb: Script called for generating thumbnails. Thumbnails are 64x64 images in the PPM format containing miniatures for files. The example script xfilesthumb script that comes with XFiles uses ImageMagick, ffmpegthumbnailer, librsvg and pdftoppm to generate thumbnails for different types of files. For thumbnails to work, either the environment variable CACHEDIR or XDG_CACHE_HOME must be set to the path of an existing writeable and readable directory where a directory will be created for thumbnails to be cached.

Customization

XFiles can be customized by setting the following X resources, either before invoking XFiles, or while it is running (XFiles updates its theme after a updating the X resources database with xrdb).

  • XFiles.faceName: Font for drawing text.
  • XFiles.faceSize: Font size.
  • XFiles.fileIcons: File glob patterns to icons associations.
  • XFiles.opacity: Background opacity (from 0.0 to 1.0).
  • XFiles.background: Background color.
  • XFiles.foreground: Text color.
  • XFiles.activeBackground: Background color for selected entries.
  • XFiles.activeForeground: Text color for selected entries.
  • XFiles.statusBarEnable: Whether to enable the statusbar.

Non-features

XFiles does not come with any of the following features:

  • Context menu: Use xmenu or pmenu for that.
  • URL bar: Use dmenu for that.
  • File operations: Use mv, cp for that.
  • File opening: Use xdg-open for that.
  • Clipboard copy: Use xclip for that.

Installation

Run make all to build. Then install the binary file ./xfiles somewhere in your $PATH; and install the manual file ./xfiles.1 somewhere in your $MANPATH.

Usage

  • Double left click on files open them.
  • Dragging files perform drag-and-drop.
  • Dragging empty space performs rectangular selection.
  • Middle click opens the scroller (a kind of scrollbar + autoScroll).
  • Right click invokes xfilesctl.

License

The code and manual are under the MIT/X license. The icons are in CC0/Public Domain. See ./LICENSE for more information.

Epilogue

Read the manual.

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

Watchers

 avatar  avatar  avatar  avatar

xfiles's Issues

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

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.

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?

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

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.

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.

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.

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.

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.

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?

Virtual root

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

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

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.

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.

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.

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.

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

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

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.