Javascript is Loading

Welcome to K-Dog's Reading Room

.
It is insufficient to explain climate change as human driven.  Climate change is class driven.  A small minority uses money to make all decisions.  They do this to get more money for themselves, making a deliberate choice to ignore externalities, and other people.

In total the mammals of the world are, 60 % livestock, 36 % human, 4 % wild.

Project Endangered Tiger ( 2022 )

Can the world save a million species from extinction? ( Nature December 2022 )

Ninety % of Monarch Butterflies gone in 20 years ( Inhabitat 2014 )

The Great Insect Die-Off ( April 2022 )

Fifty % of Great Barrier Reef gone since 1985 ( Live Science 2012 )

Ninety-six % of tigers gone in 100 years ( IFL Science 2019 )

Expect more mega-droughts ( ScienceDaily 2020 )

One million species of plants and animals at risk of extinction ( National Geographic 2019 )

Wanted -- Another Heat Wave

This was written a hundred and twelve years ago. In the intervening century, the endless search for profit at all cost has changed the climate. A century ago only the rich could buy a cool wind, and soon that will be true again. Making this lost text more relevant now than the day it was published.

Blisteringly it swept over the country, leaving a trail of cracked heads and parched throats in its progress. Torturing, invaliding, and killing it kept its course, and when its tail had been chased out of sight by the first rain cloud we, the people of the United States, rejoiced and brought ice cream soda and promptly turned to think of something else.

Yet in New York City alone over one hundred and fifty people died of this hot wave; and the death of thousands more in hospitals and on the street was hastened by the devilling of the sun and the black sleepless nights. And almost without exception, every man, woman, and child that paid the upmost penalty belonged to the working class. Newport and Bar Harbor have no death roll. Those who died were the men and women who bore the burden of the day along the sweltering pavements or who fretted in cramped chocking tenements.

Truly, a philosopher would say, either the rich are better able to stand hot weather than the poor or else the rich are able to purchase cool winds. Both statement are true. The rich are better able to stand hot weather than the poor: baths and good food and a decent quantity of rest have preserved their bodies. They can cope with the extremes of sunshine. But finer than that---they don't have to. They can choose. Climate is at that man's disposal who has the price of the proper railway ticket.

Thus, it is that the rich save them-selves and the poor perish. And it is so quite reasonable that this should be so, because the poor accept it all complacently. If they do not object, who should.

For the most part, the rich are the idlers and the poor are the workers of the world.

The idlers go to the seashore on swift trains: the workers build the trains and stoke them and provide the iron rails on which they run; and then the workers go back to the city of rabbit hutches.

The idlers have learned that it is possible to be comfortable and healthy in summer: the workers have learned that it is God's will for a certain number of their fellows to be stricken down with the heat.

The workers print the ballots of the world. The workers vote the ballots of the world. And they vote the idlers again and again into power.

The idlers give nothing and expect all.

The workers give all and expect nothing.

How beautiful is the self-sacrifice of the workers. Who says there are no saints today? The workers are saints, lacking only halo and wings.

God bless the patient workers who bend their backs so meekly in this age of self-seeking. But would it not be refreshing to see and feel a new kind of heat wave sweep the country? A mental heat wave kindling a blaze of revolt, burning the workers white-hot to resent the cruelty of our outgrown system of society.

* From 'The Masses' A monthly magazine devoted to the interests of the working people. August 1911

What's I'm Doing

Mintdeck is improved. There is a download link on this page but I also have a github. Click on the page link that shows all repositories if you go there.

I continue to wait until more people visit this place before I again write articles here. Until that happens, any rantings not technical, I'll make in the Doomstead Diner Forum.

I endorse Cornel West. I have been posting in the Diner about his presidential run.

I want to head the Empire in order to dismantle it. We don't need 800 military bases around the world. We don't need U.S. troops, in over 100 countries. We need to be a nation among nations. We don't need to be the Grand Empire that every nation has to bow down to. I'm anti-Empire, anti-imperialist, in that sense, very much like Mark Twain and the most adorable American philosopher, William James. -- C. West
Mint Deck Installation

