LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi
User Name
Password
Bodhi This forum is for the discussion of Bodhi Linux.

Notices


Reply
  Search this Thread
Old 11-20-2018, 11:18 AM   #1
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Rep: Reputation: 68
Program keyboard shortcuts in a script file


I'm looking for a way to program a reasonably large number of keyboard shortcuts from a script without having to enter each one through the Settings Panel GUI.

Has anybody any ideas, please?
 
Old 11-20-2018, 12:15 PM   #2
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
You mean OS shortcuts not related to any particular applications I presume?
 
Old 11-20-2018, 12:20 PM   #3
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 864

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
I think he wants to have a file of list of binded shortcuts instead of editing each one via GUI.
 
Old 11-20-2018, 03:52 PM   #4
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
So far I've learned pretty much every settings GUI is just changing some text file somewhere. And often it's easier just to edit the text file. The problem is finding which file, and I dunno, but once you find that, go from there.

Sorry, useless post.
 
Old 11-20-2018, 04:10 PM   #5
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Original Poster
Rep: Reputation: 68
Quote:
Originally Posted by enigma9o7 View Post
So far I've learned pretty much every settings GUI is just changing some text file somewhere. And often it's easier just to edit the text file. The problem is finding which file, and I dunno, but once you find that, go from there.
Well, normally you'd be correct. After some investigation I've discovered that the data is stored in ~/.e/e/config/<profileName>/e.cfg (Now I know why e is the most common letter in the English language ) But it's not text or XML as one might expect, it's actually pure binary! I've found enough clues to know where the key definitions are stored, but I've a long way to go before I can fully understand how the data is formatted, and a lot further to go before I can actually edit it and save a new version of the file.

That's why I was hoping for short cut to bypass the Settings Panel GUI.
 
Old 11-22-2018, 05:54 AM   #6
rbtylee
Bodhi Developer
 
Registered: Jun 2018
Location: Ladson, SC US
Distribution: Bodhi
Posts: 454

Rep: Reputation: 437Reputation: 437Reputation: 437Reputation: 437Reputation: 437
Cool

Quote:
Originally Posted by enigma9o7 View Post
So far I've learned pretty much every settings GUI is just changing some text file somewhere. And often it's easier just to edit the text file. The problem is finding which file, and I dunno, but once you find that, go from there.

Sorry, useless post.
Quote:
Originally Posted by bobl01 View Post
Well, normally you'd be correct. After some investigation I've discovered that the data is stored in ~/.e/e/config/<profileName>/e.cfg (Now I know why e is the most common letter in the English language ) But it's not text or XML as one might expect, it's actually pure binary! I've found enough clues to know where the key definitions are stored, but I've a long way to go before I can fully understand how the data is formatted, and a lot further to go before I can actually edit it and save a new version of the file.

That's why I was hoping for short cut to bypass the Settings Panel GUI.
Well the e developers in their infinite wisdom decided a long time ago to depart from the Unix tradition of storing most everything in text files to storing Enlightenment settings in binary files of their own creation. To me this isn't the best of ideas but somewhere online there is a post by Raster defending this decision. I am too lazy to find said post but Moksha being an Enlightenment fork is stuck with this decision unless we decide to change the source code and modify this behavior. Such a change is, IMHO, to big of a refactor for to little benefit.

Quote:
Originally Posted by bobl01 View Post
I'm looking for a way to program a reasonably large number of keyboard shortcuts from a script without having to enter each one through the Settings Panel GUI.

Has anybody any ideas, please?
Interesting idea, and for now I am going to resist the temptation to go ahead and write one for you. I know how that would go from past experience, I would hack up something simple and simple minded in no time and the spend weeks improving it. That is after I made the decision of whether to do it in Bash, python, or even C or perhaps some other language.

Anyway, some ideas:

The eet command, a part of EFL is the command that creates the binary config files you note. (~/.e/e/config/<profileName>/*.cfg)

There is no manual entry (man page) for eet. Creating man pages for various exes included with EFL and Moksha/Enlightenment is a tasks on our To-Do list. But of low priority. So for usage:

Code:
eet -h
To apply to this example, if e.cfg is in the current directory:

Code:
eet -d e.cfg config  e.txt
Decompresses e.cfg into the text file e.txt. Look in this file for group "key_bindings" list


Add the key bindings you want to this group. I am uncertain whether order is important. But examining that file closely will show you the syntax and form of the bindings you wish to add. Once you have modified the file to your liking, you can compress it again with the command:

Code:
eet -e e.cfg config e.txt 1
You may have to restart Moksha/Enlightenment for the Binding(s) to take effect (uncertain). You can do this from a script or CLI by:

Code:
enlightenment_remote -restart
For reference you may wish to consult the source code for Moksha. Particularly, e_bindings.h and e_int_config_keybindings.c.

This should be more than enough information to get you started. I would however back up the original config file first ... just in case

Last edited by rbtylee; 11-22-2018 at 08:31 AM.
 
2 members found this post helpful.
Old 11-22-2018, 10:36 AM   #7
bobl01
Member
 
Registered: Oct 2018
Location: South West England
Distribution: Bodhi; Manjaro
Posts: 101

Original Poster
Rep: Reputation: 68
Quote:
Originally Posted by rbtylee View Post
This should be more than enough information to get you started. I would however back up the original config file first ... just in case
Oh wow! That's absolutely brilliant. This will save me a ton of time. (Is time measured in units of weight ? Can one go into a shop and ask for a pound of seconds? )
 
Old 11-22-2018, 10:45 AM   #8
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 864

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Great info Ylee, thx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xine keyboard shortcuts in config file? MasterC Linux - Software 0 08-31-2006 10:10 PM
KDE Keyboard Shortcuts with different Keyboard Layout hellblade Linux - Software 5 04-18-2006 12:40 AM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 09:36 PM
asigning keyboard shortcuts chrismiceli Linux - General 0 10-20-2002 08:01 PM
keyboard shortcuts justin19fl Linux - Newbie 1 04-24-2001 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bodhi

All times are GMT -5. The time now is 01:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration