Mailinglist Archive: opensuse (795 mails)

< Previous Next >
Re: [opensuse] KDE and directories
  • From: Knurpht - Gertjan Lettink <knurpht@xxxxxxxxxxxx>
  • Date: Tue, 07 Nov 2017 11:52:29 +0100
  • Message-id: <1813882.j0PtytsDja@knurpht-hp>
Op dinsdag 7 november 2017 10:03:33 CET schreef Roger Oberholtzer:
I think I know the answer to this (and Google was no help), but I
thought I would ask in case I messed something very obvious:

Is it possible to have KDE run a program when you enter a directory?
Say in Dolphin. We want to sense if the current directory contains a
file with a specific name. If so, do something. The point is that it
should be automatic. And it must be done for all directories. There is
no name rule or pattern that can be used.

We already register numerous file associations. So I explored
https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-inf
o-spec-0.18.html. There is something about Non-regular files and
inode/directory. But I just don't see how to use this to trigger running a
program. Has
anyone implemented this in such a general way?

yep, done that years ago to print tickets that were generated in html. I wrote
a script that looped 12(?) times, ran it through cron every minute, hence
generating a check, plus running another script, every 5 seconds.. The 1st
script checked for presence of html files in a couple of folders, the 2nd
converted the html files to ps, then sent it to the ticketprinter in case of
box office sales. Of course all the files were (re)moved after succesful
handling,.
So, cron is your friend.

--
Gertjan Lettink, a.k.a. Knurpht

openSUSE Board Member
openSUSE Forums Team

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
References