remove statusbar.h, it is now merged with status.h

This commit is contained in:
speedie 2022-12-18 17:54:59 +01:00
parent d5ef228954
commit 6a1f8eaef2
7 changed files with 81 additions and 66 deletions

View file

@ -305,7 +305,7 @@ Instead, config.h is split into different parts to make it easier to edit. Inste
- rules.h for adding/removing rules
- keybinds.h for adding/removing keybinds.
- mouse.h for adding/removing mouse binds.
- statusbar.h for adding/removing statuscmd clicks.
- status.h for adding/removing status modules and aadding/removing statuscmd clicks.
- ipc.h for adding/removing IPC commands. (If support is compiled in)
- toggle.h for adding/removing features from getting compiled in.
@ -339,7 +339,7 @@ The magic of .Xresources is that it is a universal configuration file. While you
Below is a list of all .Xresources values you can define.
- speedwm.bar.height: 4
- speedwm.bar.height: 3
- speedwm.bar.position: 1
- speedwm.bar.paddingh: 10
- speedwm.bar.paddingv: 10
@ -372,7 +372,7 @@ Below is a list of all .Xresources values you can define.
- speedwm.client.swallow: 1
- speedwm.client.swallowfloating: 1
- speedwm.client.wmclass: 1
- speedwm.fonts.font: NotoSans Regular 8
- speedwm.fonts.font: NotoSans Regular 9
- speedwm.col.background: #222222
- speedwm.col.layout: #99b3ff
- speedwm.col.layouttext: #000000
@ -454,21 +454,21 @@ Below is a list of all .Xresources values you can define.
- speedwm.text.tag7.used: 
- speedwm.text.tag8.used: 
- speedwm.text.tag9.used: 
- speedwm.text.layout1: [L1]
- speedwm.text.layout2: [L2]
- speedwm.text.layout3: [L3]
- speedwm.text.layout4: [L4]
- speedwm.text.layout5: [L5]
- speedwm.text.layout6: [L6]
- speedwm.text.layout7: [L7]
- speedwm.text.layout8: [L8]
- speedwm.text.layout9: [L9]
- speedwm.text.layout10: [L10]
- speedwm.text.layout11: [L11]
- speedwm.text.layout12: [L12]
- speedwm.text.layout13: [L13]
- speedwm.text.layout14: [L14]
- speedwm.text.layout15: [L15]
- speedwm.text.layout1: L1
- speedwm.text.layout2: L2
- speedwm.text.layout3: L3
- speedwm.text.layout4: L4
- speedwm.text.layout5: L5
- speedwm.text.layout6: L6
- speedwm.text.layout7: L7
- speedwm.text.layout8: L8
- speedwm.text.layout9: L9
- speedwm.text.layout10: L10
- speedwm.text.layout11: L11
- speedwm.text.layout12: L12
- speedwm.text.layout13: L13
- speedwm.text.layout14: L14
- speedwm.text.layout15: L15
- speedwm.color.hiddentitle: 1
- speedwm.color.layout: 0
- speedwm.color.selectedtitle: 1
@ -669,7 +669,7 @@ Below is a list of all signums and what they do.
speedwm has a status bar. It's the right part of the bar. It supports Pango, status2d and statuscmd markup as well as regular plain text and colored emojis or glyphs. To override this status, you can use the 'speedwm -s <status>' command.
Bundled with speedwm is a fork of dwmblocks. dwmblocks is a dwm status bar that handles this all for you through a block system. This fork has been integrated into the Makefile and is (by default) installed when speedwm is compiled. The status bar can be configured in the status.c and status.h and clickability can be configured in statusbar.h.
Bundled with speedwm is a fork of dwmblocks. dwmblocks is a dwm status bar that handles this all for you through a block system. This fork has been integrated into the Makefile and is (by default) installed when speedwm is compiled. The status bar can be configured in the status.c and status.h.
By default the status bar runs modules that are also bundled with speedwm (see modules/ directory). To configure these modules, you can edit ~/.config/speedwm/statusrc which should be created when a module runs.

View file

@ -11,7 +11,7 @@ Instead, config.h is split into different parts to make it easier to edit. Inste
- rules.h for adding/removing rules
- keybinds.h for adding/removing keybinds.
- mouse.h for adding/removing mouse binds.
- statusbar.h for adding/removing statuscmd clicks.
- status.h for adding/removing status modules and aadding/removing statuscmd clicks.
- ipc.h for adding/removing IPC commands. (If support is compiled in)
- toggle.h for adding/removing features from getting compiled in.

View file

@ -2,7 +2,7 @@
speedwm has a status bar. It's the right part of the bar. It supports Pango, status2d and statuscmd markup as well as regular plain text and colored emojis or glyphs. To override this status, you can use the 'speedwm -s <status>' command.
Bundled with speedwm is a fork of dwmblocks. dwmblocks is a dwm status bar that handles this all for you through a block system. This fork has been integrated into the Makefile and is (by default) installed when speedwm is compiled. The status bar can be configured in the status.c and status.h and clickability can be configured in statusbar.h.
Bundled with speedwm is a fork of dwmblocks. dwmblocks is a dwm status bar that handles this all for you through a block system. This fork has been integrated into the Makefile and is (by default) installed when speedwm is compiled. The status bar can be configured in the status.c and status.h.
By default the status bar runs modules that are also bundled with speedwm (see modules/ directory). To configure these modules, you can edit ~/.config/speedwm/statusrc which should be created when a module runs.