Last Week I described Mint Deck. This week I give a download link.

Installing Mint Deck on my Linux laptop took a while. Things got involved. I had to revise code to make Mint Deck work on my laptop. Waiting to post the download link was a good idea.

Keypress Generation, The Issue.

Pressing a button on a Stream Deck Stream Deck Pic produces key presses as if keys are pressed on a keyboard.

Right now, my upper left Stream Deck button shows <shift>hello <SHIFT>world<SHIFT>1 in the button edit mode window. This is not HTML. This is a simple convention I use to document key sequences.

Named keys have names inside less and greater than symbols, < >. Keys <SHIFT>, <ALT>, <CTR>, and <META> are special keys that modify other keys pressed at the same time. There are only a few rules in my convention. The Meta keys are the two keys with the Microsoft Windows symbol. <shift>hello <SHIFT>world<SHIFT>1 prints Hello World! to an active application when the upper left corner Stream Deck button is pressed. Or if Mint Deck is placed in demo mode and a button tile is clicked on the Mint Deck GUI. (Graphic User Interface)

Generating key presses is an issue. Operating systems don't like virtual keyboards. Virtual keyboards can be used by malware. A virtual keyboard is a security issue. Malware can use a virtual keyboard to do nasty things. It is not possible to simulate a keyboard using simple code. The Fates simply will not have it. Code needs some sort of help to generate keystrokes.

Wayland Woes

Some history makes the point. A new Linux graphics stack is used by some Linux distributions. This new graphics stack is code named Wayland. Wayland is more secure, something that is important to some people. I am not one of them.

Ever since Fedora 25 boldly introduced the Wayland graphics stack by default in 2016, it’s been installed as the primary option in several Linux distros. You may even be using it now if you’re reading this from a Linux machine. Even as Wayland has been around for a while, it’s still a topic of intrigue among people who have been accustomed to using the older, ubiquitous X11 protocol through Xorg. The source

You can figure out where I am in the debate.

I began Mint Deck intending to only support the X11 stack, not Wayland. I decided to use part of the Evemu project after discovering the Wayland info. Hopefully Evemu virtual keyboards will work in Wayland (non laptop) systems.

I use a virtual keyboard Evemu creates by cloning my physical keyboard. Whatever that means.

I expected the Evemu virtual keyboard to work on my laptop. It did not.

Both key generation methods work on my desktop box.

Laptop Adjustments

Digging into the innards of my laptop, I discover all sorts of devices. Evemu considers the power button and touchpad as separate devices. A switch detecting if the laptop is closed is a device. There are many others. But on my laptop no keyboard is listed. The keyboard does not appear as an Evemu 'device'. Keyboards on laptops, it seems, don't expose themselves as USB devices.

I used xdotool to make MintDeck work on my laptop, returning to X11 and working with my X11 display manager.

Linux Mint has not switched to Wayland. Xdotool is my option for keyboard simulation. The extra help code needs. The Mint Deck Action Menu has a new menu item 'Key Generation'. A user can switch between X11 or Evemu key generation methods. Default is X11.

X11 key generation requires no configuration. Simple selection of the X11 option from the Action menu suffices. But using Evemu key generation requires entering an Evemu keyboard event number. This is the configuration issue from last week. I say 'an' because there may be more than one choice of keyboards shown in the Evemu list.

Selection of the EMEMU option from the Action menu opens a dialog box showing two buttons. One button opens a terminal window and runs a command listing all Evemu devices with Evemu event numbers.

An event number corresponding to a keyboard must be found. Below the dialog buttons is a text box which lets a user enter a keyboard event number. It is a big box for a small number. The second button saves the number.

Allowing Users Access To The Stream Deck.

Create an etc/udev/50-streamdeck.rules file with this content.

SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", TAG+="uaccess"

