-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libinput has many options - let's support an important one. #6
Comments
does the machine have a touchpad? >> if it has a battery then it's likely not a desktop @Consolatis in IRC also mentioned that keyboard layout might be handy in *tweaks. Might be a bit more interesting (as in difficult) to add that capability. Really (IMHO), keyboard layout should be a distro thing, or at least wlroots, and all the other keyboard options, model, variant, rules. |
I’m easy. |
Hmm.. my rough attempt to find keyboard layouts - just need to confirm the general location of #include <stdio.h>
#include <glib.h>
#include <glib/gprintf.h>
#define MAXLN 255
FILE *fp;
char buf[MAXLN];
const char *lt = "! layout";
const char *vt = "! variant";
const char *evdev = "/etc/X11/xkb/rules/evdev.lst";
guint l = 8;
guint v = 9;
/**
* get the line number of the layout and the variant as to find
* all the layouts as they are between these two comments
*/
int
get_ln(const char *s, int i) {
int ret, x;
fp = fopen(evdev, "r");
if (fp == NULL) {
perror("Error opening file");
exit (EXIT_FAILURE);
}
x = 1;
while (fgets(buf, MAXLN, fp)) {
if (g_ascii_strncasecmp(buf, s, i) != 0) {
x += 1;
continue;
}
ret = x;
}
fclose(fp);
return ret;
}
/**
* iterate through all the layouts
*/
void
get_layouts(void) {
int n = 0; /* line count */
int y = get_ln(lt, l) + 1; /* line no of "! layout" */
int z = get_ln(vt, v) -2 ; /* line no of "! variant" */
int w = y + z;
fp = fopen(evdev, "r");
if (fp == NULL) {
perror("Error opening file");
exit (EXIT_FAILURE);
}
while (fgets(buf, MAXLN, fp)) {
n += 1;
if (n < y) {
continue;
}
if (n > z) {
break;
}
if ((n >= y) && (n <= w)) {
g_printf("%s", buf);
}
}
fclose(fp);
}
int
main(void) {
get_layouts();
return 0;
} edit: remove new line |
Good find. On my machine it's at |
same for me (Debian). |
Yeah I think slack puts it in the legacy location, and symlinks |
hello can confirm also Void Linux evdev.lst is in /usr/share/X11/xkb/rules thanks @01micko for pointing me here. |
Just getting back to adding keyboard layout, we should probably support 2 layouts as an option
I plan to work on this soon. |
That would limit the possible layouts to 2. It would also waste screen-space when there is only a single layout required (this is not that much of an issue though). Could we instead add a button like |
Sure, shouldn't be much different. |
Simplified version (at least I think it's simpler 😄)
|
It works ;-) |
I don't know about you (you - as in anyone reading this) but the first thing I do on any laptop is enable tap-to-click.
Perhaps, without making this app too complex, this should be an option in the GUI.
Thanks for consideration, and if you don't mind @johanmalm I might take a look if you think this is a necessary option.
I'll await your response before proceeding :^)
Anyone else post your opinion either way.
Things to consider :
Thanks for reading.
The text was updated successfully, but these errors were encountered: