Compare commits

..
2 Commits
Author SHA1 Message Date
Venelin Dechkov 71ee58ed76 VENE_LOCAL 2026-07-30 13:03:29 +03:00
Venelin Dechkov 9dc4646559 alsa -> pipewire 2026-07-30 13:03:12 +03:00
3 changed files with 31 additions and 30 deletions
+4
View File
@@ -36,6 +36,9 @@ static const Rule rules[] = {
{ "LibreWolf", NULL, NULL, 1<<7, 0, -1 }, { "LibreWolf", NULL, NULL, 1<<7, 0, -1 },
{ NULL, "emacs", NULL, 1<<8, 0, -1 }, { NULL, "emacs", NULL, 1<<8, 0, -1 },
{ "dlt-viewer", NULL, NULL, 1<<5, 0, -1 }, { "dlt-viewer", NULL, NULL, 1<<5, 0, -1 },
{ "Emulator", NULL, "", 1<<9, 1, -1 },
{ "Emulator", NULL, "Android Emulator - MB_V530E_MB.EA-M_14_0_CID_Central_Information_Display:5554", 1<<5, 1, -1 },
}; };
@@ -85,6 +88,7 @@ static void webbookmark(const Arg* unused){
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY|ShiftMask, XK_s, vene_screenshot, {0} }, // Take a screenshot, located in ~/screenshots and in clipboard { MODKEY|ShiftMask, XK_s, vene_screenshot, {0} }, // Take a screenshot, located in ~/screenshots and in clipboard
{ MODKEY, XK_v, vene_clip_history,{0} }, // Clip history { MODKEY, XK_v, vene_clip_history,{0} }, // Clip history
{ ShiftMask, XK_Insert, spawn, { .v = simulate_mmb } }, // Paste what the mouse selection by simulating a MMB click { ShiftMask, XK_Insert, spawn, { .v = simulate_mmb } }, // Paste what the mouse selection by simulating a MMB click
+2 -2
View File
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib X11LIB = /usr/X11R6/lib
# Xinerama, comment if you don't want it # Xinerama, comment if you don't want it
# XINERAMALIBS = -lXinerama XINERAMALIBS = -lXinerama
# XINERAMAFLAGS = -DXINERAMA XINERAMAFLAGS = -DXINERAMA
# freetype # freetype
FREETYPELIBS = -lfontconfig -lXft FREETYPELIBS = -lfontconfig -lXft
+25 -28
View File
@@ -30,17 +30,7 @@ namespace
bool has_child; bool has_child;
Proc child; Proc child;
Cmd browser( Cmd browser(BROWSER);
#if !defined(PULSEAUDIO) && !defined(PIPEWIRE)
"apulse",
#endif
BROWSER);
Cmd amixer("amixer"
#if defined(PULSEAUDIO)
,"-Dpulse"
#endif
);
Cmd low_battery_notify("notify-send", "--urgency=critical", "Battery Low"); Cmd low_battery_notify("notify-send", "--urgency=critical", "Battery Low");
} }
@@ -209,19 +199,23 @@ extern "C"
catch(...){ cerr << "EXCEPT\n"; } catch(...){ cerr << "EXCEPT\n"; }
// Volume // Volume
string amix_out = $(amixer + "get" + AUDIO_DEV); string vol_out = $({"wpctl", "get-volume", "@DEFAULT_AUDIO_SINK@"});
size_t vol_bracket = amix_out.find('['); size_t vol_begin = vol_out.find(' ');
if(vol_bracket != string::npos) if(vol_begin != string::npos)
{ {
bool is_muted = amix_out.find("[on]") == string::npos; bool is_muted = vol_out.find("[MUTED]") != string::npos;
new_stat += is_muted ? "🔇" : "🔉"; new_stat += is_muted ? "🔇" : "🔉";
size_t first_digit = vol_bracket + 1; size_t first_digit = vol_begin + 1;
size_t close_bracket = amix_out.find(']', first_digit); size_t vol_end = vol_out.find(' ', first_digit);
new_stat.append(amix_out, first_digit, close_bracket - first_digit);
new_stat += ' '; if(vol_end == string::npos)
vol_end = vol_out.size() + 1;
float vol = stof( vol_out.substr(first_digit, vol_end - first_digit) );
new_stat += to_string(int(vol * 100)) + "% ";
} }
// Time // Time
@@ -309,13 +303,11 @@ extern "C"
Cmd list_dirs ("ls", bm_root.c_str()); Cmd list_dirs ("ls", bm_root.c_str());
// Initial bookmark directory
string dir = "Luxoft";
while(true) while(true)
{ {
// Choose bookmark directory
string dir = $(list_dirs | dmenu);
if( dir.empty() )
return;
string bm_dir = bm_root + dir; string bm_dir = bm_root + dir;
// Read content of bookmarks file and choose // Read content of bookmarks file and choose
@@ -329,33 +321,38 @@ extern "C"
detach(open_bookmark); detach(open_bookmark);
break; break;
} }
// Choose bookmark directory
dir = $(list_dirs | dmenu);
if( dir.empty() )
return;
} }
} }
void vene_inc_vol(const Arg*) void vene_inc_vol(const Arg*)
{ {
Cmd inc_vol(amixer + "-q" + "set" + AUDIO_DEV + "3%+"); Cmd inc_vol("wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "3%+");
child = detach(inc_vol); child = detach(inc_vol);
has_child = true; has_child = true;
} }
void vene_dec_vol(const Arg*) void vene_dec_vol(const Arg*)
{ {
Cmd dec_vol(amixer + "-q" + "set" + AUDIO_DEV + "3%-"); Cmd dec_vol("wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "3%-");
child = detach(dec_vol); child = detach(dec_vol);
has_child = true; has_child = true;
} }
void vene_toggle_vol(const Arg*) void vene_toggle_vol(const Arg*)
{ {
Cmd toggle_vol(amixer + "-q" + "set" + AUDIO_DEV + "toggle"); Cmd toggle_vol("wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle");
child = detach(toggle_vol); child = detach(toggle_vol);
has_child = true; has_child = true;
} }
void vene_toggle_mic(const Arg*) void vene_toggle_mic(const Arg*)
{ {
Cmd toggle_mic(amixer + "-q" + "set" + "Capture" + "toggle"); Cmd toggle_mic("wpctl", "set-mute", "@DEFAULT_AUDIO_SOURCE@", "toggle");
child = detach(toggle_mic); child = detach(toggle_mic);
has_child = true; has_child = true;
} }