Integrated bash, .css, and cursor theme for new cursor image category, workspace specific!!!
HOLY FREAKING CRAP I DID IT I DID IT I DID IT!!! (with googleAI/ChatGPT)
So I had mentioned on my last update post on the custom animated Bilbo Baggins cursor that I had the inspiration to make hovering over the titlebar of windows change the cursor image to a silver gauntlet with a pointing index finger, and then when grabbing and moving the window, having the cursor image change to a silver gauntlet fist.
I went thru the 146 individual X11 cursor files but none of them were assigned to titlebar hover. I figured this killed my idea, so I set the fleur cursor file to an image of the Elven Cloak Broach. This gave me 7 different cursor images changing as my mouse changed position over clickable elements. I then moved on to my wolverine animated cursor
Somehow, I just couldnt get that double gauntlet idea out of my head, so I went back to googleAI and expalined what I wanted. This opened up the rabbit-hole!!
Firefox, it turns out, can be set to read custom .css files. The bot had me enable this setting. I then made a 64x64 .png file of the pointing finger gauntlet, named hover.png, and a 64x64 fleur cursor file made from the closed fist gauntlet image, in preperation.
The next problem was that the titlebar was not selectable via .css scripting. The solution was to configure firefox and uncheck the titlebar setting, which made a collapsed, combo title & tab bar with minimize maximize and close buttons. THIS combo panel could be scripted to change the cursor image to a designated .png (hover.png in this case) when the mouse panned over any area without a tab or button!
Next step was the .css file. The bot gave me the code:
/* 1. Enable native window dragging AND your custom cursor on the main background wrappers */
#titlebar,
#TabsToolbar,
#TabsToolbar-customization-target {
-moz-window-dragging: drag !important;
cursor: url("hover.png"), auto !important;
}
/* 2. Lock down individual interactive child elements so they function as normal buttons */
.tabbrowser-tab,
.tabs-newtab-button,
.titlebar-button,
.titlebar-buttonbox-container {
-moz-window-dragging: no-drag !important;
cursor: default !important;
}
/* 3. Explicitly allow pointer event trickling down into the empty spaces */
.titlebar-spacer {
-moz-window-dragging: drag !important;
cursor: url("hover.png"), auto !important;
pointer-events: auto !important;
}
I now had exactly what I wanted, a pointing finger gauntlet when hovering over the firefox top bar, and a closed fist gauntlet when click/held and moved/dragged!!
This also gave me the freedom to use the Elven Cloak Broach cursor file elsewhere.
I ended the project with nine separate cursor images based on what elements the mouse is hovering over/interacting with:
Default: animated loop of walking Rankin/Bass style CGI Bilbo Baggins image
Panning across webpage: Sting image
Hovering over webpage clickable element: The One Ring
Hovering over text field: a red quill
Left & Right side window anchor points for resizing: The Elfstone
Top & Bottom window achor points for resizing: Elven Cloak Broach
Top_Left & Right/Bottom_Left & Right corner window anchor points for diagonal resizing: The Elendilmir
Hovering over firefox top bar: pointing index finger silver gauntlet
Dragging/Moving window: closed fist silver gauntlet
This was amazing, I actually had my hover and grab gauntlet images, but what about when I wasn't on workspace 3 and not using the animated Bilbo cursor with the gauntlet set to fleur?
Back to the bot and the solution was a smart launcher and firefox profiles.
All of the custom settings I duplicated on a newly created profile named Tolkien. All custom settings were then removed from default setting, reverting it to, well, default.
I then created a .desktop file set to dynamically change firefox icon as icon sets change, and pointing to a smart firefox launch script:
#!/bin/bash
# Get the current zero-indexed workspace number
CURRENT_WS=$(wmctrl -d | grep '*' | cut -d' ' -f1)
# Check if current workspace is 2 (the 3rd workspace)
if [ "$CURRENT_WS" -eq 2 ]; then
firefox -P Tolkien --no-remote &
else
firefox -P default-release &
fi
And that completed the necessary steps. The launcher script knows when I am on workspace 3 and launches the Tolkien profile firefox, and on all other workspaces, it launches default profile with the enabled title-bar and default .css scripting.
Is this bitchin or what????
I don't understand why the .mp4 isn't working for this post. Here is a link to the video as an animated .gif: