lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

Allow optional hotkeys to be unbound via. config-file #120

Closed pik closed 3 years ago

pik commented 9 years ago

This will allow optional keybinds (all the ones except for the primary tilda key) to be unbound via. a blank string or commenting out the target. The only time config_init will set the optional default keybinds is if the config file did not previously exist. The slight drawback is that if a user writes a new config without specifying default-keybinds (or letting tilda create the config itself) these keys will not be auto-bound. #110 #113

Fixles commented 9 years ago

I was looking for exactly this. I use tmux inside tilda so only a show/hide copy and paste are really useful but cant seem to unbind all the other keysbinds

Currently I just bound all the keys to except the couple I use.

pik commented 9 years ago

This should be easy to merge into your local copy if you don't mind building from source. I think it's not a very neat solution - which is probably why it hasn't been pulled in.

Ladicek commented 8 years ago

Is there something I can do to make this (or another solution to the same problem) merged? I see that there's e.g. a bunch of whitespace changes in this PR that obscure what's really going on.

I'm not really a C / GTK programmer, but I feel comfortable doing some minor things.

pik commented 8 years ago

@ladicek Tilda sets up default config values on load of it can't find user set ones, unfortunately atm libconfuse doesn't provide us with a way to distinguish an unset value for an existing key e.g. foo= from simply an empty file.

This patch got around the issue by checking if a config file exists and assuming keys with NULL values are intentionally unset if it does. You could cherry-pick it for personal use.

The proper way to do this I think, especially now that libconfuse has a new maintainer would be to provide a distinct VALUE_UNSET or something along those lines when parsing foo= but that might also have some complications since it will mean libconfuse would have to parse into a value holding structure rather then directly into a basic type as it does atm.

lanoxx commented 3 years ago

I finally had time to pick up this pull and take a closer look. I have rebased the code and took a slightly different approach that is inspired by #113, personally I prefer the solution of storing "NULL" in the config instead of storing empty strings in the config because that is causing the config value to be commented out and requires that we change the config system to manually initialise default values. In addition, I made a change in the keybinding code to display an empty string instead of the "NULL" special value, when the keybinding is unset.

lanoxx commented 3 years ago

image

aacebedo commented 3 years ago

Hi I got an issue when trying to disable a keybinding. On 1.5.4 setting NULL as a keybinding in the config file works however if I edit the configuration through the window, I receive a message about an invalid keybinding and I cannot close it