evolutions
This commit is contained in:
parent
ced98dd1c1
commit
b9e4a512a7
|
@ -48,13 +48,11 @@ interval=100
|
||||||
command=/home/simon/.i3/bar/src/mount_point_space.php root /
|
command=/home/simon/.i3/bar/src/mount_point_space.php root /
|
||||||
format=json
|
format=json
|
||||||
interval=5
|
interval=5
|
||||||
min_width=button=1
|
|
||||||
|
|
||||||
[mount_point_space_home]
|
[mount_point_space_home]
|
||||||
command=/home/simon/.i3/bar/src/mount_point_space.php home /home 90 95
|
command=/home/simon/.i3/bar/src/mount_point_space.php home /home 90 95
|
||||||
format=json
|
format=json
|
||||||
interval=5
|
interval=5
|
||||||
min_width=button=1
|
|
||||||
|
|
||||||
[memory]
|
[memory]
|
||||||
command=memory
|
command=memory
|
||||||
|
@ -63,27 +61,31 @@ command=memory
|
||||||
command=/home/simon/.i3/bar/src/spotify.php
|
command=/home/simon/.i3/bar/src/spotify.php
|
||||||
format=json
|
format=json
|
||||||
interval=1
|
interval=1
|
||||||
min_width=button=1
|
|
||||||
|
[app_S]
|
||||||
|
command=/home/simon/.i3/bar/src/app.php S "i3-msg workspace '6. MEDIA'" '#1db954' 0
|
||||||
|
format=json
|
||||||
|
interval=1000
|
||||||
|
|
||||||
[app_Y]
|
[app_Y]
|
||||||
command=/home/simon/.i3/bar/src/app.php Y "xdg-open https://www.youtube.com/feed/subscriptions" '#f00' 0
|
command=/home/simon/.i3/bar/src/app.php Y "xdg-open https://www.youtube.com/feed/subscriptions" '#f00' 0
|
||||||
format=json
|
format=json
|
||||||
interval=100
|
interval=1000
|
||||||
|
|
||||||
[app_F]
|
[app_F]
|
||||||
command=/home/simon/.i3/bar/src/app.php F "xdg-open https://www.facebook.com/" '#598df3' 0
|
command=/home/simon/.i3/bar/src/app.php F "xdg-open https://www.facebook.com/" '#598df3' 0
|
||||||
format=json
|
format=json
|
||||||
interval=100
|
interval=1000
|
||||||
|
|
||||||
[app_C]
|
[app_C]
|
||||||
command=/home/simon/.i3/bar/src/app.php C "xdg-open https://choualbox.com/new" '#eeb819' 0
|
command=/home/simon/.i3/bar/src/app.php C "xdg-open https://choualbox.com/new" '#eeb819' 0
|
||||||
format=json
|
format=json
|
||||||
interval=100
|
interval=1000
|
||||||
|
|
||||||
[app_R]
|
[app_R]
|
||||||
command=/home/simon/.i3/bar/src/app.php R "xdg-open https://redmine.like-inn-developpement.com/client" '#ff4e51'
|
command=/home/simon/.i3/bar/src/app.php R "xdg-open https://redmine.like-inn-developpement.com/client" '#ff4e51'
|
||||||
format=json
|
format=json
|
||||||
interval=100
|
interval=1000
|
||||||
|
|
||||||
[volume]
|
[volume]
|
||||||
command=/home/simon/.i3/bar/src/volume.php
|
command=/home/simon/.i3/bar/src/volume.php
|
||||||
|
@ -100,13 +102,14 @@ command=/home/simon/.i3/bar/src/date.php
|
||||||
format=json
|
format=json
|
||||||
interval=30
|
interval=30
|
||||||
|
|
||||||
[ttr_news]
|
[rss]
|
||||||
command=/home/simon/.i3/bar/src/rss.php "https://tiny.deblan.org/public.php?op=rss&id=-3&key=17c659af1ad27f30941a724fcf48421d1e83081a" "RSS"
|
command=/home/simon/.i3/bar/src/rss.php "https://tiny.deblan.org/public.php?op=rss&id=-3&key=17c659af1ad27f30941a724fcf48421d1e83081a" "RSS"
|
||||||
min_width=button=1
|
min_width=button=1
|
||||||
align=left
|
align=left
|
||||||
interval=30
|
interval=30
|
||||||
|
format=json
|
||||||
|
|
||||||
[acpi]
|
[acpi]
|
||||||
command=/home/simon/.i3/bar/src/acpi.php
|
command=/home/simon/.i3/bar/src/acpi.php
|
||||||
format=json
|
format=json
|
||||||
interval=1
|
interval=20
|
||||||
|
|
|
@ -9,7 +9,11 @@ if (!preg_match('`Discharging`', $acpi)) {
|
||||||
preg_match('`([0-9]+%)`', $acpi, $values);
|
preg_match('`([0-9]+%)`', $acpi, $values);
|
||||||
|
|
||||||
if (!empty($values)) {
|
if (!empty($values)) {
|
||||||
$charging = $values[1];
|
$charging = (int) $values[1];
|
||||||
|
|
||||||
|
if ($charging === 100) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($charging < 20) {
|
if ($charging < 20) {
|
||||||
$color = color('critical');
|
$color = color('critical');
|
||||||
|
|
|
@ -5,14 +5,13 @@ function color($label)
|
||||||
$colors = [
|
$colors = [
|
||||||
'music' => '#C3D4FF',
|
'music' => '#C3D4FF',
|
||||||
'date' => '#E9F1FF',
|
'date' => '#E9F1FF',
|
||||||
//'date' => '#ffffff',
|
|
||||||
'info' => '#E9F1FF',
|
'info' => '#E9F1FF',
|
||||||
'critical' => '#FF474A',
|
'critical' => '#FF474A',
|
||||||
'warning' => '#FF6836',
|
'warning' => '#FF6836',
|
||||||
'normal' => '#B3FF6C',
|
'normal' => '#B3FF6C',
|
||||||
];
|
];
|
||||||
|
|
||||||
return $colors[$label] ?? '#ffffff';
|
return $colors[$label] ?? $colors['info'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function block(string $name, array $options = [])
|
function block(string $name, array $options = [])
|
||||||
|
|
|
@ -7,7 +7,7 @@ $iface = $argv[1] ?? 'eth0';
|
||||||
$inet = ($argv[2] ?? 'inet').' ';
|
$inet = ($argv[2] ?? 'inet').' ';
|
||||||
|
|
||||||
$command = sprintf(
|
$command = sprintf(
|
||||||
'ip address show %s | grep %s | awk \'{ print $2 }\'',
|
'ip address show %s | grep %s | awk \'{ print $2 }\' | cut -d/ -f1',
|
||||||
escapeshellarg($iface),
|
escapeshellarg($iface),
|
||||||
escapeshellarg($inet)
|
escapeshellarg($inet)
|
||||||
);
|
);
|
||||||
|
@ -22,7 +22,7 @@ $fullText = sprintf('[%s] %s', $iface, $ip);
|
||||||
$shortText = sprintf('%s: %s', $iface, $ip);
|
$shortText = sprintf('%s: %s', $iface, $ip);
|
||||||
|
|
||||||
if (getenv('BLOCK_BUTTON') === '1') {
|
if (getenv('BLOCK_BUTTON') === '1') {
|
||||||
shell_exec('echo "'.escapeshellarg($ip).'" | xclip');
|
shell_exec('echo '.escapeshellarg($ip).' | xclip');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo block(
|
echo block(
|
||||||
|
|
|
@ -18,7 +18,7 @@ if (empty($content)) {
|
||||||
|
|
||||||
preg_match_all('/<entry/isU', $content, $matches, PREG_SET_ORDER);
|
preg_match_all('/<entry/isU', $content, $matches, PREG_SET_ORDER);
|
||||||
|
|
||||||
$fullText = sprintf('[%s] %s', $title, count($matches));
|
$fullText = sprintf('[%s] %s', $title, $count = count($matches));
|
||||||
|
|
||||||
$blockButton = (int) getenv('BLOCK_BUTTON');
|
$blockButton = (int) getenv('BLOCK_BUTTON');
|
||||||
|
|
||||||
|
@ -26,4 +26,10 @@ if ($blockButton === 1) {
|
||||||
shell_exec('xdg-open https://tiny.deblan.org/index.php');
|
shell_exec('xdg-open https://tiny.deblan.org/index.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $fullText;
|
echo block(
|
||||||
|
'rss',
|
||||||
|
[
|
||||||
|
'full_text' => $fullText,
|
||||||
|
'color' => $count ? color('normal') : color('info'),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue