mdr
This commit is contained in:
parent
2ecef69a8c
commit
ced98dd1c1
3 changed files with 51 additions and 4 deletions
|
|
@ -1,6 +1,3 @@
|
|||
interval=1
|
||||
color=#E9F1FF
|
||||
|
||||
[bandwidth_eth0]
|
||||
command=/home/simon/.i3/bar/src/bandwidth.php eth0
|
||||
format=json
|
||||
|
|
@ -68,6 +65,26 @@ format=json
|
|||
interval=1
|
||||
min_width=button=1
|
||||
|
||||
[app_Y]
|
||||
command=/home/simon/.i3/bar/src/app.php Y "xdg-open https://www.youtube.com/feed/subscriptions" '#f00' 0
|
||||
format=json
|
||||
interval=100
|
||||
|
||||
[app_F]
|
||||
command=/home/simon/.i3/bar/src/app.php F "xdg-open https://www.facebook.com/" '#598df3' 0
|
||||
format=json
|
||||
interval=100
|
||||
|
||||
[app_C]
|
||||
command=/home/simon/.i3/bar/src/app.php C "xdg-open https://choualbox.com/new" '#eeb819' 0
|
||||
format=json
|
||||
interval=100
|
||||
|
||||
[app_R]
|
||||
command=/home/simon/.i3/bar/src/app.php R "xdg-open https://redmine.like-inn-developpement.com/client" '#ff4e51'
|
||||
format=json
|
||||
interval=100
|
||||
|
||||
[volume]
|
||||
command=/home/simon/.i3/bar/src/volume.php
|
||||
format=json
|
||||
|
|
|
|||
30
bar/src/app.php
Executable file
30
bar/src/app.php
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
require __DIR__.'/base/block.php';
|
||||
|
||||
$name = $argv[1] ?? null;
|
||||
$app = $argv[2] ?? null;
|
||||
$color = $argv[3] ?? color('normal');
|
||||
$separator = (bool) ($argv[4] ?? true);
|
||||
|
||||
if (empty($name) && empty($app)) {
|
||||
die;
|
||||
}
|
||||
|
||||
$fullText = sprintf('[%s]', $name);
|
||||
|
||||
if (getenv('BLOCK_BUTTON') === '1') {
|
||||
pclose(popen($app, 'r'));
|
||||
}
|
||||
|
||||
echo block(
|
||||
'app_'.$name,
|
||||
[
|
||||
'full_text' => $fullText,
|
||||
'short_text' => $shortText,
|
||||
'color' => $color,
|
||||
'separator' => $separator,
|
||||
'separator_block_width' => $separator ? 20 : 0,
|
||||
]
|
||||
);
|
||||
|
|
@ -30,6 +30,6 @@ echo block(
|
|||
'bandwidth_'.$iface,
|
||||
[
|
||||
'full_text' => $fullText,
|
||||
'color' => color('info'),
|
||||
'color' => '#ffffff',
|
||||
]
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue