Sunday, April 28, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 16723  / 2 Years ago, fri, july 15, 2022, 12:35:31

Is there a way to make this command line to activate every time i press a certain button?



xdotool key XF86MonBrightnessDown


I mean how can I bind it to a key? Also, which one of the keycodes are important and need to be used when binding? Scancode keycode or key number?


More From » shortcut-keys

 Answers
3

If you go to System ▸ Preferences ▸ Keyboard Shortcuts, you should be able to add your command and set the keybinding.


Alternate Way - make it into a script


First, open up a Terminal (Ctrl + Alt + T)


sudo touch /bin/anyName

sudo chmod +x /bin/anyName

sudo gedit /bin/anyName


Place this in the anyName file:


#!/bin/bash

xdotool key XF86MonBrightnessDown

Open your Keyboard Shortcuts application.

Create a new custom shortcut.


Set the command to "anyName", and pick the key combo (This can be done by pressing the key and Ubuntu will recognize which key you pressed. You don't have to worry about the scancode or keycode; just type what key combination you want to activate the command).


Hope this helps.


A related question on AskUbuntu.


A question on UbuntuForums.


[#30046] Sunday, July 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
otputler

Total Points: 53
Total Questions: 105
Total Answers: 93

Location: Zimbabwe
Member since Wed, Nov 9, 2022
2 Years ago
otputler questions
Tue, Aug 23, 22, 14:36, 2 Years ago
Fri, Jul 23, 21, 11:57, 3 Years ago
Sun, Feb 12, 23, 18:37, 1 Year ago
;