browser shortcut open or show
This commit is contained in:
@@ -144,23 +144,30 @@ extern "C"
|
||||
}
|
||||
|
||||
// Battery
|
||||
string charge, state;
|
||||
string charge;
|
||||
ifstream("/sys/class/power_supply/BAT0/capacity") >> charge;
|
||||
ifstream("/sys/class/power_supply/BAT0/status") >> state;
|
||||
|
||||
const char* remaining = "";
|
||||
if(state == "Discharging")
|
||||
if( !charge.empty() ) // If we have a charge we have a battery
|
||||
{
|
||||
new_stat += "🔋";
|
||||
remaining = battery_remaining("BAT0");
|
||||
}
|
||||
else
|
||||
new_stat += "🔌";
|
||||
string state;
|
||||
ifstream("/sys/class/power_supply/BAT0/status") >> state;
|
||||
|
||||
const char* remaining = "";
|
||||
if(state == "Discharging")
|
||||
{
|
||||
new_stat += "🔋";
|
||||
remaining = battery_remaining("BAT0");
|
||||
}
|
||||
else
|
||||
new_stat += "🔌";
|
||||
|
||||
|
||||
new_stat += charge;
|
||||
new_stat += "% ";
|
||||
new_stat += remaining;
|
||||
new_stat += ' ';
|
||||
}
|
||||
|
||||
new_stat += charge;
|
||||
new_stat += "% ";
|
||||
new_stat += remaining;
|
||||
new_stat += ' ';
|
||||
}
|
||||
catch(...){ cerr << "EXCEPT\n"; }
|
||||
|
||||
@@ -215,24 +222,23 @@ extern "C"
|
||||
}
|
||||
}
|
||||
|
||||
void vene_browser(const Arg* arg)
|
||||
void vene_browser(const Arg* browser_tag)
|
||||
{
|
||||
bool browser_tag_used = false;
|
||||
for(Client* c = selmon->clients; c; c = c->next)
|
||||
if(c->tags & 1<<8)
|
||||
if(c->tags & browser_tag->ui)
|
||||
{
|
||||
browser_tag_used = true;
|
||||
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