Compare commits
5 Commits
1744707dc8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30c109acae | ||
|
|
2a9073de9c | ||
|
|
a2469aedaf | ||
|
|
d83cba2530 | ||
|
|
05d6d39d44 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
patches
|
||||
*.o
|
||||
dwm
|
||||
*.rej
|
||||
*.orig
|
||||
|
||||
33
config.def.h
33
config.def.h
@@ -1,5 +1,7 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include <X11/XF86keysym.h>
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
@@ -10,19 +12,21 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
|
||||
static const int showsystray = 1; /* 0 means no systray */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char *fonts[] = { "monospace:size=18", "Symbola:size=18" };
|
||||
static const char dmenufont[] = "monospace:size=22";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char col_cyan[] = "#a9759e";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
};
|
||||
|
||||
static const int refreshrate = 60; /* Hz — set to your monitor's rate (e.g., 60/120/144/165) */
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
@@ -41,7 +45,6 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||
static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
@@ -51,6 +54,7 @@ static const Layout layouts[] = {
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define PrintScreenDWM 0x0000ff61
|
||||
#define MODKEY Mod1Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
@@ -68,18 +72,18 @@ static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_p, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY|ShiftMask, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_q, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
@@ -100,7 +104,15 @@ static const Key keys[] = {
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
{ MODKEY|ShiftMask, XK_x, quit, {0} },
|
||||
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --decrease 5; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer --toggle-mute; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --increase 5; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 10%+; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_MonBrightnessDown,spawn, SHCMD("brightnessctl set 10%-; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("sh /usr/local/scripts/mutemic.sh; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, PrintScreenDWM, spawn, SHCMD("flameshot gui") },
|
||||
{ 0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause") },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
@@ -119,4 +131,3 @@ static const Button buttons[] = {
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
||||
|
||||
26
config.h
26
config.h
@@ -5,9 +5,14 @@
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
|
||||
static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */
|
||||
static const unsigned int systrayspacing = 2; /* systray spacing */
|
||||
static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
|
||||
static const int showsystray = 1; /* 0 means no systray */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=18", "Noto Color Emoji:size=18" };
|
||||
static const char *fonts[] = { "monospace:size=18", "Symbola:size=18" };
|
||||
static const char dmenufont[] = "monospace:size=22";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
@@ -100,12 +105,12 @@ static const Key keys[] = {
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_x, quit, {0} },
|
||||
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --decrease 5; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer --toggle-mute; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --increase 5; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 10%+; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_MonBrightnessDown,spawn, SHCMD("brightnessctl set 10%-; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("sh /usr/local/scripts/mutemic.sh; kill -44 $(pidof dwmblocks)") },
|
||||
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer --decrease 5; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer --toggle-mute; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer --increase 5; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 10%+; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_MonBrightnessDown,spawn, SHCMD("brightnessctl set 10%-; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("sh /usr/local/scripts/mutemic.sh; /usr/local/scripts/xsetsingle.sh") },
|
||||
{ 0, PrintScreenDWM, spawn, SHCMD("flameshot gui") },
|
||||
{ 0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause") },
|
||||
};
|
||||
@@ -126,10 +131,3 @@ static const Button buttons[] = {
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
||||
/* systray settings */
|
||||
static const unsigned int systraypinning = 0;
|
||||
static const unsigned int systrayonleft = 0;
|
||||
static const unsigned int systrayspacing = 0;
|
||||
static const int systraypinningfailfirst = 1;
|
||||
static const int showsystray = 1;
|
||||
|
||||
2523
dwm.c.orig
2523
dwm.c.orig
File diff suppressed because it is too large
Load Diff
52
xsetroot.sh
Executable file
52
xsetroot.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
while true; do
|
||||
micstat=$(pamixer --default-source --get-mute)
|
||||
[[ $micstat = "false" ]] && micstat="✔️"
|
||||
[[ $micstat = "true" ]] && micstat="🚫"
|
||||
|
||||
vol="$(pamixer --get-volume)%"
|
||||
|
||||
if [ "$vol" -gt "70" ]; then
|
||||
volicon="🔊"
|
||||
elif [ "$vol" -lt "30" ]; then
|
||||
volicon="🔈"
|
||||
else
|
||||
volicon="🔉"
|
||||
fi
|
||||
|
||||
[[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol=""
|
||||
|
||||
for battery in /sys/class/power_supply/BAT?
|
||||
do
|
||||
# Get its remaining capacity and charge status.
|
||||
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
|
||||
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/|⚡/" "$battery"/status)
|
||||
|
||||
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
||||
[ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
|
||||
|
||||
batmsg=$(printf "%s%s%s%s%%" "$status" "$warn" "$capacity")
|
||||
unset warn
|
||||
done
|
||||
|
||||
clock=$(date '+%I')
|
||||
|
||||
case "$clock" in
|
||||
"00") icon="🕛" ;;
|
||||
"01") icon="🕐" ;;
|
||||
"02") icon="🕑" ;;
|
||||
"03") icon="🕒" ;;
|
||||
"04") icon="🕓" ;;
|
||||
"05") icon="🕔" ;;
|
||||
"06") icon="🕕" ;;
|
||||
"07") icon="🕖" ;;
|
||||
"08") icon="🕗" ;;
|
||||
"09") icon="🕘" ;;
|
||||
"10") icon="🕙" ;;
|
||||
"11") icon="🕚" ;;
|
||||
"12") icon="🕛" ;;
|
||||
esac
|
||||
|
||||
xsetroot -name " 🔆 $(brightnessctl get -P) \ $volicon$vol \ $micstat🎤 \ $(free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fGB/%2.2fGB\n", ( $3 / 1000), ($2 / 1000))}') \ $batmsg \ $(date '+%a %d %b %Y') $icon $(date +"%-I:%M %p")"
|
||||
|
||||
sleep 1
|
||||
done
|
||||
48
xsetsingle.sh
Executable file
48
xsetsingle.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
micstat=$(pamixer --default-source --get-mute)
|
||||
[[ $micstat = "false" ]] && micstat="✔️"
|
||||
[[ $micstat = "true" ]] && micstat="🚫"
|
||||
|
||||
vol="$(pamixer --get-volume)%"
|
||||
|
||||
if [ "$vol" -gt "70" ]; then
|
||||
volicon="🔊"
|
||||
elif [ "$vol" -lt "30" ]; then
|
||||
volicon="🔈"
|
||||
else
|
||||
volicon="🔉"
|
||||
fi
|
||||
|
||||
[[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol=""
|
||||
|
||||
for battery in /sys/class/power_supply/BAT?
|
||||
do
|
||||
# Get its remaining capacity and charge status.
|
||||
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
|
||||
status=$(sed "s/[Dd]ischarging/🔋/;s/[Nn]ot charging/🛑/;s/[Cc]harging/🔌/;s/[Uu]nknown/♻️/;s/[Ff]ull/|⚡/" "$battery"/status)
|
||||
|
||||
# If it is discharging and 25% or less, we will add a ❗ as a warning.
|
||||
[ "$capacity" -le 25 ] && [ "$status" = "🔋" ] && warn="❗"
|
||||
|
||||
batmsg=$(printf "%s%s%s%s%%" "$status" "$warn" "$capacity")
|
||||
unset warn
|
||||
done
|
||||
|
||||
clock=$(date '+%I')
|
||||
|
||||
case "$clock" in
|
||||
"00") icon="🕛" ;;
|
||||
"01") icon="🕐" ;;
|
||||
"02") icon="🕑" ;;
|
||||
"03") icon="🕒" ;;
|
||||
"04") icon="🕓" ;;
|
||||
"05") icon="🕔" ;;
|
||||
"06") icon="🕕" ;;
|
||||
"07") icon="🕖" ;;
|
||||
"08") icon="🕗" ;;
|
||||
"09") icon="🕘" ;;
|
||||
"10") icon="🕙" ;;
|
||||
"11") icon="🕚" ;;
|
||||
"12") icon="🕛" ;;
|
||||
esac
|
||||
|
||||
xsetroot -name " 🔆 $(brightnessctl get -P) \ $volicon$vol \ $micstat🎤 \ $(free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fGB/%2.2fGB\n", ( $3 / 1000), ($2 / 1000))}') \ $batmsg \ $(date '+%a %d %b %Y') $icon $(date +"%-I:%M %p")"
|
||||
Reference in New Issue
Block a user