Compare commits
3 Commits
7143225fc5
...
1e7857dfdd
Author | SHA1 | Date |
---|---|---|
Přemysl Eric Janouch | 1e7857dfdd | |
Přemysl Eric Janouch | 510a53b845 | |
Přemysl Eric Janouch | 6e67469e3f |
11
paswitch.c
11
paswitch.c
|
@ -791,8 +791,9 @@ read_key_sequence (const char *buf, size_t len)
|
|||
return ++p - buf;
|
||||
return -escapes;
|
||||
}
|
||||
// We don't know this sequence, so just return M-Esc
|
||||
if (escapes == 2)
|
||||
return -escapes;
|
||||
return escapes;
|
||||
}
|
||||
|
||||
// Shift state encodings aren't going to work, though anything else should
|
||||
|
@ -1039,16 +1040,16 @@ main (int argc, char *argv[])
|
|||
opt_handler_free (&oh);
|
||||
|
||||
if (!isatty (STDIN_FILENO))
|
||||
print_fatal ("input is not a terminal");
|
||||
exit_fatal ("input is not a terminal");
|
||||
if (!isatty (STDOUT_FILENO))
|
||||
print_fatal ("output is not a terminal");
|
||||
exit_fatal ("output is not a terminal");
|
||||
|
||||
setlocale (LC_CTYPE, "");
|
||||
// PulseAudio uses UTF-8, let's avoid encoding conversions
|
||||
if (strcasecmp (nl_langinfo (CODESET), "UTF-8"))
|
||||
print_fatal ("UTF-8 encoding required");
|
||||
exit_fatal ("UTF-8 encoding required");
|
||||
if (setvbuf (stdout, NULL, _IOLBF, 0) || !tty_start ())
|
||||
print_fatal ("terminal initialization failed");
|
||||
exit_fatal ("terminal initialization failed");
|
||||
|
||||
// TODO: we will need a logging function aware of our rendering
|
||||
g_log_message_real = log_message_custom;
|
||||
|
|
|
@ -2227,9 +2227,11 @@ g_keys[] =
|
|||
// Brightness
|
||||
{ Mod4Mask, XK_Home, on_brightness, 10 },
|
||||
{ Mod4Mask, XK_End, on_brightness, -10 },
|
||||
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
|
||||
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
|
||||
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
|
||||
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
|
||||
|
||||
{ Mod4Mask, XK_F4, on_standby, 0 },
|
||||
{ Mod4Mask | ShiftMask, XK_F4, on_insomnia, 0 },
|
||||
{ Mod4Mask, XK_Pause, on_standby, 0 },
|
||||
{ Mod4Mask | ShiftMask, XK_Pause, on_insomnia, 0 },
|
||||
|
||||
|
|
Loading…
Reference in New Issue