What are you working on? - Programming On Unix

Users browsing this thread: 1 Guest(s)
The Motif toolkit lets you define the maximum and minimum size of an application window in the source code (VendorShell?) Edit: I think it's WMShell.

I thought this would be great for hiding a few controls off-screen without menu bars, etc. To expose them the user just has to maximize the window. My new virtual keyboard (nowhere near done) implements this insane idea.

[Image: snap-09-42-50-06-09-22.png]

[Image: snap-09-43-00-06-09-22.png]
I've been lately curating a pkgsrc repo for Slackware 15.0. It definitely required some dedication (smaller quirks to fix), but eventually allowed me to easily deploy and maintain software which is not available on the official mirror, without having to rely on SlackBuilds and sbopkg (something which I never regarded as an efficient and reliable method). The repo is built on my amd64 workstation and predictably only includes desktop-oriented software I routinely use. Available at: https://retrobsd.ddns.net/pub/packages/All/
(21-03-2021, 04:03 PM)ckester Wrote: Beginning yet another rewrite of ncplay, my ncurses-based frontend for mpg123. I'm going to scrap the linked-list design I inherited from mcplay and replace it with a more cache-friendly array.

I don't really need to do this for performance, which is already good enough, but I want to see what effect this change has on the clarity of the resulting code.

In case anyone's interested, I've posted the latest version of ncplay on (in?) a gopherhole I asked z3bra to create for me. (It took a bit to figure out how to get things to display properly, but after snooping around in some other users' holes I finally got it working.)

gopher://g.nixers.net/1/~ckester/ncplay [HTML]

Overall, I'm pleased with new array-based design. I still need to reimplement the helpscreen and add a few other features but I think I'm going to be done with this program soon unless and until I get inspired to do another major redesign.

Any feedback or suggestions for improvement (within the stated scope of the project) will be welcome, of course! You can PM me here or send email to the address given in the INSTALL or LICENSE file from the tarball. I'm particularly interested to learn if there are any problems building or running this on a BSD system. So even a report of no problems will be appreciated.
Taking a break from ncplay this week in order to work on replacing my use of the python-based rawdog rss feed aggregator with some scripts built around sfeed.

Pursuant to my comments in another thread about criteria for preferring one program over another. I need to walk my own talk. ;-)

rawdog is written for python2.7, so I would probably need to replace it anyway now that the world is going to python3.

I prefer a river-of-news style of feedreader that combines all my feeds sorted by date in a single html page I can read in a web browser (I like (f)elinks). I figure if I'm going to need the browser to follow any links in the feed items, I might as well read the feeds in the browser too. No need for a separate reader like newsbeuter, snownews, canto, etc.

sfeed ticks all the boxes on my list of criteria, including being written in clean, static-linkable C.
sfeed_html(1) doesn't quite do what I want. It does create a "river of news" when I give it several different feeds combined and sorted, but it omits the content of each feed item and doesn't identify which feed it came from.

But it looks like I can munge together what I want with a bit of awk, first to add a feedname field to the sfeed output, and then (after combining, sorting, and trimming the different feed files) to pour the data into an html template. I should be done with the finishing touches tomorrow. It's yet another example of the power of Unix text processing, a simple pipeline of transforms that practically wrote themselves. Gotta love it!
Just launched a couple of themes for my simple static site generator , mkws!
I should probably take back what I said about sfeed's code being "clean". It's static-linkable C, true, but after making a more serious attempt to understand its algorithm, I have to say I find it inscrutable.

But then, that's my usual reaction to code that does a lot of parsing. Maybe it will all become clear once I have that "aha!" moment which provides the key to understanding.
Long time nixers
I'm working on a Window Maker dockapp.
It is a mpd client that shows the album art on the dock and has a few controller features.
Here's a vid: https://ttm.sh/q3O.webm
Although I'm testing it on Window Maker, I'm gonna use it on my wm, which also supports dockapps.

I wrote it after getting annoyed by notifications popping up everytime the song changes using my old notification daemon, xnotify. It's more discreet, and stays on the dock, not annoying me.
I wrote xnotify back when thinking that notifications are a cool feature and that my dbusless desktop need some. But them I realized that desktop notifications suck.
Smartphone notifications also suck.

I removed xnotify from my xinitrc. I don't know if I'll keep maintaining it.
(05-09-2022, 09:08 AM)adi Wrote: Just launched a couple of themes for my simple static site generator , mkws!

I like mkws and am using it for a simple blog (not nix related)
Long time nixers
I'm working on a plumber script, here's its config file:

# sample config file for seninha's plumber script (which will probably
# be rewritten into a C application).
# - Each paragraph (block of blank-delimited lines) can contain a series
#   of condition and actions
# - The conditions are only valid within a paragraph, except when the
#   paragraph has no action, in which case they are valid through the
#   entire file.
# - Each condition or action has the form <SUBJECT> <PREDICATE> <ARGUMENTS>
# - For example `data matches 'en.wikipedia.org'` has `data` as subject,
#   `matches` as predicate and `'en.wikipedia.org'` as argument.
# - Conditions have predicate `matches` (which test whether subject
#   matches a regexp argument) or `set` (which is always true).
# - A `matches` condition can set variables.  If the second argument
#   is `into`, all matched parentheses are assigned to the following
#   arguments in order.
# - A `set` condition sets its subject to the result of the arguments.
#   If the first argument is `running`, the remaining argument must be
#   a command whose output is set to the subject.
# - Actions have predicate `by`.
# - If plumb(1) is invoked with -o, a matching action with subject
#   "open" is executed.  This opens the file.
# - If plumb(1) is invoked with -e, a matching action with subject
#   "edit" is executed.  This edits the file.
# - If plumb(1) is invoked with -s, a matching action with subject
#   "here" is executed.  This opens the file on an already open
#   application.
# - If the first argument of an action is `running`, the remaining
#   arguments are commands to be run.
# - If the first argument of an action is `setting`, the remaining
#   arguments specify a X Property to be set.

# set global variables
data     matches     '(([A-Za-z]+):(//)?)?(.*(\.([A-Za-z0-9]+))?)' into _ protocol _ file _ extension
mime     set running file -ib -- $data

# youtube video
protocol matches     '(ytdl|https?|)'
file     matches     '(.*/)?[A-Za-z0-9_-]{11}'
open     by running  mpv --force-window=immediate -- ytdl://$file

# web page
protocol matches     '(https?|)'
file     matches     '(www\.)?[a-zA-Z0-9_@\-]+([.:][a-zA-Z0-9_@\-]+)*/?[a-zA-Z0-9_?,%#~&/\-+=]+([:.][a-zA-Z0-9_?,%#~&/\-+=]+)*'
open     by running  surf -- $data
here     by setting  _SURF_GO of active 'Surf' 'surf'

# html file
protocol matches     '(file|)'
mime     matches     'text/html'
open     by running  surf -- file://$file
here     by setting  _SURF_GO of active 'Surf' 'surf'
edit     by running  $TERMCMD -e $EDITOR -- $file

The syntax is based on plan9's plumb.
Different from p9p's plumb, it can set X11 properties (to open things in surf(1)) and run different commands depending on whether I'm wanting to open or edit the file.
So it can open a image in nsxiv or edit it in gimp.
Cool stuff, seninha!

Me, I've been making some more updates to my (much more boring) ncplay frontend for mpg123.

Mostly coding style and some UI changes to clean things up and address some of the awkwardness I've encountered while using the program.

Planning to spend some more time later tonight adding a prompt to get the dumpfile pathname from the user. I've already hacked together a buffergap-based implementation and just need to integrate the code from the stub program into ncplay itself. ascii text only at this point, but I've been looking into adapting the code to support utf8. That will probably wait until later.

I made some minor cosmetic changes to the 256-color theme earlier today and need to upload some new screenshots to the gopherhole. I have a few more tweaks I want to do first.

But real life intervenes. I need to have dinner, do some laundry, and other mundane tasks.
Long time nixers
And here it is: https://github.com/phillbush/plumb

I changed the config syntax a bit.
It does not set X properties. I'll just use another program/script for that.
The only dependency is libmime to get mimetypes.