Compare commits
2
Commits
889ecc6eb9
...
local
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71ee58ed76 | ||
|
|
9dc4646559 |
@@ -36,6 +36,9 @@ static const Rule rules[] = {
|
||||
{ "LibreWolf", NULL, NULL, 1<<7, 0, -1 },
|
||||
{ NULL, "emacs", NULL, 1<<8, 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[] = {
|
||||
/* modifier key function argument */
|
||||
|
||||
{ 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
|
||||
{ ShiftMask, XK_Insert, spawn, { .v = simulate_mmb } }, // Paste what the mouse selection by simulating a MMB click
|
||||
|
||||
@@ -11,8 +11,8 @@ X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# Xinerama, comment if you don't want it
|
||||
# XINERAMALIBS = -lXinerama
|
||||
# XINERAMAFLAGS = -DXINERAMA
|
||||
XINERAMALIBS = -lXinerama
|
||||
XINERAMAFLAGS = -DXINERAMA
|
||||
|
||||
# freetype
|
||||
FREETYPELIBS = -lfontconfig -lXft
|
||||
|
||||
@@ -30,17 +30,7 @@ namespace
|
||||
bool has_child;
|
||||
Proc child;
|
||||
|
||||
Cmd browser(
|
||||
#if !defined(PULSEAUDIO) && !defined(PIPEWIRE)
|
||||
"apulse",
|
||||
#endif
|
||||
BROWSER);
|
||||
|
||||
Cmd amixer("amixer"
|
||||
#if defined(PULSEAUDIO)
|
||||
,"-Dpulse"
|
||||
#endif
|
||||
);
|
||||
Cmd browser(BROWSER);
|
||||
|
||||
Cmd low_battery_notify("notify-send", "--urgency=critical", "Battery Low");
|
||||
}
|
||||
@@ -209,19 +199,23 @@ extern "C"
|
||||
catch(...){ cerr << "EXCEPT\n"; }
|
||||
|
||||
// Volume
|
||||
string amix_out = $(amixer + "get" + AUDIO_DEV);
|
||||
size_t vol_bracket = amix_out.find('[');
|
||||
string vol_out = $({"wpctl", "get-volume", "@DEFAULT_AUDIO_SINK@"});
|
||||
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 ? "🔇" : "🔉";
|
||||
|
||||
size_t first_digit = vol_bracket + 1;
|
||||
size_t close_bracket = amix_out.find(']', first_digit);
|
||||
new_stat.append(amix_out, first_digit, close_bracket - first_digit);
|
||||
size_t first_digit = vol_begin + 1;
|
||||
size_t vol_end = vol_out.find(' ', 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
|
||||
@@ -309,13 +303,11 @@ extern "C"
|
||||
|
||||
Cmd list_dirs ("ls", bm_root.c_str());
|
||||
|
||||
// Initial bookmark directory
|
||||
string dir = "Luxoft";
|
||||
|
||||
while(true)
|
||||
{
|
||||
// Choose bookmark directory
|
||||
string dir = $(list_dirs | dmenu);
|
||||
if( dir.empty() )
|
||||
return;
|
||||
|
||||
string bm_dir = bm_root + dir;
|
||||
|
||||
// Read content of bookmarks file and choose
|
||||
@@ -329,33 +321,38 @@ extern "C"
|
||||
detach(open_bookmark);
|
||||
break;
|
||||
}
|
||||
|
||||
// Choose bookmark directory
|
||||
dir = $(list_dirs | dmenu);
|
||||
if( dir.empty() )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
has_child = true;
|
||||
}
|
||||
|
||||
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);
|
||||
has_child = true;
|
||||
}
|
||||
|
||||
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);
|
||||
has_child = true;
|
||||
}
|
||||
|
||||
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);
|
||||
has_child = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user