diff --git a/bar/bar1.conf b/bar/bar1.conf index 90bd47d..99afa94 100644 --- a/bar/bar1.conf +++ b/bar/bar1.conf @@ -48,13 +48,11 @@ interval=100 command=/home/simon/.i3/bar/src/mount_point_space.php root / format=json interval=5 -min_width=button=1 [mount_point_space_home] command=/home/simon/.i3/bar/src/mount_point_space.php home /home 90 95 format=json interval=5 -min_width=button=1 [memory] command=memory @@ -63,27 +61,31 @@ command=memory command=/home/simon/.i3/bar/src/spotify.php format=json 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] command=/home/simon/.i3/bar/src/app.php Y "xdg-open https://www.youtube.com/feed/subscriptions" '#f00' 0 format=json -interval=100 +interval=1000 [app_F] command=/home/simon/.i3/bar/src/app.php F "xdg-open https://www.facebook.com/" '#598df3' 0 format=json -interval=100 +interval=1000 [app_C] command=/home/simon/.i3/bar/src/app.php C "xdg-open https://choualbox.com/new" '#eeb819' 0 format=json -interval=100 +interval=1000 [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 +interval=1000 [volume] command=/home/simon/.i3/bar/src/volume.php @@ -100,13 +102,14 @@ command=/home/simon/.i3/bar/src/date.php format=json 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" min_width=button=1 align=left interval=30 +format=json [acpi] command=/home/simon/.i3/bar/src/acpi.php format=json -interval=1 +interval=20 diff --git a/bar/src/acpi.php b/bar/src/acpi.php index d7bb137..27fa6a2 100755 --- a/bar/src/acpi.php +++ b/bar/src/acpi.php @@ -9,7 +9,11 @@ if (!preg_match('`Discharging`', $acpi)) { preg_match('`([0-9]+%)`', $acpi, $values); if (!empty($values)) { - $charging = $values[1]; + $charging = (int) $values[1]; + + if ($charging === 100) { + return; + } if ($charging < 20) { $color = color('critical'); diff --git a/bar/src/base/block.php b/bar/src/base/block.php index aaec0d6..1216881 100644 --- a/bar/src/base/block.php +++ b/bar/src/base/block.php @@ -5,14 +5,13 @@ function color($label) $colors = [ 'music' => '#C3D4FF', 'date' => '#E9F1FF', - //'date' => '#ffffff', 'info' => '#E9F1FF', 'critical' => '#FF474A', 'warning' => '#FF6836', 'normal' => '#B3FF6C', ]; - return $colors[$label] ?? '#ffffff'; + return $colors[$label] ?? $colors['info']; } function block(string $name, array $options = []) diff --git a/bar/src/ip.php b/bar/src/ip.php index 30ab5e2..e64166c 100755 --- a/bar/src/ip.php +++ b/bar/src/ip.php @@ -7,7 +7,7 @@ $iface = $argv[1] ?? 'eth0'; $inet = ($argv[2] ?? 'inet').' '; $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($inet) ); @@ -22,7 +22,7 @@ $fullText = sprintf('[%s] %s', $iface, $ip); $shortText = sprintf('%s: %s', $iface, $ip); if (getenv('BLOCK_BUTTON') === '1') { - shell_exec('echo "'.escapeshellarg($ip).'" | xclip'); + shell_exec('echo '.escapeshellarg($ip).' | xclip'); } echo block( diff --git a/bar/src/rss.php b/bar/src/rss.php index ba9eeb6..a691770 100755 --- a/bar/src/rss.php +++ b/bar/src/rss.php @@ -18,7 +18,7 @@ if (empty($content)) { preg_match_all('/ $fullText, + 'color' => $count ? color('normal') : color('info'), + ] +);