3

Let's say I'm on Ubtunu 20.04 and have a custom accessibility script that I can

  • start by running /opt/myTool/activate.sh
  • stop by running /opt/myTool/deactivate.sh.

Is there a way to register it to gnome accessibility menu in the top bar so it will appear as a toggle like the other tools such as "High Contrast", "Magnifier", "Screen Reader" etc?

enter image description here

Anton S.
  • 219
  • This is possible by creating gnome-shell-extension but gnome-extensions are disabled once the screen gets locked and re-enabled once unlocked. Also extensions are re-run when gnome-shell refreshes or at every login. So your both the scripts may run multiple times in such situations. – PRATAP Nov 13 '20 at 09:55
  • 1
    https://i.stack.imgur.com/s4pi5.gif – PRATAP Nov 13 '20 at 12:25
  • @UnKNOWn yeah we better wait, but i expect he following steps to from https://askubuntu.com/q/1288732/26246 to make it easier. – user.dz Nov 13 '20 at 12:37
  • 1
    @UnKNOWn The limitations of gnome-shell-extension you named are acceptable to me. user.dz guessed it correctly – it's the script from the other question I'm trying to make a toggle for. But I may have other applications as well. I'm looking forward to your answer! Thanks in advance! – Anton S. Nov 13 '20 at 12:56

1 Answers1

2
  1. Download the gnome-shell-extension CustomAccessibilityButton from this github-link

  2. To install the extension from the Downloaded zip file, change directory to the downloaded location. for Example if the Downloaded file is in $HOME/Downloads

    cd $HOME/Downloads
    gnome-extensions install CustomAccessibilityButton.zip
    
  3. From the installed Extensions Directory run the compile-schemas-script

    cd $HOME/.local/share/gnome-shell/extensions/Custom\ Accessibility\ Button/
    ./compile-schemas-script
    
  4. Refresh the gnome-shell with Alt+F2 – "r" – enter method or logout/login

  5. enable the extension

    gnome-extensions enable 'Custom Accessibility Button'
    
  6. Refresh the gnome-shell with Alt+F2 – "r" – enter method or logout/login

Now Custom Accessibility Button Should Appear.

Anton S.
  • 219
PRATAP
  • 22,460
  • 1
    Thanks a lot! Works like a charm! Could you explain what the file schemas/org.gnome.shell.extensions.custom-button.gschema.xml is for? I guess the items specified there will be rendered in some gsettings window or in the gnome-extensions-app but can't see anything. – Anton S. Nov 13 '20 at 15:23
  • 2
    You can see it in dconf-editor or gsettings list-recursively | grep myscript. When you toggle the button it gets signal and thus run the script based on the state on|off – PRATAP Nov 13 '20 at 15:47
  • @AntonS , GSettings is API of DConf which is the configuration back-end used by Gnome & Unity (may be some other GTK DE's). It was developed by Gnome project. .gschema.xml are settings declaration by app to register its settings in system dconf . You may interested to know more check https://askubuntu.com/q/416556/26246 or search for dconf/gsettings here. It is an advanced system that equivalent to Registry in MS Windows, supports: default, system wide, user only, overrides, locks. – user.dz Nov 14 '20 at 09:21
  • Unfortunately, Link is broken – user.dz Dec 26 '21 at 12:01