LinuxQuestions.org
Visit Jeremy's Blog.
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, 12:18 PM   #1
bobl01
Member
 
Registered: Oct 2018
Posts: 62

Rep: Reputation: Disabled
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, 01:15 PM   #2
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: MacOS, Slackware
Posts: 503

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

Rep: Reputation: 119Reputation: 119
I think he wants to have a file of list of binded shortcuts instead of editing each one via GUI.
 
Old 11-20-2018, 04:52 PM   #4
enigma9o7
Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi 5 (Ubuntu 18.04)
Posts: 158

Rep: Reputation: Disabled
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, 05:10 PM   #5
bobl01
Member
 
Registered: Oct 2018
Posts: 62

Original Poster
Rep: Reputation: Disabled
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, 06:54 AM   #6
rbtylee
Bodhi Developer
 
Registered: Jun 2018
Location: Ladson, SC US
Distribution: Bodhi
Posts: 39

Rep: Reputation: 39
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 09:31 AM.
 
2 members found this post helpful.
Old 11-22-2018, 11:36 AM   #7
bobl01
Member
 
Registered: Oct 2018
Posts: 62

Original Poster
Rep: Reputation: Disabled
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, 11:45 AM   #8
the_waiter
Bodhi Developer
 
Registered: Jun 2018
Location: Banská Bystrica, Slovakia
Distribution: Bodhi Linux
Posts: 191

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:10 PM
KDE Keyboard Shortcuts with different Keyboard Layout hellblade Linux - Software 5 04-18-2006 01:40 AM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 10:36 PM
asigning keyboard shortcuts chrismiceli Linux - General 0 10-20-2002 09:01 PM
keyboard shortcuts justin19fl Linux - Newbie 1 04-24-2001 03:19 PM

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

All times are GMT -5. The time now is 06:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration