Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bitbar/SwiftBarをLinuxでも使いたい

 Bitbar/SwiftBarをLinuxでも使いたい

Kenichiro MATOHARA

January 23, 2021
Tweet

More Decks by Kenichiro MATOHARA

Other Decks in Technology

Transcript

  1. / $ apt --color moo moo 2>/dev/null | sed -e

    's/Have you mooed today?/Happy MOO Year!/' 2 / 36
  2. / 最近の発表 最近の発表 「 」 2020-12-26 「 」 2021-01-09 誰でもファイルアップロード

    鹿児島Linux勉強会 2020.12(オン ライン開催) VeraCryptをzuluCryptで 小江戸らぐ 1月のオフな集まり(第222 回) 4 / 36
  3. / BitBar/SwiftBar BitBar/SwiftBar PodcastのRebuild.fm 292回でBitBar, SwiftBar というツールバーに任意 のコマンドの結果を表示できるツールを知る macOS用 Linuxで動くものがないか探してみる

    Rebuild: 292: Two Chickens, One Stone (hak) GitHub - matryer/bitbar: Put the output from any script or program in your Mac OS X Menu Bar SwiftBar https://nitter.net/matoken1/status/1344632867100364801 6 / 36
  4. / BitBar/SwiftBar Alternative BitBar/SwiftBar Alternative 現環境はAwesome wmなのでどれも動かなさそう(◞‸◟) GitHub - p-e-w/argos:

    Create GNOME Shell extensions in seconds GitHub - lipido/kargos: KDE Plasma port of GNOME Argos and OSX BitBar GitHub - ssimono/margos: Create Mate applets from your script output 7 / 36
  5. / 日本語や記号の問題 日本語や記号の問題 ⚡ 21時/84% と表示したいところの 時 部分が ? になり,

    % が消え てしまった 絵文字がOKで日本語がNGなパターンは初めて見た気がする  タイミングによりうまく動かないのに気づいた>< echo -n ⚡ $((`date +%H`-1))時/; \ curl -s https://www.kyuden.co.jp/td_power_usages/csv/juyo-hourly-`date +%Y%m%d`.csv | \ head -38 | tail -24 | grep ,$(( `date +%H` -1 )):00 | cut -z -d, -f5;echo % 13 / 36
  6. / パイプ等を使うと動かない パイプ等を使うと動かない | でつないだりするとうまく動かない sh -c "command1 | command2"

    のようにsh経由で動かすとOK ファイルに書き出してそれを指定したほうがいい? 14 / 36
  7. / Argos導入 Argos導入 ブラウザから導入もしくは手動でダウンロードして展開 ダウンロード時はGnome shellのバージョンを求められる Gnome Shellバージョン確認 手動での導入 Alt+F2

    r↲ でGnome Shellを再起動して反映 Argos - GNOME Shell 拡張機能 $ gnome-shell --version GNOME Shell 3.38.3 $ mkdir -p ~/.local/share/gnome-shell/extensions $ unzip ./argospew.worldwidemann.com.v3.shell-extension.zip \ -d ~/.local/share/gnome-shell/extensions/[email protected]/ 17 / 36
  8. / Gnome Shellが新しいとうまく動 Gnome Shellが新しいとうまく動 かない かない ステータスバーには現れるがクリックしてもウィンドウが開かな い Gnome

    Shellが新しいとこうなるらしい(3.36+?今回は3.38.3) Gitリポジトリのmasterと以下のPRのpatchを利用して動作 Argos menus won’t open on Ubuntu 20.04 - Is it a known issue? · Issue #120 · p-e-w/argos · GitHub Use registerClass to make plugin compatible with gnome 3.36. by rammie · Pull Request #111 · p-e-w/argos · GitHub 18 / 36
  9. / GitのmasterとPR適用 GitのmasterとPR適用 1 リポジトリclone 2 拡張機能コピー 3 Gnome Shell

    3.36+向けの修正を適用 Alt+F2 r↲ でGnome Shellを再起動して反映 $ git clone https://github.com/p-e-w/argos $ cd argos $ cp -r ./[email protected] \ ~/.local/share/gnome-shell/extensions/ $ wget https://raw.githubusercontent.com/p-e-w/argos/c4663d9d3e29ef33b7e9123ef0c09581 -O ~/.local/share/gnome-shell/extensions/[email protected]/menuitem.js 1 2 3 21 / 36
  10. / Argos.sh Argos.sh #!/usr/bin/env bash URL="github.com/p-e-w/argos" DIR=$(dirname "$0") echo "Argos"

    echo "---" echo "$URL | iconName=help-faq-symbolic href='https://$URL'" echo "$DIR | iconName=folder-symbolic href='file://$DIR'" 23 / 36
  11. / Argos Plugin Argos Plugin ~/.config/argos/ に実行可能プラグラムやスクリプトを置くと 即実行される STDOUT出力結果1行目がバーに表示され,--- の後がウィンドウ

    内に表示される インターバルはファイル名で制御 hoge.3s+.sh #3秒毎に実行 fuga.10m+.py #10分毎に実行 色を付けたりアイコンを設定したり…… 24 / 36
  12. / ~/.config/argos/wego.1h+.sh #!/bin/bash STR=`wego -d 2 -f emoji` echo "`echo

    "${STR}" | head -4 | tail -1`" echo "---" echo "${STR}" | awk 1 ORS="\\\\n" echo " | font=monospace" 26 / 36
  13. / ~/.config/argos/cputhermal.1m+.sh ※色が変更できない? #!/bin/bash THERMAL=`acpi -t | awk '{print $4}'`

    COLOR="white" if [ `echo "${THERMAL} >= 80" | bc` == 1 ] ; then COLOR="red" fi #echo "<span color='${COLOR}' weight='normal'><tt> ${THERMAL}℃ </tt></span>" echo " ${THERMAL}℃ | color=${COLOR}" echo "---" if [ "${ARGOS_MENU_OPEN}" == "true" ]; then TOP_OUTPUT=$(top -b -n 1 | head -n 20 | awk 1 ORS="\\\\n") echo "${TOP_OUTPUT} | font=monospace bash=top" else echo "Loading..." fi 28 / 36
  14. / Kargos Kargos KDE Plasma向け 動作未確認 ちょい古そう GitHub - lipido/kargos:

    KDE Plasma port of GNOME Argos and OSX BitBar A Plasma port of Argos and BitBar plugins to fast create custom plasmoids. Note: This is an alpha project. By now, it only was tested on Kubuntu 16.04 LTS. 32 / 36
  15. / 奥付 奥付 発表 2021-01-23(sat) 発表者 ライセンス CC BY-NC-SA 4.0

    東海道らぐ あひる焼きさんのライトニングトークダービー! Kenichiro Matohara(matoken) 36 / 36