| -u | --kernarch | The machine architecture |
| -k | --kernel | Combined kernel name and version |
| | --keyboard | Query xorg and show the currently used keyboard layout |
+| | --mouse | Query xorg and get the mouse speed in percentage |
| | --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. |
| icons=/tmp | | xbm icons that can be used by dzen2 for example. Discarded when **--with-dwm** is used |
| --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-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** |
<flag name="dvd">To get the cdrom or dvdrom vendor and model names.</flag>
<flag name="dwm">Output the data to the root window. Enable it if you are
using dwm.</flag>
- <flag name="ip">Fetch and display your current (ipv4) IP address.</flag>
+ <flag name="ip">Fetch and display your external (ipv4) IP address.</flag>
<flag name="keyboard">Query xorg and show the currently used keyboard
layout.</flag>
<flag name="libnl">Enable the wifi related options regarding chipsets
supporting the cfg80211,mac80211 modules</flag>
<flag name="lisp">Extend pinkybar with your own crafted script written
in lisp, stored in /usr/share/pinkysc/pinky.lisp</flag>
+ <flag name="mouse">Query xorg and get the mouse speed in percentage.</flag>
<flag name="mpd">To see the currently played song name, date, artist(s),
title.</flag>
<flag name="ncurses">Output the data to the terminal using the ncurses
LICENSE="GPL-3"
SLOT="0"
IUSE="+alsa colors drivetemp drivetemp-light dvd dwm ip keyboard libnl lisp lua
- mpd ncurses +net +pci perl python2 r ruby sensors slang smartemp tcl weather"
+ mouse mpd ncurses +net +pci perl python2 r ruby sensors slang smartemp tcl weather"
DEPEND="
sys-devel/autoconf
libnl? ( >=dev-libs/libnl-3.2.27 virtual/pkgconfig )
lisp? ( dev-lisp/ecls )
lua? ( dev-lang/lua )
+ mouse? ( x11-libs/libX11 )
mpd? ( media-sound/mpd media-libs/libmpdclient )
ncurses? ( sys-libs/ncurses )
net? ( sys-apps/iproute2 )
$(use_with libnl)
$(use_with lisp)
$(use_with lua)
+ $(use_with mouse)
$(use_with mpd)
$(use_with ncurses)
$(use_with net)
--- /dev/null
+#define mouse_01_width 8
+#define mouse_01_height 8
+static unsigned char mouse_01_bits[] = {
+ 0xEE, 0xEE, 0xEE, 0x82, 0xFE, 0xFE, 0xFE, 0x7C };
WITH_COLOURS=0
WITH_KEYBOARD=0
WITH_DWM=0
+ WITH_MOUSE=0
AC_ARG_WITH([dwm],
AS_HELP_STRING([--with-dwm],
[with_keyboard=no]
)
+ AC_ARG_WITH([mouse],
+ AS_HELP_STRING([--with-mouse],
+ [X11 linker flag for mouse speed support]),
+ [],
+ [with_mouse=no]
+ )
+
AC_ARG_WITH([colors],
AS_HELP_STRING([--with-colors],
[Colorize the output]),
WITH_COLOURS=1
])
- AS_IF([test "x$with_dwm" = "xyes" || test "x$with_keyboard" = "xyes"], [
+ AS_IF([test "x$with_dwm" = "xyes" || test "x$with_keyboard" = "xyes" || test "x$with_mouse" = "xyes"], [
AC_CHECK_HEADERS([X11/Xlib.h X11/XKBlib.h], [
X_LIBS="-lX11"
],[
WITH_KEYBOARD=1
])
+ AS_IF([test "x$with_mouse" = "xyes"], [
+ WITH_MOUSE=1
+ ])
+
AS_IF([test "x$with_dwm" = "xyes"], [
WITH_DWM=1
])
AC_SUBST(X_LIBS)
AC_DEFINE_UNQUOTED([WITH_COLOURS],[$WITH_COLOURS],[Colorize the output])
AC_DEFINE_UNQUOTED([WITH_KEYBOARD],[$WITH_KEYBOARD],[Query xorg to get the currently used kb layout])
+ AC_DEFINE_UNQUOTED([WITH_MOUSE],[$WITH_MOUSE],[Query xorg to get the current mouse speed])
AC_DEFINE_UNQUOTED([WITH_DWM],[$WITH_DWM],[Output the data to the root window])
- AS_IF([test "x$with_dwm" = "xyes" || test "x$with_keyboard" = "xyes"], [
+ AS_IF([test "x$with_dwm" = "xyes" || test "x$with_keyboard" = "xyes" || test "x$with_mouse" = "xyes"], [
AC_LINK_IFELSE([
AC_LANG_SOURCE([[
#include <X11/Xlib.h>
#endif /* WITH_KEYBOARD && HAVE_X11_XKBLIB_H */
+/* Based on xset.c */
+#if WITH_MOUSE == 1 && defined(HAVE_X11_XLIB_H)
+void
+get_mouse(char *str1) {
+ Display *display = XOpenDisplay(NULL);
+ int acc_num = 0, acc_denom = 0, threshold = 0;
+
+ if (NULL == display) {
+ exit_with_err(CANNOT_OPEN, "X server");
+ }
+
+ XGetPointerControl(display, &acc_num, &acc_denom, &threshold);
+ FILL_ARR(str1, "%d", (110 - threshold));
+ XCloseDisplay(display);
+}
+
+#endif /* WITH_MOUSE && HAVE_X11_XLIB_H */
+
+
#if !defined(HAVE_SENSORS_SENSORS_H) && !defined(__OpenBSD__)
void
get_fans(char *str1) {
#define LOAD_STR CPU_STR
#define UP_STR XBM_ICON("uptime.xbm")
#define MAIL_STR XBM_ICON("mail.xbm")
+#define MOUSE_STR XBM_ICON("mouse.xbm")
/* Only for the weather */
#define OUT_STR BLUE XBM_ICON("fox.xbm")" "
#define LOAD_STR "Load/avg"
#define OUT_STR "Out "
#define MAIL_STR "Mail"
+#define MOUSE_STR "Mouse"
#endif /* HAVE_X11_XLIB_H || WITH_NCURSES || WITH_COLOURS */
KEYBOARD,
GMAIL,
IP,
+ MOUSE,
BULLSHIFT
};
const char *argp_program_version = PACKAGE_STRING;
{ .name = "keyboard", .key = KEYBOARD, .doc = "Query xorg and show the currently used keyboard layout." },
#endif /* WITH_KEYBOARD && HAVE_X11_XKBLIB_H */
+#if WITH_MOUSE == 1 && defined(HAVE_X11_XLIB_H)
+ { .name = "mouse", .key = MOUSE, .doc = "Query xorg to get the current mouse speed." },
+#endif /* WITH_MOUSE && HAVE_X11_XLIB_H */
+
#if !defined(__OpenBSD__)
{ .name = "ramshared", .key = 'l', .doc = "The shared ram." },
{ .name = "rambuffer", .key = 'o', .doc = "The buffered ram." },
NEW_MPD_LABEL('W', char song_track[VLA], song_track, 1, FMT_SONG);
#endif /* HAVE_MPD_CLIENT_H */
+
#if WITH_KEYBOARD == 1 && defined(HAVE_X11_XKBLIB_H)
NEW_LABEL(KEYBOARD, char keyboard[VLA], keyboard, FMT_KERN);
#endif /* WITH_KEYBOARD && HAVE_X11_XKBLIB_H */
+
+#if WITH_MOUSE == 1 && defined(HAVE_X11_XLIB_H)
+ NEW_LABEL(MOUSE, char mouse[VLA], mouse, FMT, MOUSE_STR);
+#endif /* WITH_MOUSE && HAVE_X11_XLIB_H */
+
+
#if defined(HAVE_CDIO_CDIO_H) || defined(__linux__)
NEW_LABEL('z', char dvd[VLA], dvd, FMT_KERN);
#endif /* HAVE_CDIO_CDIO_H || __linux__ */
#if WITH_KEYBOARD == 1 && defined(HAVE_X11_XKBLIB_H)
void get_keyboard(char *);
-#endif /* WITH_KEYBOARD */
+#endif /* WITH_KEYBOARD && HAVE_X11_XKBLIB_H */
+
+#if WITH_MOUSE == 1 && defined(HAVE_X11_XLIB_H)
+void get_mouse(char *);
+#endif /* WITH_MOUSE && HAVE_X11_XKBLIB_H */
#if defined(HAVE_CDIO_CDIO_H) || defined(__linux__)
void get_dvd(char *);