{"id":13610783,"url":"https://github.com/EllaTheCat/dopamine","last_synced_at":"2025-04-13T01:32:51.342Z","repository":{"id":149255283,"uuid":"171673550","full_name":"EllaTheCat/dopamine","owner":"EllaTheCat","description":"Linux PC i3 window manager configuration specific to my having Parkinson's Disease","archived":false,"fork":false,"pushed_at":"2020-05-09T11:22:33.000Z","size":479,"stargazers_count":74,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T19:55:41.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EllaTheCat.png","metadata":{"files":{"readme":"README.asciidoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-20T12:58:23.000Z","updated_at":"2024-07-05T20:15:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f06e032-06d0-46ee-b5dd-e6396d23c800","html_url":"https://github.com/EllaTheCat/dopamine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EllaTheCat%2Fdopamine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EllaTheCat%2Fdopamine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EllaTheCat%2Fdopamine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EllaTheCat%2Fdopamine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EllaTheCat","download_url":"https://codeload.github.com/EllaTheCat/dopamine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223558323,"owners_count":17165106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:47.965Z","updated_at":"2024-11-07T17:30:32.917Z","avatar_url":"https://github.com/EllaTheCat.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"= \"dopamine\"\n\n== Introduction\n=== Background\nSome time ago\nhttps://www.reddit.com/r/i3wm/comments/8h2961/using_i3_for_better_accessibility_with_parkinsons/[I posted on reddit],\nsaying that the i3 window manager was very well suited to my needs\nas someone living with Parkinson's Disease,\na condition that arises when https://en.wikipedia.org/wiki/Dopamine[dopamine]\nproducing neurons in the brain start dying.\nYou are currently reading the README for the github repository https://github.com/EllaTheCat/dopamine[dopamine],\nthat I'm using and actively working on. I chose the name dopamine to be short and memorable.\nI made a follow-up post on reddit about the dopamine project and there was once again\nhttps://www.reddit.com/r/i3wm/comments/b1i2io/dopamine_using_i3_when_the_user_has_a_movement/[an\nongoing discussion].\nDopamine is as much about evaluating what doesn't work as it is about what works!\n\n=== How to run dopamine\nI'd like to know if anyone tries or wants to try, but it's a mess.  I'll help you if you ask on reddit.\nConsider evaluating dopamine on a VirtualBox VM because\n(1) you minimise the risk of breaking your current install, and because\n(2) dopamine is running on Xubuntu 16.04/18.04 LTS].\nSee http://feeblenerd.blogspot.com/2015/11/pretty-i3-with-xfce.html for an easy and safe way\nto install i3 on Xubuntu (i3 replaces the XFCE window manager).\n\n== Scope\n=== i3files directory\nThe i3files directory contains my i3 configuration files and some i3-related helper scripts.\nThe other directories contain configurations and scripts that I use in conjunction with the aforementioned i3 files.\nThese other files provide context for i3 and my PD; on github they act as my backups.\nThe i3files are discussed in depth in a later section.\n\n=== i3-make script\ni3-make is a script that calls 'make' on the Makefile in the 'i3files' working directory. I have it bound to Control-Menu.\nRunning i3-make will run ShellCheck on any script in the working directory that differs from its counterpart\nscripts in the installation directory, if ShellCheck is happy, the modified script is installed.\nThe i3 config file and the i3status file are installed if i3 is happy; i3 config is reloaded and i3 is restarted as\nnecessary. If ShellCheck objects to a bad script, look at 'i3files/*.log' for the errors and suggestions to fix them.\n\nThe example below shows how to configure Makefile variables (for my machine)\nby editing i3-make instead of editing the Makefile.\n\n----\n#!/bin/bash\n#\n# i3-make\n#\n\nI3FILES=$(readlink -f ${HOME}/1/EllaTheCat/github/dopamine/i3files)\ncd ${I3FILES}\nmake \\\n    CONFIGURED=true I3BIN=\"${HOME}/local/bin\" \\\n    -f ${I3FILES}/Makefile -C ${I3FILES} \"$@\"\n----\n\n=== dotfiles directory\nMy PD makes dot-inputrc absolutely essential; combined with a huge bash history size set by dot-bashrc,\nI can recall, edit and apply commands with minimal typing. I type a few letters to filter what is to be shown,\nthen use up arrow or down arrow to cycle through matching commands.\nThe dot-bashrc has some nice github functions and a prompt that knows about git.\n\nThe files here are the ones I use. Nothing here is installed by the Makefile in i3files.\n\n=== dotemacs directory\nEmacs and dopamine provide a minimalist voice-assisted editing feature.\nSpoken sentences are converted to text externally about which more later.\nThe text is inserted into an Emacs buffer as a single line by default.\n\nThe files here are the ones I use. Nothing here is installed by the Makefile in i3files.\n\n=== scripts directory\nThese are scripts have come in handy, for example when making a video.\n\nThe files here are the ones I use. Nothing here is installed by the Makefile in i3files.\n\n== Ergonomics\n=== Numpad\nAt first I thought modes would completely replace modifiers in my way of working.\nI've realised that there are some i3 commands that don't suit modes,\nbut modifiers don't suit me.\nThe compromise is to use the numeric keypad, alias the numpad,\nas found on the far right of full-size keyboards.\nSeparate USB numpads are an option for on-the-move laptop users and left handed users.\n\nThe NumLock key toggles between two sets of keys:\nthe KP_0 set for numeric entry and the KP_Insert set for navigation.\nThe arithmetic operators and KP_Enter are unaffected by NumLock.\n\nTake a look at \"i3files/dot-config-i3-config\" for the bindings.\n\n=== i3 modes\nThere are now only three major i3 modes: the default mode, the Primary mode, and the Secondary mode.\nThe Menu key cycles through these modes, the space key returns to default mode from the other two.\nThe screen dims when in Primary or Secondary mode.\n\n- Primary mode contains my most often used bindings after the numpad ones.\n- Secondary mode contains bindings to less-used functions such as settings.\n\n=== Commands\nCommands are a hangover from a past attempt to make a mouse-heavy\nwindow manager keyboard-operable. The concept was to either launch a\nprogram or switch to a running instance.\n\nPress Menu followed by Tab to show a dmenu with a \"Command:\" prompt.\nThere is just enough time to enter two or three characters before the dmenu\nis automatically dismissed. Whatever has been entered is evaluated as a command.\nPressing backslash instead of Tab is an alternative binding on my 105 key keyboard.\n\nPressing KP_Insert shows the same dmenu with its \"Command:\" prompt\nThe numpad reconfigures to supply the numbers on keys KP_0 KP_1 ... KP_8 KP_9.\nEntering 2 or 3 digit commands is facilitated, even with my right hand tremor,\nprobably due to the compact arrangement of the numpad.\n\nCommands themselves are explained in more detail in\nsubsection \"Launch or Focus\" in section \"i3-wrapper\".\n\n=== Numeric Commands\nI have only recently found a reliable method of saying two or three digit numbers\nthat returns consistently formatted values.\nTo issue the command \"42\", say \"42 dollars\", Google returns \"$42\", strip the dollar sign, apply a leading zero\nfor values less than 10, and we have a two digit number.\nPreviously results could be mixed format (one,1) or homophones (for/four/4).\n\n=== Hybrid Commands\nThese are the ten Emacs frame (window) commands e[0-9], and\nthe ten Google Chrome commands g[0-9].\nThey are discussed in more detail in the section \"Launch or Focus\".\n\n== Marks\nWhenever a terminal, emacs frame, or google chrome window is created,\na unique two digit mark is allocated and displayed on the right side of the titlebar.\nThe quick-and-dirty implementation of mark assignment risks failing to terminate\nwhen the number of marked containers approaches 100. I am contemplating\nallocating marks for (almost) everything.\n\ni3 has a goto-mark function bound to the 2 digit sequence [0-9][0-9] and a\nswap-container-with-mark function bound to the 3 digit sequence 5[0-9][0-9].\nExchanging marks can make rearranging windows easier than relying upon\nthe conventional incremental movement of focus or windows alone.\n\n== Bash scripts\n\n=== i3-wrapper\nThis script is the main one and is described in detail in the section after this one.\nThe other scripts described in this section are the result of refactoring i3-wrapper.\nThe refactoring is still work in progress.\n\n=== i3-keyboard\nI'm from the UK, but I prefer the US keyboard layout because\nback in the day there was no choice but the US layout.\nI have a 105 key UK keyboard, and this script creates my custom US-style keyboard.\n\nApropos of i3, this is where I invoke\nhttps://github.com/alols/xcape[xcape] to define how modifier keys work when pressed singly.\n\n    - k1='Super_L=Menu'\n    - k2='Alt_L=Escape'\n    - k3='ISO_Level3_Shift=Escape'\n\n=== i3-mouse\nA recent useful idea from reddit is\nhttps://www.reddit.com/r/i3wm/comments/b0lj73/where_focus_goes_mouse_follows/[\"mouse follows focus\"]:\nWhen the keyboard is used to focus a window, the mouse is warped into\nthe window, to a point offset from the top left corner\nby one-third of the window width and one-third of the window height.\nUsing the mouse to focus a window with a single click highlights the\nregion between the mouse click point and the keyboard focus point. Using\na slow double-click instead leaves no highlight.\n\n=== i3-display\nI simply don't like automatic display blanking, but because\nmy tremor would easily disturb the mouse\nI can't allow automatic display unblanking.\nKeybindings can use this script request that the display sleeps or wakes up.\n\nI have two monitors driven from my PC, and I hope to have three again in future.\nThe left monitor can be driven from other sources, Fire Stick, NowTV STB, Raspberry Pi, ...\nI wish to avoid selecting inputs with buttons on the left monitor.\nKeybindings can use this script to send commands to both sources\nsuch that the left monitor source can be selected programmatically.\n\nThis works, but has been seldom used because my monitors have been\nconfigured to disable automatic HDMI switching.\nIt does no harm at present so there is no reason to remove it.\n\n=== i3-status\nThis script is a straightforward wrapper round 'i3status'. It adds several things:\n\n- Status of a firewall rule\n- On/Off control and status for USB audio dongle microphone, USB webcam microphone and analog stereo microphone.\n- Webcam device file owner (lsof).\n- A list of the marks that are assigned to terminals, Emacs frames, Chrome windows, and certain other windows.\n\n=== i3-apps\nThis script makes explicit how the applications I use should be started and stopped.\n\n== i3-wrapper\n=== File Watcher\nThe file watcher monitors a file in shared memory, using\ninotify-hookable.  When a command is written to this file, it is\nforwarded to the i3programs() function in i3-wrapper for evaluation.\n\nAs of 2020-01-28 there is a bug. Commands are ignored, the onset\noccurs soon after the session starts, it occurs once only, and the\nworkaround is to type control-C in the File Watcher window, after\nwhich the ignore commands are executed.\n\n=== Launch or Focus\nThe focus function in i3-wrapper has a bash case statement that\naccepts commands to launch or focus a program using the aforementioned\nfocus function:\n\n- If a requested program is not already running,\nthe focus function will launch the requested program\nin a designated workspace on a designated output.\n- If a requested program is already running,\nthe focus function changes to its workspace and to its output.\n\nThe example here launches thunderbird in response to command \"tb\",\nlaunching  on the workspace \"tb\" on the left monitor ${lmon},\nunless a Thunderbird window exists, in which case ithe window will\nreceive focus on whatever workspace or output it currently occupies.\n\n----\n(tb)\nfocus class Thunderbird 'tb' ${lmon} thunderbird ;;\n----\n\nNot all case statements use the focus function. The ten 'g0 g1 ... g8\ng9' commands launch or focus Google Chrome windows on eponymous\nworkspaces. The \"gc\" command will launch a Google Chrome window on the\ncurrent workspace. There are also ten commands 'e0 e1 ... e8 e9' that\nlaunch or focus Emacs frames on eponymous workspaces, and 'em' for the\ncurrent workspace. These all rely on the 'emgc' function instead of 'focus'.\nTheir names are the \"standard\" names that other features may expect,\nas does the focus watcher for example.\n\n=== Scratchpad Terminal\nThe popularity of dropdown terminals (Guake, Yakuake ...) has seen i3\nusers implementing similar functionality using the i3 scratchpad.\n\nA single key binding (Control+Delete) operates the scratchpad terminal.\nThe first two presses perform initialisation,\nsubsequent presses toggle the scratchpad terminal between being visible and being hidden;.\nThere is no dropdown animation.\nI have locked the terminal to a fixed position on my primary monitor.\n\nMy decision to use Control+Delete despite my right hand tremors\nrelies on the space between the two key clusters to the left of the numpad\nto rest my fingers and steady my hand.\n\n== AutoVoice\nMy external speech to text engine uses the Android apps Tasker and AutoVoice.\nTasker writes a sentence or command into the file monitored by the file watcher.\n\nMy frontend for speeech to text is the AutoVoice for Chrome extension.\nIt provides continuous listening without hotphrases such as \"OK Google\" or \"Alexa\".\nThis requires streaming audio out of the machine at roughly 128 kbps,\nso be careful if your broadband is metered, or if you wish to keep secrets.\n\nThe i3-tasker function i3-autovoice uses xdotool to toggle AutoVoice\non/off on the extension's webpage \"chrome://extensions/?id=...\" (not the\nOptions page) as of Chrome Version 77.0.3865.90 (Official Build)\n(64-bit). I hope it stays available.  This is the better choice to\nserve as an on/off switch provided that the user accepts the\nimplementation (c.f. the Tasker plugin AutoInput).\n\nMuting the microphone input to the AutoVoice for Chrome extension\nreduces the upstream bandwidth significantly and serves as an\nalternative and effective on/off switch.\n\n= Summary\n\n:-)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEllaTheCat%2Fdopamine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEllaTheCat%2Fdopamine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEllaTheCat%2Fdopamine/lists"}