browser shortcut open or show
This commit is contained in:
@@ -68,13 +68,13 @@ static const Layout layouts[] = {
|
|||||||
// static const char* dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
// static const char* dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||||
static const char* dmenucmd[] = { "dmenu_run", NULL };
|
static const char* dmenucmd[] = { "dmenu_run", NULL };
|
||||||
static const char* termcmd[] = { "st", NULL };
|
static const char* termcmd[] = { "st", NULL };
|
||||||
|
static const char* screenshot [] = { "scrot", "-s", SCREEN_CAPS_DIR, NULL };
|
||||||
|
#if HAS_SW_BACKLIGHT
|
||||||
static const char* bright_up[] = { "brightnessctl", "s", "-q", "3%+", NULL };
|
static const char* bright_up[] = { "brightnessctl", "s", "-q", "3%+", NULL };
|
||||||
static const char* bright_down[] = { "brightnessctl", "s", "-q", "3%-", NULL };
|
static const char* bright_down[] = { "brightnessctl", "s", "-q", "3%-", NULL };
|
||||||
static const char* screenshot [] = { "scrot", "-s", SCREEN_CAPS_DIR, NULL };
|
#endif
|
||||||
|
|
||||||
static void webbookmark(const Arg* arg){
|
static void webbookmark(const Arg* unused){
|
||||||
const Arg tag = {.ui = 1<<7};
|
|
||||||
/* view(&tag); */
|
|
||||||
vene_webbookmark();
|
vene_webbookmark();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,8 +144,12 @@ extern "C"
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Battery
|
// Battery
|
||||||
string charge, state;
|
string charge;
|
||||||
ifstream("/sys/class/power_supply/BAT0/capacity") >> charge;
|
ifstream("/sys/class/power_supply/BAT0/capacity") >> charge;
|
||||||
|
|
||||||
|
if( !charge.empty() ) // If we have a charge we have a battery
|
||||||
|
{
|
||||||
|
string state;
|
||||||
ifstream("/sys/class/power_supply/BAT0/status") >> state;
|
ifstream("/sys/class/power_supply/BAT0/status") >> state;
|
||||||
|
|
||||||
const char* remaining = "";
|
const char* remaining = "";
|
||||||
@@ -157,11 +161,14 @@ extern "C"
|
|||||||
else
|
else
|
||||||
new_stat += "🔌";
|
new_stat += "🔌";
|
||||||
|
|
||||||
|
|
||||||
new_stat += charge;
|
new_stat += charge;
|
||||||
new_stat += "% ";
|
new_stat += "% ";
|
||||||
new_stat += remaining;
|
new_stat += remaining;
|
||||||
new_stat += ' ';
|
new_stat += ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
catch(...){ cerr << "EXCEPT\n"; }
|
catch(...){ cerr << "EXCEPT\n"; }
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
@@ -215,24 +222,23 @@ extern "C"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vene_browser(const Arg* arg)
|
void vene_browser(const Arg* browser_tag)
|
||||||
{
|
{
|
||||||
bool browser_tag_used = false;
|
bool browser_tag_used = false;
|
||||||
for(Client* c = selmon->clients; c; c = c->next)
|
for(Client* c = selmon->clients; c; c = c->next)
|
||||||
if(c->tags & 1<<8)
|
if(c->tags & browser_tag->ui)
|
||||||
{
|
{
|
||||||
browser_tag_used = true;
|
browser_tag_used = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if( browser_tag_used ) // browser tag is empty, start browser
|
if( browser_tag_used ) // browser tag is used, view it
|
||||||
{
|
{
|
||||||
view(arg);
|
view(browser_tag);
|
||||||
|
|
||||||
}
|
}
|
||||||
// else // view browser tag
|
else // start browser
|
||||||
{
|
{
|
||||||
// Cmd(BROWSER).detach();
|
Cmd(BROWSER).detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user