View file

@ -409,6 +409,15 @@ typedef struct {
int id;
} ClickStatus;
#if USEMOUSE
typedef struct {
char* icon;
char* command;
unsigned int interval;
unsigned int signal;
} Module;
#endif
/* Xresources preferences */
enum resource_type {
STRING = 0,
@ -930,7 +939,7 @@ static const char *clickstatus[] = { shell, "-c", NULL, NULL }; /* for running c
/* Mouse support */
#if USEMOUSE
#include "mouse.h" /* Include mouse support */
#include "statusbar.h" /* Include mouse clickstatus support */
#include "status.h" /* Include mouse clickstatus support */
#endif
/* IPC support */

View file

@ -21,6 +21,11 @@ typedef struct {
unsigned int interval;
unsigned int signal;
} Module;
/* this is only here so we can use status.h for clickstatus too */
typedef struct {
char* mcommand;
int clickstatuss;
} ClickStatus;
typedef struct Thread_ev {
const Module *module;
size_t idx;

View file

@ -12,6 +12,11 @@
*
*/
static int hideemptymodule = 1; /* Hide the module if command returns nothing */
static char leftpadding[] = ""; /* Padding on the left side of the status text */
static char rightpadding[] = ""; /* Padding on the right side of the status text */
static char *separator = ""; /* Delimiter between modules. Note that this will be applied even if a command is empty. */
static const Module modules[] = {
/* prefix command update interval update signal */
{ "<\x01", "module_time --print", 1, 1 },
@ -28,7 +33,43 @@ static const Module modules[] = {
{ "<\x02", "module_email --print", 30, 12 },
};
static int hideemptymodule = 1; /* Hide the module if command returns nothing */
static char leftpadding[] = ""; /* Padding on the left side of the status text */
static char rightpadding[] = ""; /* Padding on the right side of the status text */
static char *separator = ""; /* Delimiter between modules. Note that this will be applied even if a command is empty. */
/* Commands that will run when a part of the status bar is pressed. You can add:
* '\x<num>
* before you print anything. Keep in mind <num> MUST be two digits.
*
* It must also be wrapped in a printf. Example:
*
* Invalid: speedwm -s "\x01This is a test"
* Valid: speedwm -s "$(printf '\x01This is a test')"
*
* As for the modules here, they are only compatible with the built-in status bar by default.
* You may add support in your own bar, though.
*
* Syntax: { "<command", <clicknum> },
*
* On click, the file /tmp/speedwm-button is created. In this file:
*
* 1 - Left click
* 2 - Middle click
* 3 - Right click
*
* See https://dwm.suckless.org/patches/statuscmd for more information.
*
* Note that if you're using the powerline status, this is NOT compatible with that.
* See bar.h for more information.
*
*/
static const ClickStatus clickstatuss[] = {
{ "module_time --click", 1 },
{ "module_date --click", 2 },
{ "module_bat --click", 3 },
{ "module_vol --click", 4 },
{ "module_ram --click", 5 },
{ "module_net --click", 6 },
{ "module_temp --click", 7 },
{ "module_weather --click", 8 },
{ "module_music --click", 9 },
{ "module_dfmpeg --click", 10 },
{ "module_news --click", 11 },
{ "module_email --click", 12 },
};

View file

@ -1,40 +0,0 @@
/* Commands that will run when a part of the status bar is pressed. You can add:
* '\x<num>
* before you print anything. Keep in mind <num> MUST be two digits.
*
* It must also be wrapped in a printf. Example:
*
* Invalid: speedwm -s "\x01This is a test"
* Valid: speedwm -s "$(printf '\x01This is a test')"
*
* As for the modules here, they are only compatible with the built-in status bar by default.
* You may add support in your own bar, though.
*
* Syntax: { "<command", <clicknum> },
*
* On click, the file /tmp/speedwm-button is created. In this file:
*
* 1 - Left click
* 2 - Middle click
* 3 - Right click
*
* See https://dwm.suckless.org/patches/statuscmd for more information.
*
* Note that if you're using the powerline status, this is NOT compatible with that.
* See bar.h for more information.
*
*/
static const ClickStatus clickstatuss[] = {
{ "module_time --click", 1 },
{ "module_date --click", 2 },
{ "module_bat --click", 3 },
{ "module_vol --click", 4 },
{ "module_ram --click", 5 },
{ "module_net --click", 6 },
{ "module_temp --click", 7 },
{ "module_weather --click", 8 },
{ "module_music --click", 9 },
{ "module_dfmpeg --click", 10 },
{ "module_news --click", 11 },
{ "module_email --click", 12 },
};