| | --mouse | Query xorg and get the mouse speed in percentage |
| | --numlock | Query xorg to get the current state of numlock |
| | --capslock | Query xorg to get the current state of capslock |
+| | --scrolllock | Query xorg to get the current state of scroll lock |
| | --gmail | Query gmail and show all unread emails |
| | --perl | Extend pinkybar with your scripts written in perl, learn more from the Opt-in section. |
| | --python | Extend pinkybar with your scripts written in python, learn more from the Opt-in section. |
| --with-mpd | --without-mpd | To see the currently played song name (if any). |
| --with-keyboard | --without-keyboard | Query xorg and show the currently used keyboard layout |
| --with-mouse | --without-mouse | Query xorg and get the mouse speed in percentage |
-| --with-numcapslock | --without-numcapslock | Query xorg to get the current state of numlock and capslock |
+| --with-numcapslock | --without-numcapslock | Query xorg to get the current state of numlock, capslock and scroll lock |
| --with-mail | --without-mail | Query gmail and show all unread emails, must be combined with the variables **gmail_account** and **gmail_password** |
| --with-ip | --without-ip | Return your external ip address (ipv4). |
| gmail\_account=foo | | Your gmail account goes here, must be combined **--with-mail** |
MOUSE,
NUMLOCK,
CAPSLOCK,
+ SCROLLLOCK,
BULLSHIFT
};
const char *argp_program_version = PACKAGE_STRING;
#endif /* WITH_MOUSE && HAVE_X11_XLIB_H */
#if WITH_NUMLOCK == 1 && defined(HAVE_X11_XLIB_H)
- { .name = "numlock", .key = NUMLOCK, .doc = "Query xorg to get the current state of numlock." },
- { .name = "capslock", .key = CAPSLOCK, .doc = "Query xorg to get the current state of capslock." },
+ { .name = "numlock", .key = NUMLOCK, .doc = "Query xorg to get the current state of numlock." },
+ { .name = "capslock", .key = CAPSLOCK, .doc = "Query xorg to get the current state of capslock." },
+ { .name = "scrolllock", .key = SCROLLLOCK, .doc = "Query xorg to get the current state of capslock." },
#endif /* WITH_MOUSE && HAVE_X11_XLIB_H */
#if !defined(__OpenBSD__)
NEW_LABEL(NUMLOCK, char numlock[VLA], numlock, FMT_KERN);
NEW_LABEL(CAPSLOCK, char capslock[VLA], capslock, FMT_KERN);
+
+ NEW_LABEL(SCROLLLOCK, char scrolllock[VLA], scrolllock, FMT_KERN);
#endif /* WITH_KEYBOARD && HAVE_X11_XLIB_H */
#if WITH_NUMLOCK == 1 && defined(HAVE_X11_XLIB_H)
void get_numlock(char *);
void get_capslock(char *);
+void get_scrolllock(char *);
#endif /* WITH_NUMLOCK && HAVE_X11_XLIB_H */
#endif /* X11_H_ */
FILL_ARR(str1, "Caps %s", (x.led_mask & 1 ? "On" : "Off"));
}
+
+void
+get_scrolllock(char *str1) {
+ Display *display = XOpenDisplay(NULL);
+ XKeyboardState x;
+
+ if (NULL == display) {
+ exit_with_err(CANNOT_OPEN, "X server");
+ }
+
+ XGetKeyboardControl(display, &x);
+ XCloseDisplay(display);
+
+ FILL_ARR(str1, "Scroll %s", (x.led_mask & 4 ? "On" : "Off"));
+}
#endif /* WITH_NUMLOCK && HAVE_X11_XLIB_H */
#else