This file lives in the /etc/udev/ folder. Without this file, only users with root privileges can run Mint Deck to use a Stream Deck.

Building The Project

Open a command window. Enter the following commands to install the required libraries.

    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install pkg-config
    sudo apt-get install libgtk-3-dev
    sudo apt-get install libgdk-pixbuf2.0-dev
    sudo apt-get install libopencv-dev
    sudo apt-get install libhidapi-dev
    sudo apt-get install xdotool
    sudo apt-get install gir1.2-appindicator3-0.1

The final code library is needed by my python loader. I have no idea why. When the libraries have been installed, open a command window and move to the mintdeck folder.

    cd ~/mintdeck

Build the application with the make command.

    make

If you get errors compiling the code, identify the first error in the 'make' report. Fixing code generally starts from the first error.

Run Mint Deck with the command.

    ./mintdeck

Add A Loader To The System Tray.

This is optional. Mint Deck will run without a loader but to be useful loading Mint Deck at startup is a good idea.

The startup.sh file in the ~/mintdeck/tray/ folder must be given permission to execute as a program. After that is done, the startup application is configured to run the file. My startup code GUI facilitates this, and a mint colored star is placed in the Linux Mint system tray. Users who have other Linux distributions will follow instructions to set a startup program specific to their distribution.

Downloading The Software

Here is the download link mintdeck.zip.

Download mintdeck.zip and extract the contents. Place the mintdeck folder in your home directory ~/. Place the Mint-Deck folder in /usr/share/themes/ at the root level. The Mint-Deck folder gives the GUI a dark theme. I did not like the way the GUI looked with a light theme. Look at file main.cpp if you want to unlink the dark theme. The two lines to delete should be obvious. There are only six lines. The lines to delete both have the word 'settings' in them.

Limitations

Only 15 button Stream Decks are supported at this time. Configuring Mint Deck for the Elgato Stream Deck Mini and the Elgato Stream Deck XL should not be a lot of work. I have already done most of the coding. But without the devices I can't test the code, so I have not yet adjusted the GUI for different button layouts. Wayland laptops may be out of luck. However, if someone tells me they need it, I'll load Fedora on my laptop and figure it out.

Demo Mode

Demo mode runs without a Stream Deck.

This is nice to have.

Make a notes.text file and place it in ~/Documents. Install the editor gedit sudo apt install gedit (on Linux Mint or Ubuntu). Now a notes file is available with a menu selection on the loader. The loader will open notes.txt with gedit on a click. Open the file. Having a convenient notes file is nice.

After selecting the demo mode on the Mint Deck Mode menu, click a mint deck button tile with your mouse. Now quickly click in the editor window with the open text file. In a few seconds text programmed into the Mint Deck button should appear. Try the upper right button on the loaded default keyset showing the waterfall. Hello World! should print. The lower left is <CTRL>s. I just saved my work.

If these instructions seem complicated, it is because they are. Mint Deck is not simple code. Is Mint Deck bug free? Oh hell no. Some keys won't work they way they should. If I could tell you which ones I would have already fixed them. Mint Deck mostly works. There were a lot of things to do to make the project work. I got something working, I moved on. Sort of. If I know there is a problem I fix it. This is my first software release. Mint Deck is a work in progress.

Mint Deck

I have been working on a software application. Elgato Stream Deck freeware. Stream Deck Pic I am ready for my initial code release. The Elgato Stream Deck is an input device that mimics a keyboard. Pressing Stream Deck buttons causes key-presses to be sent to computer applications.

The Stream Deck is useful in many applications where pre-recorded keystrokes are useful. You-Tubers using OBS (Open Broadcaster Software) to stream video might use a Stream Deck to switch between scenes and scene layouts. I want to use keyboard shortcuts in the 'Blender' 3-d modeling program. I'll use my Stream Deck as a learning tool to remember keystroke sequences. Using the 'edit' mode shows key sequences.

The Stream Deck Device is useless without software. The device only informs a connected computer that a button has been pressed. That can't even happen without software. Key press sequences are actually generated by software running on the host computer. Inside Mint Deck. Elgato only supplies software that runs under Microsoft Windows. Linux users must pursue other options to use a Stream Deck on their system.

A Python front end using QT bindings to access the Stream Deck hardware exists, and I used it for a while. But I upgraded my Linux distribution. New 'QT bindings' installed by the Mint upgrade are incompatible with Tim Crosley's Python code.

Investigation revealed I can use Tim's streamdeck-ui if I roll back and use old QT bindings. But I like my 'QT' bindings new, thank you very much. I might want to use QT to write an app. I have used 'QT' and liked it.

Having a shell script run a background process also bothers me, and Python is shell code. It may be a personal issue, and not matter at the end of the day. But C code seems more appropriate for background services. Lean and efficient code is better, at least in theory, so I decided to write Mint Deck using C++. I use Python to launch Mint Deck, but the main program is C++. The Python launcher also has a menu item that shows or hides Mint Deck on the desktop after it launches. The Python launcher lives behind an icon on my Linux system tray, waiting to be clicked. My launcher icon, a green star, loads at startup. Writing my system tray launcher using Python is appropriate. The launcher will be customized for different Linux distributions. The launcher and only does work when a user clicks a launcher menu item. It is not a background process, always scanning for data.

I named my program Mint Deck because I wrote it on a Linux Mint system. Each square in the Mint Deck GUI is a button which can be clicked on with a mouse. Clicking on the Mint Deck image I show here won't do anything. The program has to be installed on a Linux system and run. You only see an image on a webpage here.

Searching for icons as I wrote the program was a headache, and a diversion from the main task. I avoided this headache by chopping up large background images into small image tiles. This gives 15 button images at once. Each tile is an individual image. I use these image tiles for button images. Each image on the Mint Deck GUI matches a corresponding Stream Deck button image. Each image is used in both places.

Stream Deck Pic
My Stream Deck Pic

A user can replace any button image with another image. A 'Mode' menu selection provides the ability.

Mintdeck has three menus. 'Keysets', 'Mode', and 'Action'. Selecting the 'Keysets' menu presents a list of button image sets with button actions. Each button has an action. Each selection of a keyset loads a new set of 15 buttons.

Pressing a Stream Deck button sends a keyboard keypress sequence to active applications. Sequences a user has entered. As I write this, I occasionally reach over with my left hand to press my lower left Stream Deck button. This triggers Mint Deck to type '<cntrl>s' to my Linux system as if I typed '<cntrl>s' on a keyboard. This keystring saves my work because my text editor is the active application. The Stream Deck is a device that mimics a keyboard.

The 'Keysets' menu loads keysets. Selecting the menu presents a list. Modified keysets can be saved under new names. Keysets can be deleted. A default keyset, loaded when Mint Deck starts, is set by saving a keyset using the name 'default'. 'Save', 'Save As', and 'Delete' on the 'Action' menu work with keysets to manage them. Other 'Action' menu items are 'Deck Info', 'Deck Brightness', 'Deck Reset', and 'Dice Photo'. I added 'Dice Photo' to the action menu for users wanting to dice their own photos.

The 'Mode' menu chooses what action results when a Mint Deck button tile is clicked on. Modes are 'Record', 'Edit', 'Load Image', 'Push Button', 'Pop Button' and 'Demo'. Record and edit work with the keystring that belongs to the selected button tile. Load image lets a button tile image be changed. Push and pop work with a clipboard to move buttons around. Demo mode issues keystrings on mouse clicks as if the matching Stream Deck button were pressed.

Mint Deck is functional. I am now documenting the Source Code using doxygen. Before I post a download link, I will describe how Mint Deck works and is installed. There is a simple configuration procedure that must be done on a new install. Posting code without instruction on how to install the code makes no sense. I concern myself with installation in my next article.