From fa2f8b14e1577e20a91a6a7e36106266be0f8484 Mon Sep 17 00:00:00 2001 From: Alexis Jhon Gaspar Date: Tue, 3 Oct 2023 22:18:53 +0800 Subject: [PATCH] Placed power menu above, and added simple window controls --- dwm-flexipatch/config.def.h | 17 +++++++-- dwm-flexipatch/dwm.c | 3 ++ dwm-flexipatch/patch/bar_statusbutton.c | 51 +++++++++++++++++++++++++ dwm-flexipatch/patch/bar_statusbutton.h | 9 +++++ 4 files changed, 77 insertions(+), 3 deletions(-) diff --git a/dwm-flexipatch/config.def.h b/dwm-flexipatch/config.def.h index c781b91..63b5f94 100644 --- a/dwm-flexipatch/config.def.h +++ b/dwm-flexipatch/config.def.h @@ -96,9 +96,12 @@ static const int vertpadbar = 0; /* vertical padding for statusba #if BAR_STATUSBUTTON_PATCH static const char buttonbar[] = "󰕰 Start"; static const char buttonbar2[] = " st"; -static const char buttonbar3[] = " Firefox"; +static const char buttonbar3[] = "󰈹 Firefox"; static const char buttonbar4[] = "󰝚 mpd"; -static const char buttonbar5[] = "󰍃 󰐥 Power"; +static const char buttonbar5[] = "󰗼 󰐥"; +static const char buttonbar6[] = "󰅖"; +static const char buttonbar7[] = "󰖯"; +static const char buttonbar8[] = "󰖰"; #endif // BAR_STATUSBUTTON_PATCH #if BAR_SYSTRAY_PATCH static const unsigned int systrayspacing = 2; /* systray spacing */ @@ -563,7 +566,6 @@ static const BarRule barrules[] = { { -1, 1, BAR_ALIGN_LEFT, width_stbutton2, draw_stbutton2, click_stbutton2, NULL, "statusbutton2" }, { -1, 1, BAR_ALIGN_LEFT, width_stbutton3, draw_stbutton3, click_stbutton3, NULL, "statusbutton3" }, { -1, 1, BAR_ALIGN_LEFT, width_stbutton4, draw_stbutton4, click_stbutton4, NULL, "statusbutton4" }, - { -1, 1, BAR_ALIGN_RIGHT, width_stbutton5, draw_stbutton5, click_stbutton5, NULL, "statusbutton5" }, #endif // BAR_STATUSBUTTON_PATCH #if BAR_TAGGRID_PATCH { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, NULL, "taggrid" }, @@ -577,6 +579,12 @@ static const BarRule barrules[] = { #if BAR_TAGLABELS_PATCH { -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, hover_taglabels, "taglabels" }, #endif // BAR_TAGLABELS_PATCH + #if BAR_STATUSBUTTON_PATCH + { -1, 0, BAR_ALIGN_RIGHT, width_stbutton5, draw_stbutton5, click_stbutton5, NULL, "statusbutton5" }, + { -1, 1, BAR_ALIGN_RIGHT, width_stbutton6, draw_stbutton6, click_stbutton6, NULL, "statusbutton6" }, + { -1, 1, BAR_ALIGN_RIGHT, width_stbutton7, draw_stbutton7, click_stbutton7, NULL, "statusbutton7" }, + { -1, 1, BAR_ALIGN_RIGHT, width_stbutton8, draw_stbutton8, click_stbutton8, NULL, "statusbutton8" }, + #endif // BAR_STATUSBUTTON_PATCH #if BAR_SYSTRAY_PATCH { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, NULL, "systray" }, #endif // BAR_SYSTRAY_PATCH @@ -1388,6 +1396,9 @@ static const Button buttons[] = { { ClkButton4, 0, Button1, spawn, SHCMD("st -T ncmpcpp ncmpcpp") }, { ClkButton4, 0, Button3, spawn, SHCMD("printf '󰒮 Previous Song, mpc prev\n󰐊 Play, mpc play\n󰏤 Pause, mpc pause\n󰓛 Stop, mpc stop\n󰒭 Next Song, mpc next\n󰕾 Vol +5%%,mpc vol +5\n󰖀 Vol -5%%, mpc vol -5\n' | jgmenu --simple --at-pointer") }, { ClkButton5, 0, Button1, spawn, SHCMD("shutdown") }, + { ClkButton6, 0, Button1, killclient, {0} }, + { ClkButton7, 0, Button1, togglemax, {0} }, + { ClkButton8, 0, Button1, showhideclient, {0} }, #endif // BAR_STATUSBUTTON_PATCH { ClkLtSymbol, 0, Button1, setlayout, {0} }, #if BAR_LAYOUTMENU_PATCH diff --git a/dwm-flexipatch/dwm.c b/dwm-flexipatch/dwm.c index 63dc75d..a577f85 100644 --- a/dwm-flexipatch/dwm.c +++ b/dwm-flexipatch/dwm.c @@ -236,6 +236,9 @@ enum { ClkButton3, ClkButton4, ClkButton5, + ClkButton6, + ClkButton7, + ClkButton8, #endif // BAR_STATUSBUTTON_PATCH #if TAB_PATCH ClkTabBar, diff --git a/dwm-flexipatch/patch/bar_statusbutton.c b/dwm-flexipatch/patch/bar_statusbutton.c index d098838..9b53694 100644 --- a/dwm-flexipatch/patch/bar_statusbutton.c +++ b/dwm-flexipatch/patch/bar_statusbutton.c @@ -84,3 +84,54 @@ click_stbutton5(Bar *bar, Arg *arg, BarArg *a) { return ClkButton5; } +int +width_stbutton6(Bar *bar, BarArg *a) +{ + return TEXTW(buttonbar6); +} + +int +draw_stbutton6(Bar *bar, BarArg *a) +{ + return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar6, 0, False); +} + +int +click_stbutton6(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkButton6; +} +int +width_stbutton7(Bar *bar, BarArg *a) +{ + return TEXTW(buttonbar7); +} + +int +draw_stbutton7(Bar *bar, BarArg *a) +{ + return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar7, 0, False); +} + +int +click_stbutton7(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkButton7; +} +int +width_stbutton8(Bar *bar, BarArg *a) +{ + return TEXTW(buttonbar8); +} + +int +draw_stbutton8(Bar *bar, BarArg *a) +{ + return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar8, 0, False); +} + +int +click_stbutton8(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkButton8; +} diff --git a/dwm-flexipatch/patch/bar_statusbutton.h b/dwm-flexipatch/patch/bar_statusbutton.h index 65d8159..c2893f5 100644 --- a/dwm-flexipatch/patch/bar_statusbutton.h +++ b/dwm-flexipatch/patch/bar_statusbutton.h @@ -13,3 +13,12 @@ static int click_stbutton4(Bar *bar, Arg *arg, BarArg *a); static int width_stbutton5(Bar *bar, BarArg *a); static int draw_stbutton5(Bar *bar, BarArg *a); static int click_stbutton5(Bar *bar, Arg *arg, BarArg *a); +static int width_stbutton6(Bar *bar, BarArg *a); +static int draw_stbutton6(Bar *bar, BarArg *a); +static int click_stbutton6(Bar *bar, Arg *arg, BarArg *a); +static int width_stbutton7(Bar *bar, BarArg *a); +static int draw_stbutton7(Bar *bar, BarArg *a); +static int click_stbutton7(Bar *bar, Arg *arg, BarArg *a); +static int width_stbutton8(Bar *bar, BarArg *a); +static int draw_stbutton8(Bar *bar, BarArg *a); +static int click_stbutton8(Bar *bar, Arg *arg, BarArg *a);