├── .github └── FUNDING.yml ├── .gitignore ├── .jshintrc ├── .rubocop.yml ├── .test.py ├── .travis.yml ├── AWS ├── asg-status.5m.sh ├── awsmonthcost.1h.sh ├── cloudwatch-alarms.30s.py ├── ec2-start-stop.1h.sh ├── ecs-cluster.10m.sh ├── elb.30s.sh ├── pipeline-status.1m.py ├── profile-changer.1s.sh └── sqs-status.1m.sh ├── CONTRIBUTING.md ├── Cloud ├── GCP │ └── gcp-project-switcher.1d.sh └── scaleway.sh ├── Cryptocurrency ├── 99-crypto.py ├── Bitcoin │ ├── bitcoin.de │ │ └── last.30s.sh │ ├── bitfinex.com │ │ ├── bitfinex_all.sh │ │ └── bitfinex_btcusd.sh │ ├── bitoex.com │ │ └── bitoex-buy-and-sell.10s.sh │ ├── bitstamp.net │ │ └── last.10s.sh │ ├── bitx.co │ │ └── buy-and-sell.1m.py │ ├── blocktime.10s.sh │ ├── btc.5m.sh │ ├── coinbase.com │ │ ├── accounts.1h.rb │ │ ├── balance.1h.sh │ │ ├── buy-and-sell.10s.sh │ │ ├── buy.10s.sh │ │ ├── sell.10s.sh │ │ ├── spot-buy-and-sell.1m.sh │ │ └── spotrate.10s.sh │ ├── coinmarketcap.com │ │ ├── btc-gbp.py │ │ └── btc-usd.py │ ├── coinone.co.kr │ │ └── coinone.15s.py │ ├── huobi.com │ │ └── huobiprice.1s.py │ ├── mayer-multiple.sh │ ├── mempool.sh │ ├── tr-markets.1m.py │ └── winkdex.com │ │ └── winkdex.1m.sh ├── Blackcoin │ ├── blk-gbp.py │ └── blk-usd.py ├── CoinbaseBuy.1m.rkt ├── CoinbasePrices.sh ├── CryptoPrices.5m.sh ├── Dash │ ├── dash-coincap-binance.5m.sh │ └── dash-coincap-poloniex.5m.sh ├── Dogecoin │ ├── doge-gbp.py │ └── doge-usd.py ├── Ethereum │ ├── eth-gbp.py │ ├── eth-usd.1s.py │ ├── eth.5m.sh │ ├── eth_all_in_one.5s.sh │ ├── eth_basefee.30s.sh │ ├── eth_gas_widget.10m.rb │ ├── eth_wallet_balances.1m.py │ ├── ethbtc.sh │ ├── ether-eur-kraken.30s.sh │ ├── ethgas.1m.sh │ ├── ethminer.5s.py │ ├── ethusd.1m.sh │ └── gasnow.10s.sh ├── Helium │ └── helium-hotspot-rewards.15m.js ├── Lisk │ ├── lsk-gbp.py │ ├── lsk-usd.py │ └── lskbtc.sh ├── Litecoin │ ├── ltc-gbp.py │ ├── ltc-usd.1s.py │ └── ltc.5m.sh ├── Monero │ ├── monero-btc-bitfinex.30s.sh │ ├── monero-btc-kraken.30s.sh │ ├── monero-btc-poloniex.30s.sh │ ├── monero-cny-bter.30s.sh │ ├── monero-usd-bitfinex.30s.sh │ ├── monero-usd-kraken.30s.sh │ └── monero-usd-poloniex.30s.sh ├── Polygon │ └── polygon_gas_widget.10m.rb ├── Ripple │ ├── xrp-gbp.py │ ├── xrp-usd.py │ └── xrpusd.1m.sh ├── Solana │ └── Solana_Price_Ticker.30s.py ├── SurBTC-Ticker.10m.sh ├── Vertcoin │ ├── vtc-btc-bittrex.30s.sh │ └── vtc-btc-bittrex_detail.30s.sh ├── binance-ticker.6s.py ├── bitso-btc-eth-xrp.30s.sh ├── bitso-prices.10s.sh ├── btcmarkets.10s.sh ├── c20.py ├── cardano.10s.py ├── coin-alert.5s.sh ├── coincap.1m.py ├── coincaplite.1m.py ├── coinmarketcap.30m.py ├── cryptocompare-portfolio.1m.rb ├── decred-btc-poloniex.30s.sh ├── garlicoin.1m.sh ├── guild.1m.py ├── mempool.space ├── miner_stat_fetch.1m.py ├── nomics_bitbar.py ├── okx_ticker.10s.py └── slushpool.5m.js ├── Dev ├── Acquia │ ├── .INSTALL.md │ ├── .acquia-includes.php │ ├── 001-acquia-list-apps.1h.php │ └── 001-acquia-list-ides.1h.php ├── AzureDevOps │ └── build-status.1m.js ├── Buildkite │ └── buildkite.1m.sh ├── Codeship │ ├── codeship-single.30s.py │ ├── codeship.1m.js │ └── codeship.1m.py ├── Docker │ ├── docker-disk.1m.sh │ ├── docker-stats.10s.sh │ ├── docker-status.1m.sh │ ├── docker-sync-status.1m.sh │ └── numContainers.5s.sh ├── Git │ ├── DevStatus.10m.sh │ ├── daily-standup.sh │ ├── get_pull_requests_bitbar.1h.rb │ └── gitfinderinfo.1s.sh ├── GitHub │ ├── gh.5m.js │ ├── github-ci.1m.php │ ├── github-contribution.10m.rb │ ├── github-pr-buddy.30m.py │ ├── github-release-buddy.30m.py │ ├── github-review-requests-TS-5m.ts │ ├── github-review-requests.5m.py │ ├── github-trending.1h.rb │ ├── github_status.10m.py │ ├── github_watch.1h.rb │ ├── github_work_list.1m.mjs │ ├── merge-freeze.5m.rb │ ├── notifications.30s.py │ ├── prnotii.5m.js │ ├── pull-requests.5m.js │ ├── repo-issues.5m.js │ └── swift-trending.15m.swift ├── Gitlab │ ├── gitlab-ci-status.5s.sh │ ├── gitlab_ci.1m.py │ ├── gitlab_glance.15m.py │ ├── gitlab_merge_requests.1m.js │ ├── gitlab_projects.js │ └── gitlab_status.10m.sh ├── Homebrew │ ├── brew-services.10m.rb │ └── brew-updates.1h.rb ├── Hosting │ ├── DigitalOcean │ │ └── digitalocean.1h.js │ ├── Heroku │ │ ├── heroku.1m.rb │ │ ├── herokuappserrors.1h.rb │ │ └── listapps.5m.sh │ └── Linode │ │ └── Linode.5m.php ├── Jenkins │ ├── jenkins-agent-status.5m.sh │ ├── jenkins-all-jobs.status.1m.py │ ├── jenkins-latest-build-status.1m.rb │ ├── jenkins-multiple-projects-status.1m.sh │ └── jenkins-status.1m.sh ├── Jira │ ├── jira-issues.10m.py │ └── jira.1m.sh ├── Kaiten │ └── kaiten-dashboard.5m.sh ├── Kubernetes │ ├── k-get-pods.30s.sh │ ├── kubecontext.1s.py │ ├── kubeswitcher.1m.sh │ └── minikube.5s.sh ├── Nagios │ ├── nagios.30s.sh │ └── thruk.py ├── NugetDownloadCount.5h.py ├── PID │ └── pidkiller.sh ├── Pastebin │ └── pastebin.3m.sh ├── PhpStormXdebugStatus.3s.sh ├── Shell │ ├── aka.1h.sh │ └── run-fastlane.rb ├── SshMenu.sh ├── Tutorial │ ├── alternate_options.sh │ ├── ansi.sh │ ├── config.sh │ ├── cycle_text_and_detail.sh │ ├── emoji.sh │ ├── images.sh │ ├── is_bitbar.sh │ ├── is_darkmode.sh │ ├── refresh.sh │ └── submenus.sh ├── Vagrant │ ├── vagrant.2m.pl │ └── vagrant.30s.pl ├── Wakatime │ └── wakatime.1m.js ├── appcenter-status.1m.rb ├── average_app_store_review_times.1h.rb ├── backlog-show-my-task.1m.rb ├── bamboo_build_status.1m.sh ├── buildbot9_status.py ├── checkRedisMemory.sh ├── checkman.10s.rb ├── circleci-check.5m.py ├── cloudflare.1m.js ├── clubhouse.rb ├── colima-status.2s.sh ├── colima.10s.sh ├── drone-status.1m.sh ├── emacs-package-updates.1h.sh ├── gerrit_incoming_crs.5m.py ├── getopenPRs.10m.sh ├── git_python.5m.py ├── gogs-issues.5m.js ├── gosquared-now.30s.py ├── gulpLauncher.1h.js ├── icinga2-status.py ├── icinga2.24m.py ├── ips.30s.sh ├── lightsalmon.12h.sh ├── mac-mux.sh ├── machinebox.1m.sh ├── meta_package_manager.7h.py ├── noti.1m.py ├── ntl-site-status.1m.js ├── pantheon-list-sites.1h.php ├── podman.5s.sh ├── process-monitoring.1s.sh ├── project-list.5m.js ├── rabbitmq-status.1m.php ├── redmine-show-my-task.1m.rb ├── rescuetime.1h.py ├── sentry.5m.js ├── servicemonitor.1m.py ├── stash-pull-requests.2m.rb ├── tail.5s.sh ├── totp.20s.sh ├── travis-check.2m.py ├── uptimekuma.30s.py ├── utimerobot.30s.py ├── vigil-check.5m.js ├── virtualbox-running_vms.30s.rb ├── vso-pull-requests.1m.js └── xcode-version.1h.sh ├── E-Commerce ├── Shopibar.15m.js └── nvidia.3m.py ├── Email ├── gmail-checker-improved.1m.pl ├── gmail-checker.sh ├── imap.1m.rb ├── mu-email-checker.sh ├── notmuch-mail-count.30s.rb ├── offlineimap-notification.1s.py ├── simple-gmail-checker.sh ├── simple-mail-checker.1m.py └── unread.1m.sh ├── Enabled └── .gitignore ├── Environment ├── CO2-Signal.10m.py ├── carbon-intensity.15m.js ├── carbon-intensity.1h.js ├── conda-envs.15m.py ├── corona.1h.sh ├── covid-19_stats.15m.sh ├── covid-19_today.15m.sh ├── electricitymaps.5m.py ├── quake.1m.sh └── solaredge.5m.py ├── Finance ├── 001-options.1h.go ├── awin-sales.60s.py ├── dolar_blue.5m.py ├── exchange-rates.5m.sh ├── ginmon.1d.sh ├── hours.1m.py ├── mintable.1h.zsh ├── moex.1m.rb ├── precious-metals.1h.php ├── rbc.10m.sh ├── robinhood.1m.py ├── robinhood2.1m.py ├── shiller-pe.4h.sh ├── stock-ticker.30s.py ├── stock.5s.sh ├── teller-track-spending.1h.sh ├── transferwise-currency-tracker.1m.py └── yahoo_stock_ticker.10m.py ├── Games ├── baj.2m.sh ├── bgo.2m.sh ├── jackpot.6h.py ├── minecraftplayers.1m.py ├── riggedCoinFlip.1h.sh ├── steam-dashboard.1m.sh ├── wordle.py └── xboxfeed.10m.js ├── Google └── gcloud-start-stop.10m.sh ├── IoT ├── BMWcharge.15m.py ├── evcc.10s.rb ├── homebridge.10s.py └── wled.1m.js ├── Lifestyle ├── SaveToLinkPack.1h.rb ├── Things │ ├── thingsdoingnow.10s.sh │ ├── thingsinbox.6s.sh │ └── thingstoday.6s.sh ├── Todo │ ├── NotePlan3.15m.rb │ ├── noteplan-menubar-56px.b64 │ ├── todo-md.30s.pl │ ├── todo.15m.rb │ ├── todo.30s.sh │ └── todoNotePlan.15m.rb ├── Trello │ ├── trello_board.30s.py │ └── trello_notifications.15m.sh ├── USCIS_CaseStatusUpdates.15m.sh ├── ZoomsToday │ ├── open-zoom.sh │ └── zooms-today.1h.sh ├── bear-calls.sh ├── brewfather-batch-status.15m.js ├── church-liturgical-calendar.1h.sh ├── current_task.1m.rb ├── dadjokes.5m.sh ├── deathTimer.5m.py ├── digital-zeitgebers.30m.py ├── fortune.5m.sh ├── githubzen.1m.py ├── habitica.1h.js ├── iss.1m.sh ├── journal.sh ├── librelinkup.1m.py ├── memento_mori.py ├── moon-phase.1h.js ├── muezzin.5m.sh ├── nightscout.1m.sh ├── org-agenda.30m.rb ├── qurandaily.1d.py ├── random_quotes.5m.sh ├── sleepingtime.1m.sh ├── smile.12h.sh ├── sureflap.15s.rb ├── syncthing-conflicts.10m.py ├── syncthing.10s.sh ├── taskpaper.10s.py ├── taskpaper_current_task.29s.py ├── taskwarrior.4m.py ├── tescomobileirl.1h.py ├── text_on_menubar.1h.py ├── time_on_earth.10m.rb ├── todoist.1m.py ├── track-correios-packages.1h.js ├── transmission.4m.py ├── unsplash-background.3h.sh ├── votd.1d.rb ├── wallpaperbing.1h.sh ├── write-into-menubar-bitbar-plugin.1s.sh ├── zoom-avs-status.1s.scpt ├── zoom_mute.3s.sh ├── zoom_onair.15s.py └── zoom_shortcuts.1d.sh ├── Music ├── airconnect.1d.sh ├── bbitunes.10s.sh ├── check-lms.10s.pl ├── cmus.10s.sh ├── fip.1m.sh ├── itunes.10s.sh ├── itunesRating.10s.sh ├── ksing.1d.py ├── lastfm.10s.rb ├── mpd-control.20s.sh ├── music-controls-info.10s.sh ├── music-controls-like.10s.sh ├── music-controls-next.10s.sh ├── music-controls-playpause.10s.sh ├── music-controls-previous.10s.sh ├── music.10s.sh ├── musicRating.10s.sh ├── nowplaying.5s.sh ├── pianobarctl.15s.sh ├── plex-status-improved-30s.py ├── plex-status.1m.sh ├── quodlibet-control.1s.py ├── songkick.1d.py ├── sonosBar.py ├── spotctl.10s.sh ├── spotify-next.1d.sh ├── spotify-pause.9999d.sh ├── spotify.10s.sh ├── swinsian.10s.sh └── vox.30s.sh ├── Network ├── 001-bandwidth_KBps_MBps.1s.sh ├── SSH-Remotes.1d.sh ├── TRIPPing.1h.sh ├── aria2.3s.py ├── aria2.sh ├── bandwidth-test-min.2h.sh ├── bandwidth-test.2h.sh ├── bandwidth.1s.py ├── bandwidth.1s.sh ├── bandwidth_all.1s.sh ├── bandwidth_primary.1s.sh ├── bandwidth_total.2s.lua ├── bitping.10s.sh ├── bluetooth_connection.5s.sh ├── checkhosts.1m.go ├── dnscrypt-proxy-switcher.10s.sh ├── dnsswitcher.1d.sh ├── emoji-active-network-interface.sh ├── external-ip-1.0.1h.sh ├── external-ip.1h.sh ├── got-internet.2s.sh ├── iCloud-Private-Relay-Status.6m.sh ├── iTermSshMenu.sh ├── internal-ip.1h.sh ├── internet-status.2s.sh ├── ip-flag.2m.rb ├── isccond.5m.sh ├── mrd-quick-connect.5s.js ├── mullvad-vpn-status.5m.sh ├── netinfo.60s.sh ├── netstats.5s.sh ├── network-latency.5s.py ├── network-location.1h.sh ├── network-toggler.sh ├── nord-vpn-status.js ├── openfortivpn.sh ├── openvpn.5m.sh ├── pi-hole.10m.py ├── pia-vpn-status.5m.sh ├── ping.10s.sh ├── pivpn.1m.php ├── protonvpn.15m.py ├── proxy_status.5s.sh ├── sbcdash-client.1h.py ├── sent-received.1s.sh ├── simple-latency.11s.sh ├── ssh-status.10min.sh ├── ssh-tunnel.1s.sh ├── ssh.sh ├── ssid_info.sh ├── tor.2s.sh ├── uRadMonitor2.30s.sh ├── umbrella_status.15m.sh ├── updatevpnbookpass.1d.sh ├── viscosity-active-connection.1s.sh ├── vnc_short.1d.sh ├── vpn-check.3s.sh ├── vpn-country-flag.js ├── vpn-next.2s.sh ├── vpn_advanced.sh ├── w06_transfer.10s.rb ├── wakeonlan.sh ├── website-status.sh ├── wifi-toggle-by-lid.sh ├── wifiname.sh ├── wifisignal.sh ├── wireguard.sh └── zerotier-status.1s.py ├── Politics ├── PredictIt.sh ├── congress.1h.R ├── five-thirty-eight.15m.rb └── parliament.uk-count.5m.py ├── README.md ├── Science ├── apod.1h.py ├── fah-score.1m.py ├── people-in-space.6h.js └── pubmed.py ├── Sports ├── F1.1s.py ├── SpursBar.6h.rb ├── bundesliga.1h.py ├── cricket_bar.1m.php ├── crossfit-regionals.1d.sh ├── fcbarcelona-dk.1h.py ├── live_cricket.2m.py ├── live_nba.1m.py ├── live_tennis.1m.py ├── worldcup.1m.php └── your-team-soccer-matches.10m.js ├── System ├── AirPodsPower.sh ├── Battery │ ├── battery-dot.1h.swift │ ├── battery_cycles.12h.sh │ ├── keyboard-system_profiler.1m.rb │ ├── keyboard.1m.sh │ ├── lowbatterymode.1h.sh │ ├── mAh.10s.sh │ ├── mouse.1m.sh │ ├── trackpad-system_profiler.1m.rb │ └── trackpad.1m.sh ├── ColorfulBatteryLevel.5s.sh ├── DarkModeToggle.sh ├── Day-Night-Color-Profile-Selector.15s.sh ├── DoNotDisturb.1s.py ├── HandoffToggle.1d.sh ├── MicToggle.1s.sh ├── Screenshotter.1d.sh ├── WhereAmI.48h.sh ├── Yubikey.30m.sh ├── ad-pass-expiry.sh ├── adminCheck.1m.sh ├── app_use_cpu.1m.sh ├── appearance-options.1d.sh ├── arp-spoof-detector.sh ├── battery_estimator.5s.sh ├── battery_health.2s.py ├── bluetooth_inspector.10m.rb ├── caffeinate.10h.sh ├── caffeinate.1h.sh ├── clipboard-base64-encoder.sh ├── clipboard-history.3s.sh ├── copy-ssh-keys.sh ├── copy-to-clipboard.sh ├── cpu-high-usage.5s.py ├── cpu-load.5s.sh ├── cpu-thermal-throttle.30s.sh ├── cpu-usage-kill.5s.sh ├── currentFiles.1h.rb ├── deleteVSCodeTemp.sh ├── disk-read-write.1s.sh ├── diskAvailable.sh ├── downloads.1h.sh ├── ejector.5s.sh ├── emacs.24h.sh ├── fan_speed.5s.js ├── firewall.10m.sh ├── firewall_status_indicator.10s.sh ├── getComputerInfo.sh ├── host-switcher.1d.sh ├── infinit-drive.10s.py ├── keyboard-symbol.py ├── killdock.1d.sh ├── lastpass.py ├── launch-agents.10s.sh ├── load_temp_fan.10s.sh ├── lock-screen.10h.sh ├── macos-proxy-switcher.1m.sh ├── macosnightshift.1h.sh ├── mas.1d.sh ├── mdf.1m.sh ├── memory_pressure.20s.py ├── memusage.5s.py ├── mfa-yubikey.1d.sh ├── microphone.sh ├── mtop.5s.sh ├── mysql-status.1m.sh ├── ntfs.1d.sh ├── pmset.5m.sh ├── postgresql-status.1m.sh ├── power-wattage-advanced.30m.sh ├── power_status.15s.sh ├── power_wattage.30s.sh ├── quickfolders.10m.sh ├── ram-load.5s.py ├── real-cpu-usage-chart.10s.sh ├── real-cpu-usage.10s.sh ├── rebootreminder.1h.sh ├── recent-apps.10s.py ├── redis-memcached.10s.sh ├── samplerate.sh ├── screenshot.1d.py ├── secure-totp.sh ├── show-hide-desktop-icons.1h.py ├── showdotfiles.2m.sh ├── showhide-files.1d.py ├── swap-usage.1m.sh ├── systeminfo.1s.sh ├── timemachine.2m.rb ├── top5-memory-consuming-processes.sh ├── totp.30s.sh ├── trackpad-dot.1h.swift ├── trash-collector.5s.sh ├── umbrella.5s.sh ├── unmount.10.js ├── uptime.1m.sh ├── uptime.5m.sh ├── usbInfo.10s.py ├── virtualbox-vms.5s.sh ├── webpack-status.1s.sh └── wkma.5s.sh ├── Time ├── CalendarLite.1m.sh ├── DayAndNightClock.sh ├── ProcessBarOfYear.1d.sh ├── WorldTimeGrid.10s.py ├── age-clock.py ├── age-ticker.1s.py ├── aideadlines.15m.py ├── alarmclock.1s.sh ├── beats.1s.lisp ├── cal.1d.sh ├── countdown.1s.py ├── countdown_timer.1s.rb ├── countdown_timer_2.1s.py ├── date-picker.1m.sh ├── ddate.30m.js ├── epoch.60s.sh ├── fuzzyclock.1s.py ├── googlecal.30m.js ├── itstimeto.15m.py ├── lapse.30m.sh ├── persiandate.1m.sh ├── pomodoro.1s.sh ├── pomodoro2.30s.sh ├── prayer-time.1m.py ├── productivitycountdowns.1h.sh ├── progress-procrastination.15s.sh ├── progress.1h.sh ├── rescuetime-activities.3m.py ├── solar-time.1s.py ├── spent_time.1s.py ├── stopwatch.1s.sh ├── sunrise.4h.swift ├── switchtimezones.5s.sh ├── timetable.1m.py ├── timezone.5s.sh ├── timezonesplus.30s.sh ├── toggl.10m.sh ├── ts-convert.sh ├── unixtime.5s.sh ├── waketime.1m.sh ├── watson.1m.sh ├── weeknumber.1m.sh ├── worktime-tracker.1s.rb └── worldclock.1s.sh ├── Tools ├── BitBar │ ├── bitbar-plugin-installer.1d.php │ └── version.12h.rb ├── JsonUtils.1d.sh ├── PagerDuty │ ├── pagerDutyIncidents.30s.js │ ├── pagerDutyOnCall.30s.js │ ├── pagerduty.30s.rb │ └── pagerduty_incidents.1m.sh ├── Slack │ ├── slack-multi-teams.1m.rb │ ├── slack-status.sh │ ├── slack-team-notifications.1m.js │ └── slack-unread.1s.py ├── addnote.5s.py ├── aerospace-viewer.5s.sh ├── aggregator.5m.sh ├── bitbarDockerContainers.1m.py ├── catchpoint.m5.php ├── chunkwm_skhd.1s.sh ├── clipboard_bar.1d.php ├── cryptbar.5m.sh ├── desktop_cleaner.rb ├── dev-toolbox.1h.sh ├── keybase-encrypt.10m.rb ├── octoprint.1m.sh ├── pass.sh ├── password_bar.5m.php ├── prusa_link.30s.rb ├── rclone-mount.1m.sh ├── rsyncbackup.js ├── screen.2m.sh ├── sensibo.60s.sh ├── statuspage.1m.png ├── statuspage.1m.rb ├── todolist.2m.sh ├── todotxt.15s.sh ├── wallpaper_refresh.1h.sh ├── whos-home-unifi.1m.py ├── wol │ └── wol-nas.10s.sh ├── yabai-viewer.1s.py ├── yabai.365d.sh └── yabai_skhd.1s.sh ├── Travel ├── airspace.5m.py ├── commuter.365d.py ├── gwr-wifi-status.1m.py ├── leapcard.1h.py ├── renaultze.10m.py └── travel-time.5m.php ├── Weather ├── FlagoftheCharles.15m.rb ├── Foobot.10m.rb ├── GeoIPWeather.15m.rb ├── KRAL.metar.5m.php ├── aqi.15m.sh ├── emojiWeather.30m.js ├── homeassistant.py ├── metar.5m.rb ├── netatmo.5m.go ├── pirate_weather.15.py ├── sunrise-sunset │ ├── LICENSE │ ├── README.md │ ├── sun-full.png │ ├── sun-indicator.png │ └── sun.1m.py ├── typerlc-weather.15m.sh ├── weather-alerts.1min.ts ├── weather.15m.py ├── weather.15m.sh ├── weather.1h.py ├── wttr-in.15m.sh └── yahoo-weather.5m.py ├── Web ├── Reddit │ ├── reddit.1m.py │ ├── redditnotify.30s.py │ └── subreddit_links.rb ├── Twitch │ ├── livestreamer-now-playing.5m.js │ └── play-with-livestreamer.5m.js ├── XKCD │ ├── new-xkcd.5m.js │ └── xkcd.1h.sh ├── YouTube │ ├── YouTubeTicker.1m.js │ └── subgap.1s.py ├── beeminder.10m.py ├── beeminder_one_goal.1m.py ├── bilibili.py ├── bitbar-uptime_robot.py ├── commitstrip.1h.sh ├── cornify.1m.sh ├── counttabs.5m.sh ├── disqus_comments.rb ├── edd.15m.py ├── faith_in_humanity_score.6h.py ├── fb-dns │ ├── 001-fb_dns.5s.sh │ ├── LICENSE │ ├── README.md │ └── screen-shot.png ├── feedly.rb ├── freshdesk.3m.rb ├── git-repo-stars.1h.js ├── googleapps.sh ├── hackernews.10m.py ├── hololive.5m.rb ├── isItUp.5s.js ├── leetcode_reminder.5m.py ├── mailchimp.10m.rb ├── next_train.1m.sh ├── nightscout.30s.js ├── openui5ver.1h.sh ├── plausible-stats.1m.js ├── pocket.10m.py ├── putio.5m.py ├── reputationizer.5m.sh ├── rss.15m.php ├── service-status.5s.js ├── todays_tweets.30m.py ├── toggl.1m.js ├── twitter.1m.py ├── waniKaniStats.5m.rb ├── wanikani.15m.py ├── weibo.1h.py ├── whirlpool-watched.1m.rb ├── wikipedia_on_this_day.12h.rb └── zendesk.2m.rb └── personal └── homecoming.1d.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: matryer 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store 3 | .ruby-version 4 | .idea 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esversion": 6, 3 | "asi": true 4 | } 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | Lint/BooleanSymbol: 2 | Enabled: false 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: osx 2 | osx_image: xcode11.2 3 | 4 | 5 | addons: 6 | homebrew: 7 | packages: 8 | - python 9 | - shellcheck 10 | - luarocks 11 | - node 12 | - cpanminus 13 | - clisp 14 | - golang 15 | - r 16 | casks: 17 | - racket 18 | 19 | before_install: 20 | - pip3 install virtualenv 21 | - mkdir ~/venv 22 | - virtualenv -p python2 ~/venv 23 | 24 | install: 25 | - pip3 install pyflakes 26 | - source ~/venv/bin/activate 27 | - pip install pyflakes 28 | - gem install rubocop 29 | - luarocks install luacheck 30 | - npm install -g jshint 31 | - sudo cpanm Mozilla::CA 32 | - go get -u golang.org/x/lint/golint 33 | - export PATH="$PATH:${GOROOT:-$HOME/go}/bin" 34 | - raco pkg install --deps search-auto rackjure 35 | - Rscript -e 'install.packages("lintr", repos="http://cran.rstudio.com/")' 36 | 37 | 38 | script: ./.test.py 39 | -------------------------------------------------------------------------------- /AWS/awsmonthcost.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # AWS Cost 4 | # v1.0.0 5 | # Sean Luce 6 | # seanluce 7 | # Show the current months AWS costs. 8 | 9 | #Assumes AWS CLI is installed, 'pip install awscli' or 'pip3 install awscli', and 'aws configure' has been ran. 10 | 11 | start=$(date -v1d +%Y-%m-%d) 12 | end=$(date -v+1m -v1d -v-1d +%Y-%m-%d) 13 | export PATH="/usr/local/bin:/usr/bin:$PATH" 14 | prefix=$(aws ce get-cost-and-usage --time-period Start="$start",End="$end" --granularity MONTHLY --metric "BlendedCost" | awk '/Unit/ {print $2;}' | sed 's/[,"]//g') 15 | cost=$(aws ce get-cost-and-usage --time-period Start="$start",End="$end" --granularity MONTHLY --metric "BlendedCost" | awk '/Amount/ {print $2;}' | sed 's/[,"]//g' | xargs printf "%.*f\n" 2) 16 | echo "$cost" "$prefix" -------------------------------------------------------------------------------- /Cloud/GCP/gcp-project-switcher.1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Metadata allows your plugin to show up in the app, and website. 4 | # 5 | # GCP Project Switcher 6 | # v1.0 7 | # Daniel Palma 8 | # danthelion 9 | # https://i.imgur.com/EuTdul2.png 10 | # See current active GCP project and easily switch between others. 11 | 12 | export PATH='/usr/local/bin:/usr/bin:$PATH' 13 | 14 | gcloud_executable=gcloud 15 | if ! command -v gcloud &> /dev/null 16 | then 17 | gcloud_executable="/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/gcloud" 18 | 19 | fi 20 | 21 | active_project=$(${gcloud_executable} config get-value project) 22 | 23 | echo "$active_project" 24 | echo "---" 25 | 26 | project_id_array=($(${gcloud_executable} projects list --format="value(name)" | awk '{print $1}')) 27 | for i in "${!project_id_array[@]}"; do 28 | if [[ "${project_id_array[$i]}" == "$active_project" ]] ;then 29 | printf ":white_check_mark: " 30 | fi 31 | echo "${project_id_array[$i]} | shell=${gcloud_executable} param1=config param2=set param3=project param4=${project_id_array[$i]} | refresh=true" 32 | done 33 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/bitcoin.de/last.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Bitcoin.de price ticker 4 | # v1.0 5 | # alex_rockt 6 | # alex_rockt 7 | # Shows the current bitcoin price for Bitcoins from Bitcoin.de. 8 | # http://i.imgur.com/mP8Vec2.png 9 | # none 10 | 11 | DATA=$(curl -s "https://bitcoinapi.de/widget/current-btc-price/rate.json") 12 | 13 | echo -n "BTC: "; echo "$DATA" | egrep -o '"price_eur":"[0-9.]+(\,)?([0-9]{0,2}\\)?' | sed 's/"price_eur":"//' | sed 's/\\/ EUR/' 14 | echo "---" 15 | echo "$DATA" | egrep -o '"date_de":"[0-9]{2}.[0-9]{2}.[0-9]{2} [0-9]{2}:[0-9]{2}"' | sed 's/"date_de":"//' | sed 's/\\/ EUR/' | sed 's/"//' 16 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/bitfinex.com/bitfinex_btcusd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last BTC price (in USD) on Bitfinex BTCUSD Order Book. 4 | # 5 | # Bitfinex BTCUSD last price 6 | # v1.0 7 | # Roberto Santacroce Martins 8 | # mileschet 9 | # Shows last BTC price (in USD) on Bitfinex BTCUSD Order Book. 10 | # http://i.imgur.com/AJU4wmc.png 11 | # 12 | # by Roberto Santacroce Martins 13 | # Based on Coinbase bitbar plugin by Mat Ryer 14 | 15 | echo -n "₿"; curl -s "https://api.bitfinex.com/v1/pubticker/BTCUSD" | egrep -o '"last_price":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"last_price"://'| sed 's/\"//g' | cut -d . -f 1 | sed -re 's/([0-9])([0-9]{3})($|[^0-9])/\1,\2\3/' 16 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/bitoex.com/bitoex-buy-and-sell.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # BitoEX Buy and Sell 3 | # v1.0 4 | # Ryan Chen 5 | # ryanchentw 6 | # Show latest buy and seller values in TWD from BitoEX. BitoEX is a popular BTC exchange in TW https://www.bitoex.com 7 | 8 | 9 | regexp='"([0-9,]+)","([0-9,]+)"' 10 | resp=$(curl -s https://www.bitoex.com/sync/dashboard_fixed/"$(date +%s)") 11 | 12 | if [[ $resp =~ $regexp ]]; then 13 | echo Buy: NT$ "${BASH_REMATCH[1]}" 14 | echo Sell: NT$ "${BASH_REMATCH[2]}" 15 | echo '---' 16 | echo 'Go chart | href=https://www.bitoex.com/charts?locale=zh-tw' 17 | fi 18 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/bitstamp.net/last.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last BTC price (in USD) on Bitstamp exchange. 4 | # 5 | # Bitstamp last price 6 | # v1.0 7 | # Damien Lajarretie 8 | # dlajarretie 9 | # Shows last BTC price (in USD) on Bitstamp exchange. 10 | # http://i.imgur.com/aQCqOW6.png 11 | # 12 | # by Damien Lajarretie 13 | # Based on Coinbase bitbar plugin by Mat Ryer 14 | 15 | echo -n "Bitstamp: $"; curl -s "https://www.bitstamp.net/api/ticker/" | egrep -o '"last": "[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"last": //' | sed 's/\"//g' -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/bitx.co/buy-and-sell.1m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # BitX Buy and Sell 4 | # v1.1 5 | # Konrad Blum 6 | # kblum 7 | # Shows latest buy and sell values (in ZAR) for Bitcoins on the BitX exchange. 8 | # https://cloud.githubusercontent.com/assets/868608/24828465/e257fc20-1c5d-11e7-9641-5abed32bcb9b.png 9 | # python 10 | 11 | import urllib.request, urllib.error, urllib.parse 12 | import json 13 | from datetime import datetime 14 | 15 | 16 | def run(): 17 | base_api_url = 'https://api.mybitx.com' 18 | 19 | currency_pair = 'XBTZAR' 20 | url = '{0}/api/1/ticker?pair={1}'.format(base_api_url, currency_pair) 21 | 22 | response = urllib.request.urlopen(url).read() 23 | data = json.loads(response) 24 | 25 | timestamp = datetime.fromtimestamp(int(data['timestamp'])/1000.0) 26 | 27 | # lines below will cycle through in menu bar 28 | print(('Buy: R{0:,}'.format(float(data['ask'])))) 29 | print(('Sell: R{0:,}'.format(float(data['bid'])))) 30 | 31 | print('---') 32 | 33 | # lines below will only appear when opening menu 34 | print('BitX Market Data - XBT/ZAR') 35 | print(('Updated: {0:%Y-%m-%d %H:%M:%S}'.format(timestamp))) 36 | 37 | 38 | if __name__ == '__main__': 39 | run() 40 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/blocktime.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # BTC Block Time 4 | # v1.0 5 | # BitFlib 6 | # BitFlib 7 | # Displays the height of the last bitcoin block aka block time (received from mempool explorer api; requires tor). 8 | # https://i.imgur.com/m16z0vd.png 9 | # tor 10 | # string(VAR_MEMPOOL_TOR_ADDRESS="http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion"): mempool explorer tor address 11 | 12 | # requires installed TOR proxy service. 13 | curl -sSL --socks5-hostname 127.0.0.1:9050 ${VAR_MEMPOOL_TOR_ADDRESS}/api/blocks/tip/height 14 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/coinbase.com/buy-and-sell.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Coinbase.com Buy and Sell 3 | # v1.0 4 | # Mat Ryer 5 | # matryer 6 | # Shows latest Buy and Sell values (in USD) for Bitcoins in the Coinbase exchange. 7 | 8 | echo -n "Buy: $"; curl -s "https://coinbase.com/api/v1/prices/buy?currency=USD" | egrep -o ',"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/,"amount"://' | sed 's:^.\(.*\).$:\1:' 9 | echo -n "Sell: $"; curl -s "https://coinbase.com/api/v1/prices/sell?currency=USD" | egrep -o ',"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/,"amount"://' | sed 's:^.\(.*\).$:\1:' 10 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/coinbase.com/buy.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Coinbase.com Buy 3 | # v1.0 4 | # Mat Ryer 5 | # matryer 6 | # Shows latest buy values (in USD) for Bitcoins in the Coinbase exchange. 7 | 8 | echo -n "Buy: $"; curl -s "https://coinbase.com/api/v1/prices/buy?currency=USD" | egrep -o ',"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/,"amount"://' | sed 's:^.\(.*\).$:\1:' 9 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/coinbase.com/sell.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Coinbase.com Buy 3 | # v1.0 4 | # Mat Ryer 5 | # matryer 6 | # Shows latest sell values (in USD) for Bitcoins in the Coinbase exchange. 7 | 8 | echo -n "Sell: $"; curl -s "https://coinbase.com/api/v1/prices/sell?currency=USD" | egrep -o ',"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/,"amount"://' | sed 's:^.\(.*\).$:\1:' 9 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/coinbase.com/spotrate.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Coinbase.com Spot rate 3 | # v1.0 4 | # Mat Ryer 5 | # matryer 6 | # Shows latest spot rate values (in USD) for Bitcoins in the Coinbase exchange. 7 | 8 | echo -n "BTC: $"; curl -s "https://coinbase.com/api/v1/prices/spot_rate?currency=USD" | egrep -o '"amount":"[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"amount"://' | sed 's:^.\(.*\).$:\1:' 9 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/coinone.co.kr/coinone.15s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Coinone Ticker 4 | # v1.1 5 | # Sunwoo Lee 6 | # eldkqmfhf123 7 | # coineone.co.kr Ticker 8 | 9 | import urllib.request, urllib.error, urllib.parse 10 | import json 11 | 12 | def parse(): 13 | base_url = 'https://api.coinone.co.kr/ticker/?currency=' 14 | # You can change it to btc / eth / etc / xrp 15 | currency = 'btc' 16 | 17 | url = base_url + currency 18 | 19 | response = urllib.request.urlopen(url).read() 20 | response_data = json.loads(response) 21 | 22 | print("{0}: {1}".format(currency.upper(), response_data['last'])) 23 | print("---") 24 | print("By Skriex | href=http://github.com/eldkqmfhf123") 25 | 26 | 27 | if __name__ == '__main__': 28 | parse() 29 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/huobi.com/huobiprice.1s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=utf-8 3 | 4 | # Huobi last price 5 | # v1.0 6 | # Sam Xie 7 | # mountain3th 8 | # A very simple huobi last price display tool 9 | # python 10 | # 11 | # by mountain3th/Sam Xie 12 | 13 | import urllib2 14 | 15 | 16 | def price(): 17 | response = urllib2.urlopen('https://api.huobi.com/staticmarket/td_btc.html').read() 18 | lines = response.split('\n') 19 | last_line = lines[-2] 20 | last_second_line = lines[-3] 21 | open_price = float(lines[2]) 22 | last_price = float(last_second_line.split(',')[1]) 23 | current_price = float(last_line.split(',')[1]) 24 | return open_price, last_price, current_price 25 | 26 | def prices_output(): 27 | open_price, last_price, current_price = price() 28 | return u'火币网:¥%s%s %.2f' % (current_price, u'⬆️' if current_price > last_price else u'⬇️', (current_price - open_price) / open_price * 100) + '%' 29 | 30 | if __name__ == '__main__': 31 | print prices_output().encode('utf-8') 32 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/mayer-multiple.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Mayer Multiple (BTC) 4 | # Tadek Teleżyński 5 | # tadeoos 6 | # 7 | # Displays Mayer Multiple for Bitcoin 8 | # 9 | # https://i.imgur.com/NsOofDJ.png 10 | 11 | RESULT=$(curl -s "https://mayermultiple.info/current.json") 12 | MM=$(echo "$RESULT" | grep -E -o '"current_mayer_multiple": "[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"current_mayer_multiple"://' | sed 's/\"//g') 13 | BTC=$(echo "$RESULT" | grep -E -o '"btc_price": "[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"btc_price"://' | sed 's/\"//g') 14 | AMM=$(echo "$RESULT" | grep -E -o '"average_mayer_multiple": "[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"average_mayer_multiple"://' | sed 's/\"//g') 15 | PTH=$(echo "$RESULT" | grep -E -o '"percentage_time_higher": "[0-9]+(\.)?([0-9]{0,2}")?' | sed 's/"percentage_time_higher"://' | sed 's/\"//g') 16 | 17 | if (( $(echo "$MM < 2.4" |bc -l) )); then 18 | echo "$MM | color='green'"; 19 | else 20 | echo "$MM"; 21 | fi 22 | echo "---" 23 | echo -n "BTC $"; echo "$BTC" 24 | echo -n "Average Mayer Multiple is "; echo "$AMM" 25 | echo -n "Mayer Multiple has historically been higher "; echo -n "$PTH"; echo "% of the time"; 26 | -------------------------------------------------------------------------------- /Cryptocurrency/Bitcoin/winkdex.com/winkdex.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Winkdex.com Buy 3 | # v1.0 4 | # Baron Reznik 5 | # xiezusan 6 | # Shows latest buy values (in USD) for Bitcoins based on the latest price according to WinkDex. 7 | 8 | PRICE=$(curl -s -H "Accept-Encoding: gzip" "https://winkdex.com/api/v0/price" | gzcat | python -c 'import json,sys;obj=json.load(sys.stdin); print obj["price"]';) 9 | echo -n "WinkDex: $"; echo "$((PRICE/100)).$((PRICE%100))"; 10 | echo "---"; 11 | echo "Data Provided by WINKDEX(SM) | href=https://winkdex.com/"; 12 | -------------------------------------------------------------------------------- /Cryptocurrency/CoinbaseBuy.1m.rkt: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/racket 2 | #lang rackjure 3 | 4 | ; Coinbase buy prices 5 | ; v1.0 6 | ; Daniel Kvasnicka 7 | ; dkvasnicka 8 | ; Fetches BUY proces for cryptocurrencies traded at Coinbase 9 | ; racket, rackjure package 10 | 11 | (require net/url 12 | json) 13 | 14 | (define currencies '(BTC ETH LTC)) ; change to set watched coins 15 | (define url-template "https://api.coinbase.com/v2/prices/~s-USD/buy") 16 | 17 | (define get-json 18 | (compose bytes->jsexpr 19 | port->bytes 20 | get-pure-port 21 | string->url)) 22 | 23 | (displayln 24 | (string-join 25 | (map 26 | (compose 27 | (λ~> 'data 'amount) 28 | get-json 29 | (curry format url-template)) 30 | currencies) 31 | " • ")) 32 | -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/eth_all_in_one.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # All-in-One ETH Price & GasNow Indicator 4 | # v1.0 5 | # take3315 6 | # take3315 7 | # One line display to check the current ETH price, gasnow quick/fast/standard level in one go 8 | # https://imgur.com/a/525iUFo.png 9 | # https://beaconcha.in/gasnow 10 | 11 | 12 | response=$(curl -s https://beaconcha.in/api/v1/execution/gasnow) 13 | read code rapid fast standard slow timestamp price priceusd <<<${response//[^0-9]/ } 14 | if ((fast > 60000000000)); then 15 | color="tomato" 16 | elif ((fast < 30000000000)); then 17 | color="limegreen" 18 | else 19 | color="gold" 20 | fi 21 | echo "\$$price ${rapid:0:((${#rapid} - 9))}/${fast:0:((${#fast} - 9))}/${standard:0:((${#standard} - 9))} | color=$color" 22 | -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/eth_basefee.30s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Ethereum Base Fee 4 | # v1.0.0 5 | # David Dornseifer 6 | # dpdornseifer 7 | # Ethereum EIP1559 base fee 8 | # https://ethgasstation.info/ 9 | # https://i.imgur.com/66j14MI.png 10 | # jq 11 | 12 | # current Ethereum base fee and prediction for next block 13 | 14 | export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH" 15 | 16 | jq=$(command -v jq) 17 | 18 | response=$(curl -s https://api.ethgasstation.info/api/fee-estimate) 19 | read baseFee nextBaseFee priorityFee < <(echo $(echo ${response} | jq -r '.baseFee, .nextBaseFee, .priorityFee.fast')) 20 | 21 | if (( ${nextBaseFee} > ${baseFee} )); then 22 | nextBaseFeeColor="red" 23 | elif (( ${nextBaseFee} < ${baseFee} )); then 24 | nextBaseFeeColor="green" 25 | else 26 | nextBaseFeeColor="white" 27 | fi 28 | 29 | echo "Ξ BaseFee: \t ${baseFee} | color=white" 30 | echo "Ξ NextBlock: \t ${nextBaseFee} | color=${nextBaseFeeColor}" -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/eth_gas_widget.10m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # Ethereum Gas Fees 4 | # v1.0 5 | # Masumi Kawasaki 6 | # geeknees 7 | # Widget for monitoring Ethereum Gas Fees from https://etherscan.io/ 8 | # ruby 9 | # https://raw.githubusercontent.com/geeknees/xbar-plugins/main/eth_gas_widget/screenshot.png 10 | # https://github.com/geeknees/xbar-plugins 11 | 12 | require 'open-uri' 13 | require 'json' 14 | 15 | ENDPOINT = "https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=" 16 | APIKEY = "" 17 | 18 | charset = nil 19 | html = URI.open(ENDPOINT+APIKEY) do |f| 20 | charset = f.charset 21 | f.read 22 | end 23 | 24 | response = JSON.parse(html) 25 | 26 | puts "⟠ #{response['result']['ProposeGasPrice']}" 27 | puts '---' 28 | 29 | response['result'].each do |k, v| 30 | puts "#{k}: #{v.to_f.floor(5)}" 31 | end 32 | -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/ethbtc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last Ethereum price on Bitfinex in BTC. 4 | # 5 | # Ethereum BFX price 6 | # 0.1 7 | # Corvin Wimmer 8 | # corv89 9 | # Shows last Ethereum price on Bitfinex in BTC. 10 | # http://i.imgur.com/w6D7HHe.png 11 | 12 | echo -n "ETH "; curl -s "https://api.bitfinex.com/v1/pubticker/ETHBTC" | grep -Eo 'last_price":"[0-9]+\.[0-9]+' | sed 's/last_price":"//' -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/ether-eur-kraken.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kraken.com ETHEUR last price 4 | # v1.0 5 | # G.G. 6 | # ggrelet 7 | # Gives the last price of ether to euro from Kraken.com 8 | # https://i.imgur.com/iGX2yjR.png 9 | # bash 10 | 11 | val=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=ETHEUR" | tr -d '{}"[]' | tr ':,' '\n' | grep -A1 "^c$" | tail -1) 12 | 13 | echo "$(printf "𝚵 %.3f \n" "$val") | size=13" 14 | echo "---" 15 | echo "Kraken.com | href=\"https://www.kraken.com/\"" 16 | -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/ethgas.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Metadata allows your plugin to show up in the app, and website. 4 | # 5 | # GasRN 6 | # v1.0 7 | # the-decentraliizer 8 | # the-decentralizer 9 | # Grabs and parses data from https://beaconcha.in/api/v1/execution/gasnow 10 | # bash 11 | # https://user-images.githubusercontent.com/5545555/231251410-06cb8b22-fe5a-40c0-bccf-c194dcdabc0c.png 12 | 13 | 14 | response=$(curl -s 'https://beaconcha.in/api/v1/execution/gasnow') 15 | read code rapid fast standard slow timestamp priceUSD <<<${response//[^0-9]/ } 16 | echo "Ξ Rapid ${rapid:0:((${#rapid} - 9))} | color=green" 17 | echo "---" 18 | echo "Ξ Fast ${fast:0:((${#fast} - 9))} | color=orange" 19 | echo "---" 20 | echo "Ξ Standard ${standard:0:((${#standard} - 9))} | color=blue" 21 | echo "---" 22 | echo "Ξ Slow ${slow:0:((${#slow} - 9))} | color=purple" 23 | echo "---" 24 | # using long form for users that might not have the bash 4.0+ 25 | echo "Ξ Price \$${priceUSD::${#priceUSD}-3} | color=red" 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/ethusd.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last Ethereum price in USD. 4 | # 5 | # Ethereum last price 6 | # 0.1B 7 | # Nikita Zhavoronkov 8 | # Har01d 9 | # Shows last Ethereum price in USD. 10 | # http://i.imgur.com/lF2AA7o.png 11 | # 12 | # by Nikita Zhavoronkov 13 | # Based on Coinbase bitbar plugin by Mat Ryer 14 | 15 | echo -n "𝚵 "; curl -s "https://api.coinbase.com/v2/prices/ETH-USD/spot" | egrep -o '"amount":"[0-9]+(\.)?' | sed 's/"amount"://' | sed 's:^.\(.*\).$:\1:' -------------------------------------------------------------------------------- /Cryptocurrency/Ethereum/gasnow.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # ETH Gas Price 4 | # v2.0.1 5 | # Biran Yucel 6 | # biranyucel 7 | # ETH GasPrice forecast system. 8 | # https://i.imgur.com/f1hPKO2.png 9 | # https://ethgasstation.info/ 10 | # 11 | #ETH GasPrice forecast system based on SparkPool Pending Transaction Mempool 12 | 13 | response=$(curl -s https://beaconcha.in/api/v1/execution/gasnow) 14 | read code rapid fast standard slow timestamp <<<${response//[^0-9]/ } 15 | echo "𝚵 Rapid ${rapid:0:((${#rapid} - 9))} | color=green" 16 | echo "𝚵 Fast ${fast:0:((${#fast} - 9))} | color=orange" 17 | echo "𝚵 Standard ${standard:0:((${#standard} - 9))} | color=blue" 18 | echo "𝚵 Slow ${slow:0:((${#slow} - 9))} | color=purple" 19 | -------------------------------------------------------------------------------- /Cryptocurrency/Lisk/lskbtc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last Lisk price on Poloniex in BTC. 4 | # 5 | # Lisk/BTC Poloniex price 6 | # 0.1 7 | # Corvin Wimmer 8 | # corv89 9 | # Shows last Lisk price on Bitfinex in BTC. 10 | # http://i.imgur.com/j5qaX2t.png 11 | 12 | echo -n "LSK "; curl -s https://poloniex.com/public\?command=returnTicker | grep -Eo '"BTC_LSK":{"id":163,"last":"[0-9]+\.[0-9]+' | sed 's/"BTC_LSK":{"id":163,"last":"//' 13 | -------------------------------------------------------------------------------- /Cryptocurrency/Polygon/polygon_gas_widget.10m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # Polygon Gas Fees 4 | # v1.0 5 | # Masumi Kawasaki 6 | # geeknees 7 | # Widget for monitoring Polygon Gas Fees from https://polygonscan.com/ 8 | # ruby 9 | # https://raw.githubusercontent.com/geeknees/xbar-plugins/main/polygon_gas_widget/screenshot.png 10 | # https://github.com/geeknees/xbar-plugins 11 | 12 | require 'open-uri' 13 | require 'json' 14 | 15 | ENDPOINT = "https://api.polygonscan.com/api?module=gastracker&action=gasoracle&apikey=" 16 | APIKEY = "" 17 | 18 | charset = nil 19 | html = URI.open(ENDPOINT+APIKEY) do |f| 20 | charset = f.charset 21 | f.read 22 | end 23 | 24 | response = JSON.parse(html) 25 | 26 | puts "♾️ #{response['result']['ProposeGasPrice']}" 27 | puts '---' 28 | 29 | response['result'].each do |k, v| 30 | puts "#{k}: #{v.to_f.floor(5)}" 31 | end 32 | -------------------------------------------------------------------------------- /Cryptocurrency/Ripple/xrpusd.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shows last Ripple (XRP) price in USD. 4 | # 5 | # XRP last price 6 | # v1.0 7 | # Kevin Bost 8 | # kevbost 9 | # Shows last Ripple (XRP) price in USD. 10 | # http://i.imgur.com/iAMBYVv.png 11 | # 12 | # by Kevin Bost 13 | # Based on Ethereum bitbar plugin by Nikita Zhavoronkov 14 | 15 | echo -n "ˣʳᵖ"; curl -s "https://coinmarketcap-nexuist.rhcloud.com/api/xrp/price" | egrep -o '"usd":[0-9]+(\.)?([0-9]{2})?' | sed 's/"usd"://' | sed 's/\"//g' 16 | -------------------------------------------------------------------------------- /Cryptocurrency/btcmarkets.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # BTC Markets ETH & BTC Ticker 4 | # v1.0 5 | # Fred Wu 6 | # fredwu 7 | # Displays the latest Etherium and Bitcoin prices in AUD and their 24h trade volumes from BTC Markets. 8 | # http://i.imgur.com/7UwilDM.png 9 | 10 | echo -n "ETH "; curl -s https://api.btcmarkets.net/market/ETH/AUD/tick | \ 11 | grep -Eo 'lastPrice":[0-9\.]+' | sed 's/lastPrice"://' | tr -d '\n'; \ 12 | echo -n " BTC "; curl -s https://api.btcmarkets.net/market/BTC/AUD/tick | \ 13 | grep -Eo 'lastPrice":[0-9\.]+' | sed 's/lastPrice"://' 14 | 15 | echo '---' 16 | echo 'Volume 24h' 17 | 18 | for COIN_TYPE in 'ETH' 'BTC' 19 | do 20 | echo -n "$COIN_TYPE "; \ 21 | curl -s "https://api.btcmarkets.net/market/$COIN_TYPE/AUD/tick" | \ 22 | grep -Eo 'volume24h":[0-9\.]+' | sed 's/volume24h"://' | tr -d '\n'; \ 23 | echo '| href=https://www.btcmarkets.net/' 24 | done 25 | -------------------------------------------------------------------------------- /Cryptocurrency/garlicoin.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Garlicoin Balance 4 | # v1.1 5 | # ferdizz 6 | # ferdizz 7 | # Shows your current Garlicoin balance. 8 | # https://raw.githubusercontent.com/ferdizz/files/master/garlic-screenshot.png 9 | # bash 10 | 11 | balance=0 12 | 13 | declare -a addresses=( 14 | "INSERT-YOUR-WALLET-ADDRESS-#1-HERE" 15 | "INSERT-YOUR-WALLET-ADDRESS-#2-HERE" # <-- Repeat for every address you want to add 16 | ) 17 | 18 | for i in "${addresses[@]}" 19 | do 20 | res="$(curl -s 'https://garli.co.in/ext/getbalance/'"$i")" 21 | balance="$(echo "$balance + $res" | bc)" 22 | done 23 | 24 | echo "$(printf '%.1f' "$balance") ₲" 25 | echo "---" 26 | echo "$balance Garlicoins" 27 | 28 | # GPuEScAvXJvviVMaTH2xg4KPgPDD52AK1M if you want to donate some of that sweet sweet garlic -------------------------------------------------------------------------------- /Dev/Acquia/.INSTALL.md: -------------------------------------------------------------------------------- 1 | ## Install Acquia Cloud plugins 2 | 3 | 1. Install the pre-requisites: 4 | 1. [Composer](https://getcomposer.org/download/) 5 | 2. [BitBar PHP](https://github.com/SteveEdson/bitbar-php) 6 | ``` 7 | composer global require steveedson/bitbar-php 8 | ``` 9 | 3. [Acquia CLI](https://docs.acquia.com/acquia-cli/install/) 10 | ``` 11 | curl -OL https://github.com/acquia/cli/releases/latest/download/acli.phar 12 | chmod +x acli.phar 13 | mv acli.phar /usr/local/bin/acli 14 | ``` 15 | 4. Authenticate with Acquia CLI: 16 | ``` 17 | acli login 18 | ``` 19 | 2. Follow the typical installation process for xBar plugins by browsing for the plugin in the xBar UI and clicking "install." 20 | 21 | That's it! -------------------------------------------------------------------------------- /Dev/Docker/docker-stats.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # Metadata allows the plugin to show up in the xbar app and website. 4 | # 5 | # Docker stats 6 | # v0.1 7 | # Tom Adamczewski 8 | # tadamcz 9 | # Shows stats about currently running Docker containers 10 | # https://images2.imgbox.com/e6/1a/3AEpT9sd_o.png 11 | # string(VAR_MENU_BAR_TEXT='🐳'): The text that will appear in the Menu Bar 12 | 13 | echo $VAR_MENU_BAR_TEXT 14 | echo "---" 15 | while read -r line; do 16 | # add `| font='MesloLGL Nerd Font Mono'` to every line 17 | echo "$line" " | font='MesloLGL Nerd Font Mono'" 18 | done < <(/usr/local/bin/docker stats --no-stream) 19 | echo "Refresh | terminal=false refresh=true" -------------------------------------------------------------------------------- /Dev/Docker/numContainers.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # NumContainers 4 | # v1.0 5 | # cghamburg 6 | # cghamburg 7 | # Print number of running Docker containers with whale unicode char 8 | # docker 9 | 10 | CONTAINERS=$(/usr/local/bin/docker ps --format '{{.Names}}' | sort) 11 | NUM_CONTAINERS=0 12 | if [ -n "$CONTAINERS" ] 13 | then 14 | NUM_CONTAINERS=$(echo "${CONTAINERS}" | wc -l | tr -d '[:space:]') 15 | fi 16 | echo "$(printf "🐳 %.0f \n" "${NUM_CONTAINERS}") | size=13" 17 | echo "---" 18 | echo "${CONTAINERS}" 19 | -------------------------------------------------------------------------------- /Dev/GitHub/github_watch.1h.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # GitHub Watch 4 | # v0.1.0 5 | # D. Khamsing 6 | # dkhamsing 7 | # Show GitHub stars ⭐️ for a list of repos 8 | # http://i.imgur.com/z1qhSun.png 9 | # ruby 10 | # https://github.com/dkhamsing 11 | 12 | require 'open-uri' 13 | require 'json' 14 | 15 | REPOS = [ 16 | 'matryer/bitbar', 17 | 'dkhamsing/awesome_bot' 18 | ] 19 | 20 | VERSION = '0.1.0' 21 | 22 | CONFIG_GITHUB_WATCH = 'stargazers_count' 23 | 24 | CONFIG_SYMBOL = '★' 25 | 26 | GITHUB_REPO_API = 'https://api.github.com/repos' 27 | 28 | def get_stars(repos) 29 | s = [] 30 | repos.each do |r| 31 | repo_url = "#{GITHUB_REPO_API}/#{r}" 32 | c = open repo_url 33 | j = JSON.parse c.read 34 | s.push j[CONFIG_GITHUB_WATCH] 35 | end 36 | s 37 | end 38 | 39 | def line(r, s) 40 | repo_url = "https://github.com/#{r}" 41 | puts "#{r} #{CONFIG_SYMBOL} #{s} | href=#{repo_url}" 42 | end 43 | 44 | # bitbar output 45 | begin 46 | get_stars(REPOS).each_with_index { |s, i| line REPOS[i], s.to_s } 47 | rescue => e 48 | puts "#{CONFIG_SYMBOL} | color=red" 49 | puts "Error: #{e}" 50 | exit 51 | end 52 | -------------------------------------------------------------------------------- /Dev/Hosting/Linode/Linode.5m.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 3 | Linode Status 5 | // v1.0 6 | // Brendon Cheves 7 | // misfitius 8 | // Uses linode-cli to check the status of your Linodes. 9 | // linode-cli,php 10 | 11 | $status = true; 12 | $json = shell_exec('/usr/local/bin/linode-cli linodes list --json'); 13 | $servers = json_decode($json); 14 | $output = '---' . "\n"; 15 | foreach($servers as $server) 16 | { 17 | $status &= ($server->status == 'running'); 18 | $output .= $server->label . ' : ' . $server->status . '|color=' . ($server->status == 'running' ? 'green' : 'red') . "\n"; 19 | } 20 | $output .= 'Go to Linode account|href=https://manager.linode.com'; 21 | 22 | echo 'Linode|color=' . ($status ? 'green' : 'red') . "\n" . $output; 23 | ?> 24 | -------------------------------------------------------------------------------- /Dev/Jenkins/jenkins-status.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Check status of single Jenkins project 3 | # Stratouklos 4 | # Stratouklos 5 | 6 | USER="username" 7 | PASS="pass" 8 | BASE_URL="my-jenkins.com" 9 | JOBNAME="jobname" 10 | 11 | RESULT=$(curl -silent http://${USER}:${PASS}@${BASE_URL}/job/${JOBNAME}/lastBuild/api/json?pretty=true | grep "result" | awk '{print $3}') 12 | 13 | if [[ $RESULT == *"SUCCESS"* ]] 14 | then 15 | echo '🍏' 16 | else 17 | echo '🍎' 18 | fi 19 | -------------------------------------------------------------------------------- /Dev/Kubernetes/k-get-pods.30s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # List some running Kubernetes things 4 | # v1.0 5 | # Robert Prince 6 | # robertp 7 | # Simple plugin that shows running Kubernetes pods, services, deployments, ... 8 | # brew,kubectl 9 | # https://i.imgur.com/sH9yhBW.png 10 | 11 | export PATH=/usr/local/bin:"${PATH}" 12 | 13 | numpods=$(kubectl get pods -A 2> /dev/null | grep -v NAME | wc -l | sed 's/ //g') 14 | numsvc=$(kubectl get services -A 2> /dev/null | grep -v NAME | wc -l | sed 's/ //g') 15 | numdeps=$(kubectl get deployments -A 2> /dev/null | grep -v NAME | wc -l | sed 's/ //g') 16 | 17 | # if [[ "$numpods" -eq "0" && "$numsvc" -eq "0" && "$numdeps" -eq "0" ]]; then echo "no k8s"; exit; fi 18 | 19 | if [[ "$numpods" -eq "0" && "$numsvc" -eq "0" && "$numdeps" -eq "0" ]]; then exit; fi 20 | 21 | echo "[$numpods pods / $numsvc services / $numdeps deployments]" 22 | 23 | echo "---" 24 | echo "==== PODS ====" 25 | kubectl get pods -A | while read -r line; do echo "${line} | font=Menlo"; done 26 | echo "---" 27 | echo "==== SERVICES ====" 28 | kubectl get services -A | while read -r line; do echo "${line} | font=Menlo"; done 29 | echo "---" 30 | echo "==== DEPLOYMENTS ====" 31 | kubectl get deployments -A | while read -r line; do echo "${line} | font=Menlo"; done 32 | -------------------------------------------------------------------------------- /Dev/PID/pidkiller.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Display and kill running processes 4 | # 5 | # by Dan Engel (im@dan-engel.fyi) 6 | # 7 | 8 | # metadata 9 | # PID Killer 10 | # v1.10.1 11 | # Dan Engel 12 | # dengel29 13 | # Display and kill running processes 14 | # https://user-images.githubusercontent.com/8292535/108005602-1651c500-7034-11eb-982f-edc41a9554db.png 15 | 16 | echo "Current PIDs" 17 | echo "---" 18 | echo "Click on an item to kill the process | font=Tahoma-Bold" 19 | 20 | if [[ "$1" = 'kill' ]]; then 21 | kill -9 "$2" 22 | fi 23 | 24 | list=`lsof -i | awk '{a[$1","$2];}END {for (i in a) print i;}'`; 25 | IFS=$'\n' arr=($list) 26 | IFS=',' 27 | echo "${#arr[@]} running currently | color=green font=Tahoma size=12" 28 | for val in "${arr[@]}"; do 29 | item=($val) 30 | echo "${item[0]}:${item[1]} | font=AndaleMono bash=$0 param1=kill param2=${item[1]} terminal=false refresh=true" 31 | done 32 | -------------------------------------------------------------------------------- /Dev/PhpStormXdebugStatus.3s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # PHPstorm debugger status 4 | # v1.0 5 | # Harings Rob 6 | # haringsrob 7 | # Shows the current status of phpstorm debugger 8 | # bash 9 | # https://github.com/haringsrob/ 10 | 11 | if lsof -i :9000 | grep -q phpstorm; then 12 | echo 'Xdebug on | color=#008000' 13 | else 14 | echo 'Xdebug off | color=#FF0000' 15 | fi 16 | -------------------------------------------------------------------------------- /Dev/Shell/run-fastlane.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # Run fastlane 4 | # v1.0 5 | # Rishabh Tayal 6 | # Run fastlane from menu bar 7 | # rishabhtayal 8 | # bash 9 | 10 | # ------------- Modify the config below ------------- 11 | configs = [ 12 | { 13 | 'lane_name' => 'YOUR_LANE_NAME', 14 | 'path' => 'YOUR_PROJECT_PATH', 15 | 'use_bundle' => true 16 | }, 17 | { 18 | 'lane_name' => 'YOUR_LANE_NAME', 19 | 'path' => 'YOUR_ANOTHER_PROJECT_PATH', 20 | 'use_bundle' => true 21 | } 22 | # YOU CAN ADD MORE CONFIG MAPS HERE 23 | ] 24 | 25 | # ------------ Ignore below this line --------------- 26 | 27 | require 'pathname' 28 | 29 | puts 'run-fastlane' 30 | 31 | puts '---' 32 | 33 | configs.each do |item| 34 | command = "cd #{item['path']} && " 35 | command << if item['use_bundle'] 36 | 'bundle exec fastlane' 37 | else 38 | 'fastlane' 39 | end 40 | command << ' ' + item['lane_name'] 41 | 42 | project_name = Pathname.new(item['path']).split.last.to_s 43 | puts "#{project_name}: #{item['lane_name']} | bash=\"#{command}\"" 44 | end 45 | -------------------------------------------------------------------------------- /Dev/SshMenu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SSH Menu 4 | # v1.0 5 | # Christopher Haen 6 | # Chrisischris 7 | # Provides a simple menu of ssh hosts when clicked on opens a new ssh session in terminal 8 | # 9 | # 10 | 11 | echo "ssh | color='white'" 12 | echo "---" 13 | #Enter list of servers below give it a name and an address 14 | echo "ServerName(Edit script file) | bash='ssh user@server'" 15 | #^Copy to add more servers 16 | #After adding or changing refresh plugins 17 | -------------------------------------------------------------------------------- /Dev/Tutorial/alternate_options.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Alternate Options Tutorial 3 | # v1.0 4 | # Mat Ryer 5 | # matryer 6 | # http://i.imgur.com/EDYR52G.png 7 | # Example of how to include alternate items that replace the one before it when the Option key is pressed. 8 | echo "Hello" 9 | echo "Option key is pressed | alternate=true" 10 | 11 | echo "Another" -------------------------------------------------------------------------------- /Dev/Tutorial/ansi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Show ANSI colors 4 | # v1.0 5 | # Kent Karlsson 6 | # vogonistic 7 | # Example of how to use ANSI color codes 8 | # http://i.imgur.com/kGVgf6y.png 9 | # https://github.com/matryer/bitbar-plugins/blob/master/Tutorial/ansi.sh 10 | 11 | echo -e "\033[34mA\033[32mN\033[31mS\033[33mI\033[0m | ansi=true" 12 | echo "---" 13 | 14 | T='gYw' # The test text 15 | echo -e " 40m 41m 42m 43m\ 16 | 44m 45m 46m 47m | ansi=true font=courier trim=false"; 17 | 18 | for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ 19 | '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ 20 | ' 36m' '1;36m' ' 37m' '1;37m'; 21 | do FG=${FGs// /} 22 | echo -en " $FGs \033[$FG $T " 23 | for BG in 40m 41m 42m 43m 44m 45m 46m 47m; 24 | do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; 25 | done 26 | echo " | ansi=true font=courier trim=false"; 27 | done 28 | echo "---" 29 | echo "Open color codes in browser… | href=http://misc.flogisoft.com/bash/tip_colors_and_formatting#colors" 30 | echo "Refresh | refresh=true" 31 | -------------------------------------------------------------------------------- /Dev/Tutorial/config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/bash 2 | # shellcheck disable=SC2154 3 | 4 | # Home Config 5 | # v1.0 6 | # Kodie Grantham 7 | # kodie 8 | # Example of how to mimic the functionality of the home-config npm module in a bash BitBar plugin 9 | # bash4 10 | # https://github.com/kodie/bitbar-home-config 11 | 12 | typeset -A cfg 13 | cfg[home_config,color]="red" 14 | cfg[home_config,text]="Try editing $HOME/.bitbarrc" 15 | 16 | cfgFile="$HOME/.bitbarrc" 17 | if [ ! -e "$cfgFile" ]; then touch "$cfgFile"; fi 18 | while read -r cfgLine; do 19 | if [[ -z $cfgLine ]]; then continue; fi 20 | if [[ ${cfgLine:0:1} == '[' ]]; then cfgKey=${cfgLine:1:-1}; 21 | else IFS='='; cfgVar=($cfgLine); unset IFS; cfg[$cfgKey,${cfgVar[0]}]=${cfgVar[1]}; fi 22 | done < "$cfgFile" 23 | 24 | echo "Config Example | dropdown=false color=${cfg[home_config,color]}" 25 | echo "---" 26 | echo "${cfg[home_config,text]}" 27 | -------------------------------------------------------------------------------- /Dev/Tutorial/cycle_text_and_detail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Include BitBar metadata like this at the top of the file 5 | # (commented out, of course): 6 | # 7 | # Cycle text and detail text 8 | # v1.0 9 | # Mat Ryer 10 | # matryer 11 | # Example of how to include items that cycle in the top, and items that only appear in the dropdown. 12 | # https://camo.githubusercontent.com/5cec3248a9fc4eede235ead682a65f977577f670/68747470733a2f2f7261772e6769746875622e636f6d2f6d6174727965722f6269746261722f6d61737465722f446f63732f4269744261722d4578616d706c652d4d656e752e706e67 13 | # https://github.com/matryer/bitbar-plugins/blob/master/Tutorial/cycle_text_and_detail.sh 14 | # 15 | # Text above --- will be cycled through in the menu bar, 16 | # whereas text underneath will be visible only when you 17 | # open the menu. 18 | # 19 | 20 | echo one 21 | echo two 22 | echo three 23 | echo --- 24 | echo These lines are only visible 25 | echo when you open the menu. 26 | -------------------------------------------------------------------------------- /Dev/Tutorial/emoji.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Show emoji 4 | # v1.0 5 | # Kent Karlsson 6 | # vogonistic 7 | # Example of how to use emojis 8 | # http://i.imgur.com/z4T9X6G.png 9 | # https://github.com/matryer/bitbar-plugins/blob/master/Tutorial/emoji.sh 10 | 11 | echo ":sparkles: :coffee: :mushroom:" 12 | echo "---" 13 | 14 | echo "Random emojis:exclamation:" 15 | echo ":smile: :smile_cat: :smiley: :smiley_cat: :smiling_imp:" 16 | echo ":tent: :thought_balloon: :thumbsdown: :thumbsup: :ticket:" 17 | echo ":pig: :dolphin: :elephant: :honeybee: :horse:" 18 | echo "No :coffee: | emojize=false" 19 | 20 | echo "---" 21 | echo "Open emoji cheat sheet in browser… | href=http://www.emoji-cheat-sheet.com/" 22 | echo "Refresh | refresh=true" 23 | -------------------------------------------------------------------------------- /Dev/Tutorial/is_bitbar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Is BitBar? 4 | # Mat Ryer and Tyler Bunnell 5 | # matryer 6 | # Example script showing use of $BITBAR environment variable 7 | # https://i.imgur.com/TcZJI06.png 8 | # 1.0 9 | # 10 | # Example script showing how to let your scripts determine 11 | # whether they are expected to deliver BitBar output or not. 12 | # 13 | # Put this script in your BitBar plugins folder and notice 14 | # it says "In BitBar", but run it directly in Terminal, and it 15 | # says "In Terminal". 16 | BitBar=${BitBar} 17 | 18 | if [ "$BitBar" ]; then 19 | # this script is being called from within 20 | # BitBar. 21 | echo "In BitBar" 22 | else 23 | # this script is being called from within 24 | # Terminal. 25 | echo "In Terminal" 26 | fi 27 | -------------------------------------------------------------------------------- /Dev/Tutorial/is_darkmode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Is Dark Mode? 4 | # v1.0 5 | # Dave Wikoff 6 | # derimagia 7 | # Example script showing how to let your scripts determine whether OSX is in Dark Mode so you can adjust appearance. Must restart Bitbar after changing setting. 8 | # 9 | # http://i.imgur.com/2ark3Bq.png 10 | BitBarDarkMode=${BitBarDarkMode} 11 | 12 | if [ "$BitBarDarkMode" ]; then 13 | # OSX has Dark Mode enabled. 14 | echo "Dark | color=white" 15 | else 16 | # OSX does not have Dark Mode 17 | echo "Light | color=black" 18 | fi 19 | -------------------------------------------------------------------------------- /Dev/Tutorial/refresh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Refresh Me 4 | # v1.0 5 | # Karl Piper 6 | # KarlPiper 7 | # How to refresh just one plugin, or restart BitBar entirely. 8 | # https://raw.githubusercontent.com/KarlPiper/Plugins-for-Bitbar/master/images/refresh.png 9 | # bash 10 | 11 | if [[ "$1" = "restart" ]]; then 12 | osascript <Submenus 4 | # v1.0 5 | # iosdeveloper 6 | # iosdeveloper 7 | # Example of how to include multiple levels of menu items in v1.8 and later. 8 | # http://i.imgur.com/9zJJHns.png 9 | 10 | echo "Submenu Tutorial" 11 | echo "---" 12 | 13 | echo "Places" 14 | echo "--London" 15 | echo "--Paris" 16 | echo "--Tokyo" 17 | echo "Fruit" 18 | echo "--Apple" 19 | echo "--Orange" 20 | echo "--Melon" 21 | echo "----Watermelon" 22 | echo "----Honeydew" 23 | -------------------------------------------------------------------------------- /Dev/average_app_store_review_times.1h.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # -*- coding: utf-8 -*- 3 | 4 | # Average Review Times 5 | # v0.1.2 6 | # mfks17 7 | # mfks17 8 | # Average App Store Review Times 9 | # https://raw.githubusercontent.com/mfks17/bitbar-plugin-AppStore/master/Screenshots/01.png 10 | # ruby, nokogiri 11 | # https://github.com/mfks17/bitbar-plugin-AppStore 12 | 13 | require 'open-uri' 14 | require 'nokogiri' 15 | 16 | url = 'http://appreviewtimes.com/' 17 | 18 | charset = nil 19 | html = open(url) do |f| 20 | charset = f.charset 21 | f.read 22 | end 23 | 24 | doc = Nokogiri::HTML.parse(html, nil, charset) 25 | 26 | puts 'Average Review Times' 27 | puts '---' 28 | puts '📱 iOS App Store ' + doc.xpath('/html/body/div[2]/div/div[2]/div[1]/p[1]').text 29 | 30 | puts '💻 Mac App Store ' + doc.xpath('/html/body/div[2]/div/div[3]/div[1]/p[1]').text 31 | -------------------------------------------------------------------------------- /Dev/checkRedisMemory.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Check remote memory usage of Redis Server 3 | # v1.0 4 | # Jimmy Spivey 5 | # JimDeanSpivey 6 | # This will invoke SSH command locally and connect to a server that runs redis, where it will check the memory usage. You will likely run into this error: "ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory" You will need to install ssh_askpass found here: https://github.com/markcarver/mac-ssh-askpass to fix that and also enable to you to ssh from BitBar. 7 | # ssh_askpass 8 | # http://i.imgur.com/ikCSVBq.png 9 | # 10 | # Dependencies: 11 | # ssh_askpass (https://github.com/markcarver/mac-ssh-askpass) 12 | 13 | 14 | HOST="user@hostname" 15 | 16 | printf 'Redis: ' 17 | RESULT=$(ssh $HOST "redis-cli INFO | grep -o '[0-9\.]*[A-Z]\s' | head -2") 18 | printf "%s" "$RESULT" | head -1 19 | echo --- 20 | LINE1=$(echo "$RESULT" | head -n1) 21 | LINE2=$(echo "$RESULT" | tail -n1) 22 | echo 'Used Memory: '"$LINE1" 23 | echo 'Peak Memory: '"$LINE2" 24 | 25 | -------------------------------------------------------------------------------- /Dev/gulpLauncher.1h.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /usr/local/bin/node 2 | 3 | 4 | /* jshint esversion: 6 */ 5 | /* jshint asi: true */ 6 | 7 | /* 8 | * Gulp Launcher 9 | * v1.0 10 | * Aaron Crawford 11 | * aaroncrawford 12 | * https://i.imgur.com/RAxo5tG.png 13 | * Quickly launch gulp processes on projects. Useful for agency developers with a lot of projects. Editing of file required to list your projects. 14 | * node 15 | */ 16 | 17 | // EDIT ME 18 | var file = '/path/to/_projects.json' 19 | // Example _projects.json file : (you can just create an array in this file, but our file was huge so we decided to store in a separate file) 20 | /* 21 | 22 | [ 23 | { 24 | "name": "Project 1", 25 | "path": "/path/to/readable/file/project1/src" 26 | }, 27 | { 28 | "name": "Project 2", 29 | "path": "/path/to/readable/file/project2/src" 30 | } 31 | ] 32 | 33 | */ 34 | 35 | 36 | var fs = require('fs') 37 | 38 | fs.readFile(file, 'utf8', (e, data) => { 39 | console.log('🥤') 40 | console.log('---') 41 | 42 | var projects = JSON.parse(data) 43 | 44 | projects.map((d) => { 45 | var path = d.path.replace(" ", "\\\\ ") 46 | // Currently just goes to the directory and runs 'gulp'. If you want to modify this process, edit this line 47 | console.log(`${d.name}|bash="cd ${path} && gulp" terminal=true`) 48 | }) 49 | }) 50 | 51 | 52 | -------------------------------------------------------------------------------- /Dev/ips.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Display local and external IP and allow copying it. This plugin will connect to icanhazip.com to determine external IP address. 4 | # 5 | # by Martin Braun (martin-braun.net) 6 | # 7 | 8 | # metadata 9 | # IPs 10 | # v1.0.0 11 | # Martin Braun 12 | # martin-braun 13 | # Display local and external IP and allow copying it. This plugin will connect to icanhazip.com to determine external IP address. 14 | # https://i.imgur.com/8eSN3Hw.png 15 | 16 | locip=`osascript -e "IPv4 address of (system info)"` 17 | pubip=`curl -4s icanhazip.com` > /dev/null 18 | 19 | if [[ "$1" = 'copy' ]]; then 20 | echo "$2" | tr -d '\n' | pbcopy 21 | fi 22 | 23 | echo "${locip/192.168./..}" 24 | echo "---" 25 | echo "Click on an IP to copy it | font=Tahoma-Bold" 26 | echo "---" 27 | echo "Local: $locip | font=AndaleMono bash=$0 param1=copy param2=$locip terminal=false refresh=false" 28 | echo "External: $pubip | font=AndaleMono bash=$0 param1=copy param2=$pubip terminal=false refresh=false" 29 | -------------------------------------------------------------------------------- /Dev/process-monitoring.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # process-monitoring 4 | # v0.1.0 5 | # Olivier Tille 6 | # oliviernt 7 | # Monitors CPU and Memory usage for a certain process 8 | # http://i.imgur.com/ApLSN8L.png 9 | # 10 | # https://github.com/oliviernt/bitbar-plugins/blob/monitoring/Dev/Monitoring/process-monitoring.1s.sh 11 | 12 | PROCESS="BitBar.app" 13 | 14 | # shellcheck disable=SC2009 15 | id=$(ps aux | grep -i "${PROCESS}" | grep -v grep | awk '{print $2}') 16 | echo -n "${PROCESS}: " 17 | top -l 1 -pid "$id" -stats cpu,mem | tail -1 | awk '{print "CPU: " $1 " - MEM: " $2}' 18 | echo "---" 19 | top -l 1 -pid "$id" 20 | -------------------------------------------------------------------------------- /Dev/tail.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # tail 4 | # v2.0 5 | # Mat Ryer 6 | # matryer 7 | # Tails a text file. Perfect for tailing logs in the menu bar. 8 | # https://cloud.githubusercontent.com/assets/101659/12247623/b65b6f1e-b8ac-11e5-8ec2-6d9d885bfb6f.png 9 | # 10 | # https://github.com/matryer/bitbar-plugins/blob/master/Dev/Logs/tail.5s.sh 11 | 12 | # string(VAR_FILE=""): The file to tail. 13 | # number(VAR_LINES=15): The number of lines to show. 14 | 15 | # If you're using xbar, use the app to install this and set the preferences 16 | # in the UI. 17 | 18 | # For old BitBar builds, set the values by uncommenting these lines: 19 | # VAR_FILE=/path/to/file 20 | # VAR_LINES=15 21 | 22 | echo -n "↧ " 23 | basename "$VAR_FILE" 24 | echo --- 25 | tail -n $VAR_LINES $VAR_FILE 26 | -------------------------------------------------------------------------------- /Dev/virtualbox-running_vms.30s.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # Show running Virtualbox VMs with option to shutdown (save state) using VBoxManage. 4 | # 5 | # Virtualbox running VMs 6 | # 1.0 7 | # Harald Ringvold 8 | # haraldringvold 9 | # Show running virtualbox VMs with option to shutdown (save state) using VBoxManage. 10 | # http://i.imgur.com/YmFrYQH.png 11 | # Ruby,VBoxManage 12 | 13 | 14 | ENV['PATH'] = ENV['PATH']+':/usr/local/bin' 15 | 16 | status = `VBoxManage list runningvms` 17 | 18 | if status != "" 19 | vms = status.split(/\n/) 20 | 21 | print "🇻" 22 | print "#{vms.length}" if vms 23 | puts "" 24 | puts "---" 25 | 26 | vms.each do |vm| 27 | data_image = /('.*?'|".*?"|\S+).({.*?})/.match vm 28 | name = data_image[1].tr('"','') 29 | id = data_image[2].tr('{}','') 30 | 31 | puts "#{name}| color=black" 32 | puts "#{id}" 33 | puts "Save | color=green bash=VBoxManage param1=controlvm param2=#{id} param3=savestate" 34 | puts "---" 35 | end 36 | else 37 | # if no VMs are running 38 | puts "🇻" 39 | end 40 | 41 | -------------------------------------------------------------------------------- /Dev/xcode-version.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Xcode Version 3 | # v1.0 4 | # Florian Hirschmann 5 | # hirschfl 6 | # Shows the Xcode version that is currently selected with xcode-select. 7 | # xcodebuild 8 | 9 | xcodebuild -version | head -1 10 | -------------------------------------------------------------------------------- /E-Commerce/nvidia.3m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # 1080ti Stock Checker 4 | # v2.0 5 | # Alex Haynes 6 | # alexh 7 | # Checks nvidia site if 1080ti are in stock 8 | # https://images.nvidia.com/pascal/img/gtx1080ti/gallery/gallery-2.jpg 9 | # python 10 | 11 | import urllib.request, json, time 12 | with urllib.request.urlopen("http://api.findgpu.com/gpus?" + str(int(time.time()))) as url: 13 | data = json.loads(url.read().decode()) 14 | my_item = next((item for item in data if item['gpu_id'] == "900-1G611-2550-000"), None) 15 | in_stock = my_item['in_stock'] 16 | if in_stock == 'false': 17 | status = ":heavy_multiplication_x:" 18 | else: 19 | status = ":white_check_mark:" 20 | print ("1080Ti: " + status) 21 | print ("---") 22 | print ("Buy Now" + "| href=https://www.nvidia.com/en-us/geforce/products/10series/geforce-gtx-1080-ti/") 23 | -------------------------------------------------------------------------------- /Email/gmail-checker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Gmail Checker 4 | # v1.0.1 5 | # Nadav Cohen 6 | # nadavc 7 | # Checks gmail and displays inbox count 8 | # http://i.imgur.com/LYrIphK.png 9 | # NOTE: If you have Two Factor Authentication (2FA) enabled for your Google account and try to use your regular password, 10 | # you'll get an "integer expression expected" error. This is actually an "Unauthorized" error. Please make an "App Password" 11 | # for your Google account and use that in password: https://myaccount.google.com/apppasswords 12 | 13 | USERNAME="GMAIL_USERNAME" 14 | PASSWORD="GMAIL_PASSWORD" 15 | COLOR=black 16 | RESULT=$(curl -s -u $USERNAME:$PASSWORD "https://mail.google.com/mail/feed/atom" | egrep -o '[0-9]*' | cut -c 12-) 17 | 18 | if [ "$RESULT" -ne "0" ]; then 19 | COLOR=red 20 | fi 21 | 22 | echo "📬 $RESULT|color=$COLOR" 23 | -------------------------------------------------------------------------------- /Email/mu-email-checker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Mu Email Checker 4 | # v1.0.1 5 | # Andrew Sanchez 6 | # andrewsanchez 7 | # Displays results of basic mu find commands 8 | # http://i67.tinypic.com/104pa1w.png 9 | 10 | # Count total number of emails in inbox, unread mail and drafts indexed with mu 11 | # Also includes the output for unread emails in the drop down menu 12 | # Based on a blog post by Ben Maughan at the excellent pragmaticemacs.com 13 | # http://pragmaticemacs.com/emacs/an-unobtrusive-email-monitor-for-mu4e-on-the-mac/ 14 | # See related post to include mails in outbox using postfix 15 | # http://pragmaticemacs.com/emacs/using-postfix-instead-of-smtpmail-to-send-email-in-mu4e/ 16 | 17 | export LANG=en_US.UTF-8 18 | 19 | mu="/usr/local/bin/mu" 20 | 21 | # mu find patterns 22 | pinbox="maildir:/INBOX" 23 | punread="$pinbox AND flag:unread" 24 | pdrafts="maildir:/drafts" 25 | 26 | # Total mail in inbox 27 | total="$("$mu" find "$pinbox" | wc -l)" 28 | 29 | # Unread mails in inbox 30 | unread="$("$mu" find "$punread" 2> /dev/null)" 31 | unread_total="$("$mu" find "$punread" 2> /dev/null | wc -l)" 32 | 33 | # Drafts 34 | drafts="$("$mu" find "$pdrafts" | wc -l)" 35 | 36 | if [ "$unread_total" -gt 0 ] 37 | then 38 | printf "📪 %i/%i/%i\n" "$unread_total" "$total" "$drafts" 39 | echo --- 40 | echo "$unread" 41 | fi 42 | -------------------------------------------------------------------------------- /Email/notmuch-mail-count.30s.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # encoding: UTF-8 3 | 4 | # Notmuch inbox & unread counter 5 | # v1.0 6 | # Slamet Kristanto 7 | # drselump14 8 | # Show mutt inbox using notmuch inbox and unread 9 | # https://www.dropbox.com/s/cgkjb7hv6s1yx1a/Screenshot%202017-02-08%2020.40.02.png?raw=1 10 | # mutt,notmuch 11 | 12 | inbox = `/usr/local/bin/notmuch search tag:inbox tag:unread` 13 | 14 | mails = inbox.encode('UTF-8', :invalid => :replace).split("\n") 15 | count = mails.length 16 | if count > 0 17 | puts "📮 #{count} | color=red size=12" 18 | else 19 | puts '' 20 | end 21 | 22 | puts "---" 23 | 24 | mails.each do |m| 25 | mail = m.gsub(/thread.*\]/,'')[0..25].gsub(/\|/,':') 26 | puts "#{mail} | color=green size=12 bash='/usr/local/bin/mutt' " 27 | end 28 | 29 | -------------------------------------------------------------------------------- /Email/simple-gmail-checker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Simple Gmail Checker 3 | # v0.1.0 4 | # Murat Bastas 5 | # murat 6 | # Checks gmail and displays inbox count + unread mails' subjects 7 | # sh,libxml2 8 | 9 | USERNAME="example@gmail.com" 10 | PASSWORD="verysecretpassword" 11 | 12 | RESULT=$(curl -s -u $USERNAME:$PASSWORD "https://mail.google.com/mail/feed/atom" | xmllint --format -) 13 | COUNT=$(echo "$RESULT" | grep -E -o '[0-9]*' | cut -c 12-) 14 | ENTRIES=$(echo "$RESULT" | sed -n 's|\(.*\)|\1|p' | tr -s ' ') 15 | 16 | if [ "$COUNT" -ne 0 ]; then 17 | echo "📬 $COUNT | color=white" 18 | else 19 | echo "📭" 20 | fi 21 | echo "---" 22 | 23 | count=0 24 | echo "$ENTRIES" | while read -r line || [[ -n $line ]]; 25 | do 26 | if [ $count -eq 1 ]; then 27 | echo "---" 28 | fi 29 | 30 | echo "$line | href=https://mail.google.com" 31 | (( count++ )) 32 | done 33 | 34 | -------------------------------------------------------------------------------- /Email/unread.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Mail 3 | # v1.0 4 | # Harrison Page 5 | # harrisonpage 6 | # Show unread count from Mail.app in menubar 7 | # bash,osascript 8 | # https://raw.githubusercontent.com/harrisonpage/unread/main/unread.png 9 | set -e 10 | 11 | OUTPUT=$(osascript -e 'tell Application "Mail"' -e 'unread count of inbox' -e 'end tell') 12 | 13 | if [[ $OUTPUT -gt 0 ]] 14 | then 15 | echo -n "📬" 16 | else 17 | echo -n "📪" 18 | fi 19 | echo " ${OUTPUT}" 20 | -------------------------------------------------------------------------------- /Enabled/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore directory contents 2 | * 3 | # Except for 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /Environment/quake.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Recent Big Earthquake 3 | # v1.1 4 | # Aaron Edell 5 | # aaronedell 6 | # Displays the most significant earthquakes in the last 30 days from http://earthquake.usgs.gov 7 | # http://i.imgur.com/lF8Qdpk.png 8 | # Bash GNU AWK 9 | # http://earthquake.usgs.gov 10 | 11 | 12 | 13 | echo '🌎' 14 | echo '---' 15 | 16 | echo ; curl -s https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_month.csv | tail -n +2 | awk -F"," '{print $5" " $14$15}' 17 | echo '---' 18 | echo 'Data from http://earthquake.usgs.gov | color=green href=http://earthquake.usgs.gov' 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Finance/dolar_blue.5m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding=utf-8 3 | 4 | # ARS/USD Blue tracker 5 | # v1.0 6 | # Ignacio Van Droogenbroeck 7 | # xe-nvdk 8 | # Displays the latest dollar blue rate 9 | # https://i.imgur.com/zJsoTl8.jpg 10 | # python 11 | # scrapy 12 | 13 | from lxml import html 14 | import requests 15 | 16 | page = requests.get('https://www.dolarhoy.com') 17 | 18 | tree = html.fromstring(page.content) 19 | buy = tree.xpath('/html/body/div/div[2]/div[1]/div[1]/div[2]/section/div/div/div/div[1]/div/div[1]/div/div[1]/div[1]/div[2]') 20 | sale = tree.xpath('/html/body/div/div[2]/div[1]/div[1]/div[2]/section/div/div/div/div[1]/div/div[1]/div/div[1]/div[2]/div[2]') 21 | 22 | print('B: ' + buy[0].text + ' S: ' + sale[0].text) 23 | -------------------------------------------------------------------------------- /Finance/exchange-rates.5m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Exchange Rates 4 | # v1.0 5 | # Mehmet Akif Tütüncü 6 | # makiftutuncu 7 | # https://github.com/makiftutuncu/exchange-bitbar/raw/master/Screenshot.png 8 | # This is a BitBar plugin for showing exchange rates of currencies in your menu bar. See https://github.com/makiftutuncu/exchange-bitbar#configuration for configuration. 9 | # shell,curl,jq 10 | # 11 | # Exchange Rates by Mehmet Akif Tütüncü 12 | # 13 | # This is a BitBar plugin for showing exchange rates of currencies in your menu bar. 14 | # See https://github.com/makiftutuncu/exchange-bitbar#configuration for configuration. 15 | 16 | export PATH="/usr/local/bin:$PATH" 17 | 18 | # Currency pairs for which rates will show as array 19 | CURRENCY_PAIRS=("USD-TRY" "EUR-TRY") 20 | 21 | for pair in "${CURRENCY_PAIRS[@]}"; 22 | do 23 | URL=$(echo $pair | awk -F '-' '{print "https://akifs-exchange-api.herokuapp.com/rates?source="$1"&target="$2}') 24 | RESPONSE=$(curl -s -X GET $URL | jq -r '"\(.source),\(.target),\(.rate)"') 25 | echo $RESPONSE | awk -F ',' '{printf "💵 %s-%s: %0.3f\n", $1, $2, $3}' 26 | done 27 | -------------------------------------------------------------------------------- /Finance/mintable.1h.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # Mintable 4 | # v2.0.0 5 | # Kevin Schaich 6 | # kevinschaich 7 | # Automate your personal finances – for free, with no ads, and no data collection. 8 | # https://user-images.githubusercontent.com/9244728/86181837-c6ea7300-bafc-11ea-8442-c943eece3a03.png 9 | # node,mintable 10 | # https://github.com/kevinschaich/mintable 11 | 12 | export PATH="/usr/local/bin:$PATH" 13 | 14 | output=$(/usr/local/bin/mintable fetch) || exit $? 15 | 16 | declare output_status 17 | 18 | if [[ $? -eq 0 ]] 19 | then 20 | output_status="🍃" 21 | else 22 | output_status="❌" 23 | fi 24 | 25 | echo $output_status 26 | echo --- 27 | echo "..." 28 | echo $output | tail -n 15 | head -n 12 29 | 30 | echo "---" 31 | link=`echo $output | tail -n 1` 32 | echo $link 33 | echo "View Spreadsheet | color=green href=$link" 34 | 35 | echo "---" 36 | echo "Refresh Now | color=blue refresh=true" 37 | -------------------------------------------------------------------------------- /Finance/robinhood.1m.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Robinhood 5 | # v1.0 6 | # Jonathan Grant 7 | # jonathangrant 8 | # Shows your total portfolio value. 9 | # python,Robinhood 10 | 11 | 12 | from Robinhood import Robinhood as R 13 | 14 | me = R() 15 | me.login(username="Your Username Here", password="Your Password Here") 16 | data = me.portfolios() 17 | start = data.get('equity_previous_close', '0') 18 | now = data.get('equity', '0') 19 | color = 'white' 20 | difference = float(now) - float(start) 21 | if difference > 0: 22 | color = 'green' 23 | elif difference < 0: 24 | color = 'red' 25 | print('${:,.2f}|color={}'.format(float(now), color)) 26 | print('---') 27 | print('Start of Day: ${:,.2f}|color={}'.format(float(start), 'white')) 28 | print('Difference: ${:,.2f}|color={}'.format(float(difference), color)) 29 | -------------------------------------------------------------------------------- /Finance/robinhood2.1m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Robinhood2 4 | # v1.0 5 | # Adam Jilling 6 | # ajilling 7 | # Shows your total portfolio value and daily change 8 | # https://i.ibb.co/SBY7NXy/bitbar-robinhood.png 9 | # python,robin_stocks 10 | 11 | import robin_stocks as rh 12 | 13 | login = rh.login('', '') 14 | 15 | portfolio = rh.profiles.load_portfolio_profile() 16 | current_value = portfolio['equity'] 17 | open_value = portfolio['equity_previous_close'] 18 | 19 | change = float(current_value) - float(open_value) 20 | 21 | # TODO: colors not working in Big Sur 22 | color = 'white' 23 | move = '' 24 | if (change > 0): 25 | color = 'green' 26 | move = '▲' 27 | elif (change < 0): 28 | color = 'red' 29 | move = '▼' 30 | 31 | output1 = '{:,.2f}'.format(float(current_value)) 32 | output2 = ' ' + move 33 | output3 = '{:,.2f}'.format(abs(float(change))) 34 | print(output1 + output2 + output3) 35 | -------------------------------------------------------------------------------- /Finance/shiller-pe.4h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shiller PE ratio 4 | # Jørgen 5 | # jtorvald 6 | # Gets the current Shiller PE ratio. Information is provided ‘as is’ and solely for informational purposes, not for trading purposes or advice, and may be delayed. 7 | # bash, curl 8 | 9 | SHILLER_PE=$(curl -s https://www.multpl.com/shiller-pe | grep "Current Shiller PE Ratio is" | awk '{print $16}' | cut -d, -f1) 10 | 11 | if [ "$(echo "17 > $SHILLER_PE" | bc -l)" -eq 1 ]; then 12 | ICON="💸 " 13 | COLOR=green 14 | elif [ "$(echo "21 > $SHILLER_PE" | bc -l)" -eq 1 ]; then 15 | ICON="💵 " 16 | COLOR=orange 17 | else 18 | ICON="" 19 | COLOR=black 20 | fi 21 | 22 | echo "${ICON}$SHILLER_PE | color=${COLOR}" 23 | echo "---" 24 | echo "Current Shiller PE ${SHILLER_PE} | color=${COLOR}" 25 | echo "See chart | href=https://www.multpl.com/shiller-pe" 26 | -------------------------------------------------------------------------------- /Finance/stock.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stock Info 4 | # 1.0 5 | # clark 6 | # flyingtimes 7 | # use baidu stock api to monitor stock price. the price only show up in market time. 8 | 9 | if [ "$(date +%H)" -lt 9 ]; then 10 | echo "not trade time|color=red" 11 | exit 12 | fi 13 | if [ "$(date +%H)" -gt 15 ]; then 14 | echo "not trade time|color=red" 15 | exit 16 | fi 17 | if [ "$(date +%w)" -gt 5 ]; then 18 | echo "not trade time|color=red" 19 | exit 20 | fi 21 | if [ "$(date +%w)" -eq 0 ]; then 22 | echo "not trade time|color=red" 23 | exit 24 | fi 25 | 26 | # change folloing code to select your stock 27 | stocknum="sz000410" 28 | # apply for your own api key at http://apistore.baidu.com/apiworks/servicedetail/115.html 29 | apikey="apikey:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 30 | 31 | curl --get --include "http://apis.baidu.com/apistore/stockservice/stock?stockid=$stocknum&list=1" -H "$apikey" -s|grep "{"|awk -F "," '{print $4,$9,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36}'|awk -F ":| " '{printf"%s,%.2f,%.2f%|color=red\ns5:%.2f,%.0f|color=green\ns4:%.2f,%.0f|color=green\ns3:%.2f,%.0f|color=green\ns2:%.2f,%.0f|color=green\ns1:%.2f,%.0f|color=green\nb1:%.2f,%.0f|color=red\nb2:%.2f,%.0f|color=red\nb3:%.2f,%.0f|color=red\nb4:%.2f,%.0f|color=red\nb5:%.2f,%.0f|color=red\n",$2,$4,$6,$46,$44,$42,$40,$38,$36,$34,$32,$30,$28,$10,$8,$14,$12,$18,$16,$22,$20,$26,$24}' 32 | -------------------------------------------------------------------------------- /Games/baj.2m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # BAJ 3 | # v1.0 4 | # Justin Honold 5 | # astrostl 6 | # Checks for active turns at http://www.boiteajeux.net/ every two minutes 7 | # https://cloud.githubusercontent.com/assets/1126471/12343875/45b78bbe-bafd-11e5-960f-33b77c5d3e41.png 8 | # 9 | 10 | baj_login='LOGIN' 11 | baj_password='PASSWORD' 12 | 13 | url="http://www.boiteajeux.net/gestion.php" 14 | data="pAction=login&password=${baj_password}&username=${baj_login}" 15 | 16 | fetch() { curl --cookie-jar - --data "$data" --location --silent "$url"; } 17 | extract() { sed -n '//{s/.*\[\([0-9]*\)\].*/\1/p;q;}'; } 18 | 19 | turns="$(extract < <(fetch))" 20 | 21 | if ((turns < 1)); then 22 | echo "BAJ: 0" 23 | else 24 | echo "BAJ: $turns | color=red" 25 | fi 26 | 27 | echo "---" 28 | echo "Play | href=http://www.boiteajeux.net/" 29 | -------------------------------------------------------------------------------- /Games/bgo.2m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>BGO</xbar.title> 3 | # <xbar.version>v1.0.1</xbar.version> 4 | # <xbar.author>Justin Honold</xbar.author> 5 | # <xbar.author.github>astrostl</xbar.author.github> 6 | # <xbar.desc>Checks for active turns at http://www.boardgaming-online.com/ every two minutes</xbar.desc> 7 | # <xbar.image>https://cloud.githubusercontent.com/assets/1126471/12794798/82c49950-ca7c-11e5-855b-b1c69a0f9f31.png</xbar.image> 8 | # <xbar.dependencies></xbar.dependencies> 9 | 10 | bgo_login='LOGIN' 11 | bgo_pass='PASSWORD' 12 | 13 | url="http://www.boardgaming-online.com/" 14 | data="&identifiant=${bgo_login}&mot_de_passe=${bgo_pass}" 15 | 16 | fetch() { curl --cookie-jar - --data "$data" --location --silent "$url"; } 17 | extract() { sed -n '/^nbp=/{s/nbp=\([0-9]*\);/\1/p;q;}'; } 18 | 19 | turns="$(extract < <(fetch))" 20 | 21 | if ((turns < 1)); then 22 | echo "BGO: 0" 23 | else 24 | echo "BGO: $turns | color=red" 25 | fi 26 | 27 | echo "---" 28 | echo "Play | href=http://www.boardgaming-online.com/" 29 | -------------------------------------------------------------------------------- /Lifestyle/Todo/noteplan-menubar-56px.b64: -------------------------------------------------------------------------------- 1 | iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAQAAAACj/OVAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAHdElNRQfkChwAHRNqrC5wAAABSElEQVRYw2NgGAWjYBRQCXAy8AIxnYAxw384NKKHhf9R4KiFoxYOpIXGDPxkWsjFYEKqZQ5Q476QYSFMRpfcYJtDgoU3yQvuZ2iG/mfwIsLCBgxdl8hLFhD4h0EMj4VKWPX8p8RCEHzPwILVwv84IZGgHY8RG9H4t/GodSU+FmPwGEMsVCI1axygwLIF5Gb+V2RY9oGy8oaV4R9J1rFQo5BLIdIyR2qWrBcJWLaL2nXELwIWnqCmZROJDNIsalgmT1KS+cMgTIllzCSmUAh8A0zZZIEXFGT8Y6Ra1kCFoq2IeOt24DEG3Skb8Khtprx6wlYfMjJ8pbR6wq8Zm6gwZRZextCoRUQTwx1D113yGlGrSWhEbSG3zapOQTPxO1RGhdSsIUd2y5uNQWa0bzFq4ciyMAjJOnF6jdXYMrgwmI6Oj42CUUAVAABntNYrW391eQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMC0xMC0yOFQwMDoyOToxOSswMDowMDOfhXoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjAtMTAtMjhUMDA6Mjg6MjMrMDA6MDCH/w5VAAAAAElFTkSuQmCC 2 | -------------------------------------------------------------------------------- /Lifestyle/Todo/todo.30s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # <xbar.author>z0mbix</xbar.author> 4 | # <xbar.author.github>z0mbix</xbar.author.github> 5 | # <xbar.title>Simple Todo Tracker</xbar.title> 6 | # <xbar.version>1.0</xbar.version> 7 | # 8 | # Track todos in a simple ~/.todo file 9 | # 10 | 11 | todo_file="$HOME/.todo" 12 | count=$(grep -c '[^[:space:]]' "$todo_file" | awk '{print $1}') 13 | echo "Todos: $count" 14 | echo "---" 15 | cat "$todo_file" 16 | -------------------------------------------------------------------------------- /Lifestyle/ZoomsToday/open-zoom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$1" ]; then 4 | open "$1" 5 | fi 6 | -------------------------------------------------------------------------------- /Lifestyle/bear-calls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.author>mreider</xbar.author> 3 | # <xbar.author.github>mreider</xbar.author.github> 4 | # <xbar.title>Handy bear calls</xbar.title> 5 | # <xbar.version>1.0</xbar.version> 6 | 7 | Replace these with your home page and bookmarks page 8 | 9 | HOMEPAGE='bear://x-callback-url/open-note?id=3B82C004-4B7D-4B66-A492-6D0F3EEDA40A-4300-00001FDE04293478' 10 | BOOKMARKS='bear://x-callback-url/open-note?id=68496A87-42BE-479A-AE9C-3117CB1CB9FB-31243-00045FA30CF5DC43' 11 | 12 | rawurlencode() { 13 | local string="${1}" 14 | local strlen=${#string} 15 | local encoded="" 16 | local pos c o 17 | 18 | for (( pos=0 ; pos<strlen ; pos++ )); do 19 | c=${string:$pos:1} 20 | case "$c" in 21 | [-_.~a-zA-Z0-9] ) o="${c}" ;; 22 | * ) printf -v o '%%%02x' "'$c" 23 | esac 24 | encoded+="${o}" 25 | done 26 | echo "${encoded}" # You can either set a return variable (FASTER) 27 | REPLY="${encoded}" #+or echo the result (EASIER)... or both... :p 28 | } 29 | 30 | 31 | echo "🐻" 32 | echo "---" 33 | HOMEPAGE_LINK='[Home Page]('$HOMEPAGE')' 34 | HOMEPAGE_ENCODED=$( rawurlencode "$HOMEPAGE_LINK" ) 35 | TITLE='Notes For '$(date +"%a %b %d %Y") 36 | TITLE_ENCODED=$( rawurlencode "$TITLE" ) 37 | DATE_WITH_HOME_LINK='bear://x-callback-url/create?title='$TITLE_ENCODED'&text='$HOMEPAGE_ENCODED 38 | echo "Open home page | href=$HOMEPAGE" 39 | echo "Open bookmarks | href=$BOOKMARKS" 40 | echo "New note with date & home link | href=$DATE_WITH_HOME_LINK" 41 | 42 | 43 | -------------------------------------------------------------------------------- /Lifestyle/church-liturgical-calendar.1h.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Church of England Liturgical Calendar</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Christian Selvaratnam</xbar.author> 6 | # <xbar.author.github>cselvaratnam</xbar.author.github> 7 | # <xbar.desc>Displays the title of the church season or festival of the day and the Collect of the Day from the Church of England website.</xbar.desc> 8 | # <xbar.image>https://github.com/cselvaratnam/images/blob/6c68f941510460f27aca9677389f155f3abe6891/church-liturgical-calendar.png</xbar.image> 9 | # <xbar.dependencies>bash</xbar.dependencies> 10 | # <xbar.abouturl>https://bio.site/selvaratnam</xbar.abouturl> 11 | 12 | # Collect the front page of the Church of England website 13 | web=$(curl -f -s -S https://www.churchofengland.org/) 14 | 15 | # Extract the season/festival title from the Prayer for the Day 16 | full_title=$(echo $web | sed 's/.*<div class="textfill-footer">.*<small>\(.*\)<\/small>.*/\1/') 17 | 18 | # Make short version of the title 19 | short_title=$(echo $full_title | sed -e 's/^The //' -e 's/Blessed Virgin Mary/BVM/' -e 's/ (.*$//' -e 's/,.*//') 20 | 21 | # Extract the Collect of the Day and reformat 22 | collect=$(echo $web | sed -e 's/.*<div class="textfill-footer">.*<p>\(.*\)<\/p>.*/\1/' -e 's/<br \/>/\\r/g' -e 's/\\r /\\r/g') 23 | 24 | printf "%s\n" "$short_title" 25 | echo "---" 26 | printf "%s\n" "$full_title" 27 | printf "%s\n" "$collect" 28 | echo "Refresh | refresh=true" 29 | -------------------------------------------------------------------------------- /Lifestyle/current_task.1m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | # 3 | # <xbar.author>voter101</xbar.author> 4 | # <xbar.author.github>voter101</xbar.author.github> 5 | # <xbar.title>Current Task</xbar.title> 6 | # <xbar.version>1.0</xbar.version> 7 | # 8 | # You need to call it with string argument to change a task like this: 9 | # `./current_task.1m.rb "Finish important business"` 10 | # 11 | # The task is stored in a file 12 | 13 | TASK_FILE_NAME = File.dirname(__FILE__) + "/task" 14 | 15 | `touch #{TASK_FILE_NAME}` 16 | 17 | def change_task(task) 18 | File.write(TASK_FILE_NAME, task) 19 | end 20 | 21 | def read_task 22 | puts IO.read(TASK_FILE_NAME) 23 | end 24 | 25 | if ARGV[0].nil? 26 | read_task 27 | else 28 | change_task(ARGV[0]) 29 | end 30 | -------------------------------------------------------------------------------- /Lifestyle/dadjokes.5m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Dad Jokes</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Simon Peier</xbar.author> 6 | # <xbar.author.github>simonpeier</xbar.author.github> 7 | # <xbar.desc>The plugin tells you random dad jokes</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/simonpeier/bitbar-dadjokes-plugin/master/screenshot.png</xbar.image> 9 | # <xbar.dependencies>bash</xbar.dependencies> 10 | # <xbar.abouturl>https://simonpeier.github.io/bitbar-dadjokes-plugin/</xbar.abouturl> 11 | 12 | joke=$(curl -s -H "Accept: text/plain" https://icanhazdadjoke.com/) 13 | 14 | echo "😂" 15 | echo "---" 16 | echo "Next joke | refresh=true" 17 | echo "---" 18 | 19 | echo " |trim=false" 20 | echo "$joke" 21 | echo " |trim=false" 22 | -------------------------------------------------------------------------------- /Lifestyle/githubzen.1m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>GitHub Zen</xbar.title> 4 | # <xbar.version>v1.1.0</xbar.version> 5 | # <xbar.author>Josh</xbar.author> 6 | # <xbar.author.github>andjosh</xbar.author.github> 7 | # <xbar.desc>GitHub zen in your menu bar!</xbar.desc> 8 | # <xbar.dependencies>python</xbar.dependencies> 9 | # <xbar.image>http://i.imgur.com/U4OHxDm.png</xbar.image> 10 | 11 | from urllib.request import urlopen 12 | 13 | url = 'https://api.github.com/zen' 14 | body = urlopen(url).read() 15 | print(body.decode('utf-8')) 16 | -------------------------------------------------------------------------------- /Lifestyle/memento_mori.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Memento Mori</xbar.title> 4 | # <xbar.version>1.1</xbar.version> 5 | # <xbar.author>Sufiyan Yasa</xbar.author> 6 | # <xbar.author.github>xr1337</xbar.author.github> 7 | # <xbar.desc>Memento Mori - Remember, thou art mortal</xbar.desc> 8 | # <xbar.dependencies>python</xbar.dependencies> 9 | # <xbar.image>https://www.sufiyanyasa.com/img/avatar.jpg</xbar.image> 10 | 11 | from datetime import datetime as dt 12 | from datetime import timedelta 13 | 14 | # example 25/12/2011 15 | birthday = "<YOUR BIRTHDAY>" 16 | end_age = 77 17 | 18 | birthday_date = dt.strptime(birthday, "%d/%m/%Y") 19 | end_date = birthday_date + timedelta(days=end_age * 365) 20 | days_left = (end_date - dt.now()).days 21 | print(('- {} days left -'.format(days_left))) 22 | -------------------------------------------------------------------------------- /Lifestyle/sleepingtime.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>sleepingtime</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Matteo Ferrando</xbar.author> 6 | # <xbar.author.github>chamini2</xbar.author.github> 7 | # <xbar.desc>Show the next sleeping cycles if we fell asleep in `falling_asleep` minutes.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/JTqosty.png</xbar.image> 9 | 10 | # Time in minutes to fall asleep; the mean is 15 minutes 11 | falling_asleep=15 12 | 13 | # Range of cycles to show in the menu 14 | start_cycle=1 15 | end_cycle=7 16 | 17 | # The length of a cycle **in minutes**, standard value is 90 18 | length=90 19 | 20 | # Format with local time format (12 or 24 hours) 21 | format='%H:%M' 22 | 23 | # Display everything in local time format 24 | echo "💤" 25 | echo '---' 26 | 27 | for ((cy=start_cycle; cy<=end_cycle; cy++)); do 28 | # Add 1 hour and 30 minutes every cycle 29 | h=$(((length * cy) / 60)) 30 | m=$(((length * cy) % 60)) 31 | 32 | if [[ $cy -gt 1 ]]; then 33 | str="$cy cycles:" 34 | else 35 | str="$cy cycle: " 36 | fi 37 | echo "$str $(date -v+${h}H -v+${m}M -v+${falling_asleep}M +${format})" 38 | done 39 | -------------------------------------------------------------------------------- /Lifestyle/time_on_earth.10m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # <xbar.title>Your time on earth</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Tim Regener</xbar.author> 6 | # <xbar.author.github>timlapluie</xbar.author.github> 7 | # <xbar.desc>Displays the time you are already living.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/EzUARsL.png</xbar.image> 9 | # <xbar.dependencies>ruby</xbar.dependencies> 10 | 11 | # --------------------- # 12 | # EDIT THESE VARIABLES. # 13 | # --------------------- # 14 | 15 | # Add your Birthday here 16 | # Format: 'YYYY-MM-DD [hh:mm (optional)] [UTC Offset (optional)]' 17 | BIRTHDAY = '1988-01-12 11:42 +01:00' 18 | 19 | # -------------------------------------------------------- # 20 | # DON'T EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING. # 21 | # -------------------------------------------------------- # 22 | require 'date' 23 | 24 | birth_time = DateTime.parse(BIRTHDAY) 25 | time_now = DateTime.now 26 | delta = time_now - birth_time 27 | 28 | days = delta.to_i 29 | 30 | hours = (delta * 24) 31 | minutes = (hours % 1) * 60 32 | seconds = (minutes % 1) * 60 33 | 34 | def format_int(number) 35 | number.to_i.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse 36 | end 37 | 38 | puts "#{format_int(days)} days on 🌍" 39 | puts '---' 40 | puts "Impressive! That's #{format_int(hours)} hours, #{format_int(minutes)} minutes, #{format_int(seconds)} seconds." 41 | -------------------------------------------------------------------------------- /Lifestyle/todoist.1m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Todoist Today</xbar.title> 4 | # <xbar.version>v2.2.0</xbar.version> 5 | # <xbar.author>K.Kobayashi, et al</xbar.author> 6 | # <xbar.author.github>kobayashi,gingerbeardman</xbar.author.github> 7 | # <xbar.desc>Today's task in your menu bar!</xbar.desc> 8 | # <xbar.dependencies>python</xbar.dependencies> 9 | # <xbar.image>http://i.imgur.com/f37VtAg.png</xbar.image> 10 | 11 | import sys 12 | from urllib.request import urlopen, Request 13 | from urllib.parse import urlencode 14 | import json 15 | import datetime 16 | 17 | api_key = '' 18 | url = 'https://api.todoist.com/sync/v8/sync' 19 | value = { 'token': api_key, 'sync_token': '*', 'resource_types': '["all"]' } 20 | data = urlencode(value).encode('utf-8') 21 | 22 | d = datetime.datetime.today() 23 | today = d.strftime("%Y-%m-%d") 24 | comment = "Today's task: " 25 | 26 | if len(api_key) == 0: 27 | print("set api first") 28 | else: 29 | try: 30 | request = Request(url, data) 31 | r = urlopen(request) 32 | j = json.loads(r.read()) 33 | items = j['items'] 34 | for item in items: 35 | if (item['due']): 36 | due = item['due']['date'] # due date of a task 37 | if (due.startswith(today)): 38 | if ("T" in due): 39 | time = "@%s " % due[-8:-3] 40 | else: 41 | time = "" 42 | print((comment + time + item['content']).encode('utf-8')) 43 | finally: 44 | r.close() 45 | 46 | -------------------------------------------------------------------------------- /Lifestyle/write-into-menubar-bitbar-plugin.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BitBar Metadata 3 | # <xbar.title>Write into Menubar</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Yiğit Konur</xbar.author> 6 | # <xbar.author.github>Yiğit Konur</xbar.author.github> 7 | # <xbar.desc>Write what ever you want into your Menubar.</xbar.desc> 8 | # <xbar.image>https://cldup.com/myKD3KqgCA-3000x3000.png</xbar.image> 9 | # Thank you Jan Groß to inspire me by random quote extension to create my first plugin. 10 | 11 | max_chars="30" 12 | quote_color="black" 13 | 14 | 15 | # You need to install Alfred Powerpacks and my Alfred Workflow to use this plugin. 16 | # You can get details at my repo: https://github.com/yigitkonur/write-into-menubar 17 | 18 | echo "Hello world! | color=$quote_color length=$max_chars" -------------------------------------------------------------------------------- /Lifestyle/zoom_shortcuts.1d.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Zoom</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Ruslan Potekhin</xbar.author> 6 | # <xbar.author.github>dievskiy</xbar.author.github> 7 | # <xbar.image>https://imgur.com/8ca2kvC.png</xbar.image> 8 | # <xbar.desc>Plugin to open zoom meetings quickly</xbar.desc> 9 | 10 | links=() 11 | names=() 12 | 13 | if [[ ! -d "$(pwd)/zoom_data" ]]; then 14 | mkdir "$(pwd)/zoom_data" 15 | fi 16 | 17 | if [[ ! -s "$(pwd)/zoom_data/links.txt" ]]; then 18 | cat <<EOF > "$(pwd)/zoom_data/links.txt" 19 | # File to parse meetings data from. This file should end with a blank line 20 | # put a name and a link delimited by "|", for link only confno parameter should be changed 21 | # example: 22 | # Weekly Meeting | company.zoom.us/join?confno=XXXXXXXXXXX 23 | EOF 24 | fi 25 | 26 | 27 | while IFS= read -r line; do 28 | # skip comments 29 | if [[ $line != \#* ]]; then 30 | l="$(cut -d '|' -f 2 <<< "$line")" 31 | name="$(cut -d '|' -f 1 <<< "$line")" 32 | links+=("$l") 33 | names+=("$name") 34 | fi 35 | done <"$(pwd)/zoom_data/links.txt" 36 | 37 | echo "Zoom | color=#666666" 38 | echo "---" 39 | for i in "${!links[@]}"; do 40 | name="${names[$i]}" 41 | trimmed_string=$(echo "${links[$i]}" | xargs) 42 | printf '%s\n' "$name | color=black shell=/usr/bin/open param1=zoommtg://$trimmed_string" 43 | done 44 | 45 | echo "---" 46 | echo "Configure | color=black shell=/usr/bin/open param1=\"$(pwd)/zoom_data/links.txt\"" 47 | -------------------------------------------------------------------------------- /Music/mpd-control.20s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>mpd-control</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Slamet Kristanto</xbar.author> 6 | # <xbar.author.github>drselump14</xbar.author.github> 7 | # <xbar.desc>MPD control (mopidy spotify, mopidy soundcloud , etc)</xbar.desc> 8 | # <xbar.image>https://www.dropbox.com/s/cgkjb7hv6s1yx1a/Screenshot%202017-02-08%2020.40.02.png?raw=1</xbar.image> 9 | # <xbar.dependencies>mpd, mpc</xbar.dependencies> 10 | 11 | count="$( /usr/local/bin/mpc | wc -l )" 12 | 13 | if [ "$count" -gt 2 ] 14 | then 15 | echo "$(/usr/local/bin/mpc | head -1) | bash='/usr/local/bin/mpc' param1=toggle terminal=false length=25 size=12" 16 | else 17 | echo "" 18 | fi 19 | -------------------------------------------------------------------------------- /Music/spotify-next.1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Switch Spotify to the next track in one click. 4 | # 5 | # by Aleksei Sotnikov (asotnikov.100@gmail.com) 6 | # metadata 7 | # <xbar.title>Spotify "Next track" button</xbar.title> 8 | # <xbar.version>v1.0</xbar.version> 9 | # <xbar.author>Aleksei Sotnikov</xbar.author> 10 | # <xbar.author.github>alekseysotnikov</xbar.author.github> 11 | # <xbar.desc>Switch Spotify to the next track in one click. Or you can easily reconfigure it for switching to the previous track.</xbar.desc> 12 | # <xbar.image>https://i.imgur.com/523Eszv.png</xbar.image> 13 | 14 | case "$1" in 15 | 'previous track' | 'next track') 16 | osascript -e "tell application \"Spotify\" to $1" 17 | exit 18 | esac 19 | 20 | echo "▶▶ | bash='$0' param1='next track' terminal=false refresh=false" 21 | -------------------------------------------------------------------------------- /Music/spotify-pause.9999d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Play/pause Spotify button 4 | # 5 | # by Aleksei Sotnikov (asotnikov.100@gmail.com) 6 | # thanks for contribution by Doug Cotler (dcotler@seas.upenn.edu) 7 | # metadata 8 | # <xbar.title>Spotify play/pause button</xbar.title> 9 | # <xbar.version>v1.1</xbar.version> 10 | # <xbar.author>Aleksei Sotnikov</xbar.author> 11 | # <xbar.author.github>alekseysotnikov</xbar.author.github> 12 | # <xbar.desc>Play or pause Spotify in one click</xbar.desc> 13 | # <xbar.image>https://i.imgur.com/kLaa2uz.png</xbar.image> 14 | # <xbar.dependencies>bash</xbar.dependencies> 15 | 16 | function tellspotify() { 17 | osascript -e "tell application \"Spotify\" to $1" 18 | } 19 | 20 | case "$1" in 21 | 'playpause' ) 22 | tellspotify "$1" 23 | exit 24 | esac 25 | 26 | state=$(tellspotify 'player state as string'); 27 | 28 | if [ "$state" = "playing" ]; then 29 | state_icon="❚❚" 30 | else 31 | state_icon="▶" 32 | fi 33 | 34 | echo "$state_icon | bash='$0' param1=playpause terminal=false refresh=false" -------------------------------------------------------------------------------- /Music/swinsian.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Swinsian</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Eddie Blundell</xbar.author> 6 | # <xbar.author.github>eddie</xbar.author.github> 7 | # <xbar.desc>View the current track name and artist from the Swinsian music player.</xbar.desc> 8 | # <xbar.dependencies>applescript</xbar.dependencies> 9 | 10 | osascript <<'END' 11 | tell application "Swinsian" 12 | 13 | -- get the currently playing track 14 | set thetrack to current track 15 | 16 | -- get properties of the track 17 | set trackname to name of thetrack 18 | set trackartist to artist of thetrack 19 | set trackalbum to album of thetrack 20 | 21 | set info to "" & trackname & " by " & trackartist & " on " & trackalbum 22 | return info 23 | end tell 24 | END 25 | -------------------------------------------------------------------------------- /Network/SSH-Remotes.1d.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>SSH Remotes</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Johannes Strodel</xbar.author> 6 | # <xbar.author.github>John-Sane</xbar.author.github> 7 | # <xbar.desc>Manage your Remote Servers with ease. Choose your preferred Terminal. Open a SSH connection with one click! Just list your remotes in the scripts HOSTARRAY variable :) </xbar.desc> 8 | # <xbar.image></xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | # <xbar.var>select(TERMINAL="Terminal"): Choose your terminal (emulation) - iTerm2 is not supported yet. [Terminal, Hyper]</xbar.var> 11 | 12 | 13 | # Enter your remote hosts here 14 | # Schema: "Display Name:user@remote.adress.com" 15 | 16 | HOSTARRAY=( 17 | "Example Remote 1:root@example.com" 18 | "Example Remote 2:user@192.168.0.2" 19 | ) 20 | 21 | 22 | function process_arr () { 23 | declare -a hash=("${!1}") 24 | for host in "${hash[@]}"; do 25 | echo "${host%%:*} | bash=/usr/bin/open param1=-a param2='$TERMINAL.app' param3=ssh://${host#*:}" 26 | done 27 | } 28 | 29 | echo "SSH | color='white'" 30 | echo "---" 31 | 32 | process_arr HOSTARRAY[@] 33 | -------------------------------------------------------------------------------- /Network/aria2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Quickly aria2c 4 | # 5 | # <xbar.title>aria2c</xbar.title> 6 | # <xbar.version>v1.0</xbar.version> 7 | # <xbar.author>cnsworder</xbar.author> 8 | # <xbar.author.github>cnsworder</xbar.author.github> 9 | # <xbar.desc>Quickly aria2c</xbar.desc> 10 | 11 | echo "aria2c" 12 | echo "---" 13 | count=$(pgrep "aria2c") 14 | if ((count < 1)); then 15 | echo 'not running | bash=aria2c param1="-D --enable-rpc --rpc-allow-origin-all --rpc-listen-all -c -x 10 -s 10"' 16 | else 17 | echo 'runing | color=green href="http://ziahamza.github.io/webui-aria2/"' 18 | fi 19 | -------------------------------------------------------------------------------- /Network/bandwidth-test-min.2h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Bandwith test, using speedtest-cli (https://github.com/sivel/speedtest-cli) 4 | # Mini version! 5 | # 6 | # <xbar.title>Bandwith test (minified)</xbar.title> 7 | # <xbar.version>v1.0</xbar.version> 8 | # <xbar.author>Jonny Lin</xbar.author> 9 | # <xbar.author.github>rangedsp</xbar.author.github> 10 | # <xbar.desc>Modified mini version of Alexandre Espinosa Menor's Bandwith tester, which uses https://speedtest.net via speedtest-cli</xbar.desc> 11 | # <xbar.dependencies>speedtest-cli</xbar.dependencies> 12 | # <xbar.image>http://i.imgur.com/mrPw9MV.png</xbar.image> 13 | # 14 | # Dependencies: 15 | # speedtest-cli (https://github.com/sivel/speedtest-cli) 16 | 17 | # modify this path according your prefs 18 | 19 | if command -v "/usr/local/bin/speedtest-cli" >/dev/null 2>&1; then 20 | OUTPUT=$(/usr/local/bin/speedtest-cli --simple) 21 | else 22 | OUTPUT=$(~/bin/speedtest-cli --simple) 23 | fi 24 | 25 | result_string="${OUTPUT/Ping: /P:}" 26 | result_string="${result_string/Download: /D:}" 27 | result_string="${result_string/Upload: /U:}" 28 | result_string="${result_string/ Mbit/Mb}" 29 | result_string="${result_string/ Mbit/Mb}" 30 | result_string="${result_string/ ms/ms}" 31 | echo "$result_string" 32 | -------------------------------------------------------------------------------- /Network/bandwidth-test.2h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Bandwith test, using speedtest-cli (https://github.com/sivel/speedtest-cli) 4 | # 5 | # <xbar.title>Bandwith test</xbar.title> 6 | # <xbar.version>v1.0</xbar.version> 7 | # <xbar.author>Alexandre Espinosa Menor</xbar.author> 8 | # <xbar.author.github>alexandregz</xbar.author.github> 9 | # <xbar.desc>Bandwith tester, from https://speedtest.net using speedtest-cli</xbar.desc> 10 | # <xbar.dependencies>speedtest-cli</xbar.dependencies> 11 | # <xbar.image>http://i.imgur.com/mrPw9MV.png</xbar.image> 12 | # 13 | # Dependencies: 14 | # speedtest-cli (https://github.com/sivel/speedtest-cli) 15 | 16 | # modify this path according your prefs 17 | if command -v "/usr/local/bin/speedtest-cli" >/dev/null 2>&1; then 18 | OUTPUT=$(/usr/local/bin/speedtest-cli --simple) 19 | else 20 | OUTPUT=$(~/bin/speedtest-cli --simple) 21 | fi 22 | 23 | echo "$OUTPUT" 24 | -------------------------------------------------------------------------------- /Network/bandwidth.1s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Bandwidth</xbar.title> 4 | # <xbar.version>v0.0.0</xbar.version> 5 | # <xbar.author>Ant Cosentino</xbar.author> 6 | # <xbar.author.github>skibz</xbar.author.github> 7 | # <xbar.desc>Displays TX and RX bitrate of your main ethernet interface in the status bar and hides other interfaces in the context menu.</xbar.desc> 8 | # <xbar.dependencies>ifstat</xbar.dependencies> 9 | # <xbar.image>https://cloud.githubusercontent.com/assets/2462211/12748504/584bbcea-c9b3-11e5-8109-ad8fdcefdc75.png</xbar.image> 10 | 11 | export PATH="/usr/local/bin:${PATH}" 12 | INTERFACES=$(ifconfig -lu) 13 | 14 | echo "▼ $(ifstat -n -w -i en0 0.1 1 | tail -n 1 | awk '{print $1, " - ", $2;}') ▲" 15 | echo "---" 16 | for INTERFACE in ${INTERFACES}; do 17 | if [[ ${INTERFACE} != "en0" ]]; then 18 | echo "${INTERFACE}: ▼ $(ifstat -n -w -i "${INTERFACE}" 0.1 1 | tail -n 1 | awk '{print $1, " - ", $2;}') ▲" 19 | fi 20 | done 21 | -------------------------------------------------------------------------------- /Network/bluetooth_connection.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # <xbar.title>Bluetooth Connection Indicator</xbar.title> 4 | # <xbar.version>v1.0.0</xbar.version> 5 | # <xbar.author>Simon Gray</xbar.author> 6 | # <xbar.author.github>simongray</xbar.author.github> 7 | # <xbar.desc>Indicate in the menu bar if a bluetooth device is connected.</xbar.desc> 8 | # <xbar.image>https://github-production-user-asset-6210df.s3.amazonaws.com/5545555/239931189-6f427aec-b9c4-4ab0-b442-7a16050431cb.png</xbar.image> 9 | # <xbar.dependencies>blueutil</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/simongray</xbar.abouturl> 11 | 12 | # Note: requires blueutil 13 | # Install with `brew install blueutil` 14 | 15 | export PATH='/usr/local/bin:/usr/bin:$PATH' 16 | 17 | # Fixes missing Bluetooth connection status in macOS Big Sur 18 | if [[ $(blueutil --connected) == *", paired"* ]] 19 | then 20 | echo 🔹BT 21 | else 22 | echo N/A 23 | fi 24 | -------------------------------------------------------------------------------- /Network/emoji-active-network-interface.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Emoji Active Network Interface Indicator</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Zachary O. Toups</xbar.author> 6 | # <xbar.author.github>toupsz</xbar.author.github> 7 | # <xbar.desc>Displays an emoji to indicate if the active network interface is wifi or another connection.</xbar.desc> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.abouturl>https://github.com/toupsz/emoji-active-network-interface-indicator</xbar.abouturl> 10 | 11 | # Text above --- displays an antenna emoji if the active network interface name contains "Wi-Fi", shows a plug otherwise. 12 | 13 | # Get the active network metadata 14 | ActiveNetwork=$(route get default | grep interface | awk '{print $2}') 15 | 16 | # Get the name of the active network from the metadata 17 | ActiveNetworkName=$(networksetup -listallhardwareports | grep -B 1 "$ActiveNetwork" | awk '/Hardware Port/{ print }'|cut -d " " -f3-) 18 | 19 | # Select an emoji based on the name 20 | if [[ $ActiveNetworkName = *"Wi-Fi"* ]]; then 21 | echo "📡" 22 | else 23 | echo "🔌" 24 | fi 25 | -------------------------------------------------------------------------------- /Network/external-ip-1.0.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>My External IP</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>CodinCafe</xbar.author> 6 | # <xbar.author.github>codincafe</xbar.author.github> 7 | # <xbar.desc>This plugin will show your current external / public IP and allow you to copy the same to clipboard</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/Ar1JABA.png</xbar.image> 9 | # <xbar.dependencies>curl</xbar.dependencies> 10 | 11 | echo "🌎" 12 | echo '---' 13 | 14 | if [ $(curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s) == "200" ]; then 15 | OUTPUT=$(curl -s https://ipinfo.io/ip) 16 | result_string="$OUTPUT | bash='/bin/bash' param1='-c' param2='/bin/echo $OUTPUT | pbcopy' terminal=false"; 17 | else 18 | result_string="No Internet Connection" 19 | fi 20 | 21 | echo "$result_string" 22 | echo --- 23 | echo "Refresh... | refresh=true" 24 | -------------------------------------------------------------------------------- /Network/external-ip.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>external-ip</xbar.title> 4 | # <xbar.author>Mat Ryer</xbar.author> 5 | # <xbar.author.github>matryer</xbar.author.github> 6 | # <xbar.desc>Gets the current external IP address.</xbar.desc> 7 | 8 | EXTERNAL_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) 9 | 10 | if [ "$1" = "copy" ]; then 11 | # Copy the IP to clipboard 12 | echo -n "$EXTERNAL_IP" | pbcopy 13 | fi 14 | 15 | echo "$EXTERNAL_IP" 16 | echo "---" 17 | echo "(External IP address)" 18 | echo "Copy IP | terminal=false bash='$0' param1=copy" 19 | -------------------------------------------------------------------------------- /Network/got-internet.2s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Got Internet?</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Fregante</xbar.author> 5 | # <xbar.author.github>fregante</xbar.author.github> 6 | # <xbar.desc>Checks the connection to Internet and tells you in a single character.</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/I8lF8st.png</xbar.image> 8 | 9 | ping_timeout=1 #integers only, ping's fault 10 | ping_address=8.8.8.8 11 | 12 | if ! ping -c 1 -t $ping_timeout -q $ping_address > /dev/null 2>&1; then 13 | echo "✧|color=#f23400 dropdown=false" 14 | echo "---" 15 | echo "You're offline" 16 | # echo "Ping to Google DNS failed" 17 | else 18 | echo "✦|dropdown=false" 19 | echo "---" 20 | echo "You're online" 21 | fi 22 | -------------------------------------------------------------------------------- /Network/internal-ip.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>internal-ip</xbar.title> 4 | # <xbar.author>Mat Ryer</xbar.author> 5 | # <xbar.author.github>matryer</xbar.author.github> 6 | # <xbar.desc>Gets the current internal IP address, and shows more information in the details.</xbar.desc> 7 | # <xbar.version>1.0</xbar.version> 8 | 9 | ifconfig | grep -e "^en" | sort -u | while read line ; do 10 | ACTIVE_ADAPTER=$(echo $line | awk -F: '{print $1}') 11 | INTERNAL_IP_ADDRESS=$(ifconfig $ACTIVE_ADAPTER | grep "inet " | awk '{print $2}') 12 | if [ -n "$INTERNAL_IP_ADDRESS" ]; then 13 | echo $INTERNAL_IP_ADDRESS 14 | echo "---" 15 | echo "(Internal IP address)" 16 | echo "---" 17 | ifconfig ${ACTIVE_ADAPTER} 18 | 19 | break 20 | fi 21 | done 22 | -------------------------------------------------------------------------------- /Network/ip-flag.2m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # <xbar.title>External IP country flag emoji</xbar.title> 4 | # <xbar.version>v1.5 beta 1</xbar.version> 5 | # <xbar.author>Bruce Steedman</xbar.author> 6 | # <xbar.author.github>MatzFan</xbar.author.github> 7 | # <xbar.desc>Displays country flag emoji - e.g. for VPN use</xbar.desc> 8 | # <xbar.dependencies>OS X 10.11</xbar.dependencies> 9 | 10 | require 'open-uri' 11 | require 'json' 12 | 13 | begin 14 | cc = JSON.load(open('http://ip-api.com/json')) 15 | country_code = cc['countryCode'].chomp.split '' 16 | c1, c2 = *country_code.map { |c| (c.ord + 0x65).chr.force_encoding 'UTF-8' } 17 | puts "\xF0\x9F\x87#{c1}\xF0\x9F\x87#{c2}" 18 | puts "---" 19 | puts "Public IP : " + cc['query'] 20 | puts "ISP : " + cc['isp'] 21 | rescue StandardError => err 22 | puts "🚩" 23 | puts "---" 24 | puts err.to_s 25 | end 26 | -------------------------------------------------------------------------------- /Network/isccond.5m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # disabling a linter check which doesn't like unquoted tr 4 | # shellcheck disable=SC2060 5 | 6 | # <xbar.title>ISC Condition Monitor</xbar.title> 7 | # <xbar.version>v1.0</xbar.version> 8 | # <xbar.author>panzertime</xbar.author> 9 | # <xbar.author.github>panzertime</xbar.author.github> 10 | # <xbar.desc>Gets ISC's condition code and displays it</xbar.desc> 11 | # <xbar.image></xbar.image> 12 | # <xbar.dependencies></xbar.dependencies> 13 | # <xbar.abouturl>https://github.com/panzertime/bitbar-plugins</xbar.abouturl> 14 | 15 | color=$(curl --silent -m 1 https://isc.sans.edu/infocon.txt | tr [a-z] [A-Z]) 16 | echo "ISC Cond ${color} | color=${color}" 17 | -------------------------------------------------------------------------------- /Network/network-location.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Show / Edit network location</xbar.title> 3 | # <xbar.version>v0.1</xbar.version> 4 | # <xbar.author>Florian Fittschen</xbar.author> 5 | # <xbar.author.github>ffittschen</xbar.author.github> 6 | # <xbar.desc>Displays the currently active network location and adds the ability to change it.</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/in3ZiPi.png</xbar.image> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.abouturl>https://github.com/matryer/bitbar-plugins/blob/master/Network/network-location.1h.sh</xbar.abouturl> 10 | 11 | current_location=$(networksetup -getcurrentlocation) 12 | network_locations=$(networksetup -listlocations) 13 | 14 | if [ ! -z "$1" ]; then 15 | networksetup -switchtolocation "$1" 16 | fi 17 | 18 | echo "📍 $current_location" 19 | echo '---' 20 | echo -n 'Current location: ' 21 | echo "$current_location" 22 | echo '---' 23 | echo 'Change to:' 24 | while IFS= read -r location; 25 | do 26 | if [ "${location}" != "${current_location}" ] 27 | then 28 | echo "${location} | bash=\"$0\" param1=\"$location\" terminal=false refresh=true" 29 | fi 30 | done <<< "$network_locations" 31 | -------------------------------------------------------------------------------- /Network/nord-vpn-status.js: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/node 2 | 3 | // <xbar.title>NordVPN Status</xbar.title> 4 | // <xbar.version>v1.0</xbar.version> 5 | // <xbar.author>Dustin McBride</xbar.author> 6 | // <xbar.author.github>dustinmcbride</xbar.author.github> 7 | // <xbar.desc>Your nordVPN protected status for bit bar</xbar.desc> 8 | // <xbar.image>https://raw.githubusercontent.com/dustinmcbride/bitbar-nord-vpn-status/master/screenshots/protected.png</xbar.image> 9 | // <xbar.dependencies>node</xbar.dependencies> 10 | // <xbar.abouturl>https://github.com/dustinmcbride/bitbar-nord-vpn-status</xbar.abouturl> 11 | 12 | 'use strict'; 13 | 14 | var nordUri = 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data'; 15 | var https = require('https'); 16 | 17 | function createOutput (res) { 18 | var titleMessage = res.status ? 'NordVPN | color=green' : '⛔ NordVPN | color=red'; 19 | var statusMessage = res.status ? 'Protected' : 'Unprotected'; 20 | 21 | console.log(titleMessage); 22 | console.log('---'); 23 | console.log('Status: ' + statusMessage); 24 | console.log('ISP: ' + res.isp); 25 | console.log('IP: ' + res.ip); 26 | } 27 | 28 | https.get(nordUri, function (res) { 29 | res.setEncoding('utf8'); 30 | var body = ''; 31 | res.on('data', function (data) { 32 | body += data; 33 | }); 34 | res.on('end', function () { 35 | createOutput(JSON.parse(body)); 36 | }); 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /Network/pia-vpn-status.5m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>PIA VPN Status</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Parvez</xbar.author> 5 | # <xbar.author.github>parvez</xbar.author.github> 6 | # <xbar.desc>Displays PIA VPN connection status</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/YqBwZed.png</xbar.image> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.abouturl>https://github.com/parvez/bitbar-plugins</xbar.abouturl> 10 | # 11 | # by Parvez 12 | pia1=$(curl --silent https://www.privateinternetaccess.com/pages/whats-my-ip/) 13 | pia2=$(echo "$pia1" | tr -d "\n" | /usr/local/bin/gsed -r "s/<script([^<]|<[^\/]|<\/[^s]|<\/s[^c])*<\/script>|<style([^<]|<[^\/]|<\/[^s]|<\/s[^t])*<\/style>//g" | grep -o '<div class="ipbox-footer">.*<div class="ipbox-map">' | /usr/local/bin/gsed -r "s/<[^>]*>//g" | /usr/local/bin/gsed -r "s/:\s+/: /g" | /usr/local/bin/gsed -r "s/\s\s+/\r\n/g") 14 | 15 | if [[ $pia1 == *"You are protected by PIA"* ]] 16 | then 17 | echo "✅" 18 | else 19 | echo "🚫" 20 | fi 21 | 22 | echo "---" 23 | echo "$pia2" 24 | -------------------------------------------------------------------------------- /Network/proxy_status.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Proxy Status and toggler 4 | # 5 | # <xbar.title>Proxy Status</xbar.title> 6 | # <xbar.version>v1.0</xbar.version> 7 | # <xbar.author>Cameron Currie</xbar.author> 8 | # <xbar.author.github>cwc</xbar.author.github> 9 | # <xbar.desc>Displays proxy status and allows toggling it on and off.</xbar.desc> 10 | # <xbar.image>http://i.imgur.com/7dEg9ki.png</xbar.image> 11 | 12 | interface="wi-fi" # You can also set this to e.g. "ethernet" 13 | 14 | proxy_type="SOCKS" 15 | proxy_get="-getsocksfirewallproxy" 16 | proxy_set="-setsocksfirewallproxystate" 17 | 18 | state=$(networksetup $proxy_get $interface | grep "No") 19 | 20 | if [ "$1" = 'toggle' ]; then 21 | # Prompts for the user's password, then toggles the SOCKS proxy state 22 | if [ -n "$state" ]; then 23 | networksetup $proxy_set $interface on 24 | else 25 | networksetup $proxy_set $interface off 26 | fi 27 | 28 | exit 29 | fi 30 | 31 | if [ -n "$state" ]; then 32 | state_icon="☐" 33 | action_toggle="Enable" 34 | else 35 | state_icon="☑" 36 | action_toggle="Disable" 37 | fi 38 | 39 | echo "$state_icon $proxy_type | dropdown=false" 40 | 41 | echo "---" 42 | 43 | echo "$action_toggle Proxy | bash='$0' param1=toggle terminal=false refresh=true" 44 | -------------------------------------------------------------------------------- /Network/ssh-status.10min.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # <xbar.title>SSH Status</xbar.title> 4 | # <xbar.version>v0.1.0</xbar.version> 5 | # <xbar.author>Olivier Tille</xbar.author> 6 | # <xbar.author.github>oliviernt</xbar.author.github> 7 | # <xbar.image>http://i.imgur.com/s8FMCLG.png</xbar.image> 8 | # <xbar.desc>Continuously checks if hosts are available for ssh connection</xbar.desc> 9 | # <xbar.dependencies>Bash</xbar.dependencies> 10 | # 11 | # SSH Status plugin 12 | # by Olivier Tille (@oliviernt) 13 | # 14 | # Continuously checks if hosts are available for ssh connection on port 22 15 | HOSTS=("example1.com" "example2.com") 16 | 17 | head="ssh status" 18 | body="" 19 | errors=0 20 | for host in "${HOSTS[@]}"; do 21 | if nc -z -G 2 "$host" 22 &> /dev/null; then 22 | body="$body\n☀️ $host is up | color=green bash=ssh param1=$host" 23 | else 24 | body="$body\n⛈ $host looks down from here | color=red bash=ssh param1=$host" 25 | errors=$((errors + 1)) 26 | fi 27 | body="$body\n---" 28 | done 29 | 30 | echo -n "$head" 31 | [ "$errors" -eq 0 ] || echo -n " ($((${#HOSTS[@]} - errors))/${#HOSTS[@]}) | color=red" 32 | echo -e "\n---" 33 | echo -e "$body" 34 | -------------------------------------------------------------------------------- /Network/ssh-tunnel.1s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Easily start/stop a background SSH forwarding connection 4 | # The list of hosts are extracted from ~/.ssh/config by default 5 | # 6 | # To connect to your favorit host, just click the host name 7 | # To disconnect the host, click the host name that is displayed as "(connecting)" 8 | # 9 | # <xbar.title>SSH Tunnel</xbar.title> 10 | # <xbar.version>v1.0</xbar.version> 11 | # <xbar.author>mutsune</xbar.author> 12 | # <xbar.author.github>mutsune</xbar.author.github> 13 | # <xbar.desc>Easily start/stop a background SSH forwarding connection.</xbar.desc> 14 | # <xbar.image>https://raw.githubusercontent.com/wiki/mutsune/bitbar-plugins/images/ssh-tunnel.png</xbar.image> 15 | # 16 | 17 | if pgrep -qf "ssh -fN"; then 18 | echo ":earth_americas:" 19 | else 20 | echo ":globe_with_meridians:" 21 | fi 22 | echo "---" 23 | 24 | # get host names that are specified forwarding options 25 | function hosts() { 26 | awk ' 27 | $1 == "Host" { 28 | host = $2; 29 | next; 30 | } 31 | $1 == "DynamicForward" || $1 == "LocalForward" { 32 | print host; 33 | } 34 | ' "$1" | uniq 35 | } 36 | 37 | for h in $(hosts ~/.ssh/config); do 38 | if pgrep -qf "ssh -fN ${h}"; then 39 | echo "(connecting) ${h} | color=indianred bash=/usr/bin/pkill param1='-f' param2='ssh -fN ${h}' terminal=false" 40 | else 41 | echo "${h} | bash=/usr/bin/ssh param1='-fN' param2=${h} terminal=false" 42 | fi 43 | done 44 | -------------------------------------------------------------------------------- /Network/ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # Quickly SSH to your favorite hosts 4 | # The list of hosts are extracted from ~/.ssh/config 5 | # 6 | # <xbar.title>SSH</xbar.title> 7 | # <xbar.version>v1.1</xbar.version> 8 | # <xbar.author>Thameera Senanayaka</xbar.author> 9 | # <xbar.author.github>thameera</xbar.author.github> 10 | # <xbar.desc>Quickly SSH to your favorite hosts listed in your ~/.ssh/config file</xbar.desc> 11 | # 12 | 13 | echo "ssh" 14 | echo "---" 15 | awk '/^Host / && !/\*/ {print $2" | shell=ssh param1="$2 " terminal=true"}' ~/.ssh/config 16 | -------------------------------------------------------------------------------- /Network/ssid_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>ssid-info</xbar.title> 3 | # <xbar.version>1.0</xbar.version> 4 | # <xbar.author>Örjan Berglin</xbar.author> 5 | # <xbar.author.github>orjanb</xbar.author.github> 6 | # <xbar.desc>Show the SSID of your current Wi-Fi connection. The SSID is green if the network is secure and red if it is an open network.</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/0kHyHnn.png</xbar.image> 8 | 9 | # Get ssid and auth type 10 | ssid=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}') 11 | auth=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ link auth/ {print substr($0, index($0, $3))}') 12 | 13 | color=green 14 | if [ "$auth" = "none" ]; then 15 | color=red 16 | else 17 | color=green 18 | fi 19 | 20 | echo "$ssid | color=$color " 21 | echo "---" 22 | echo "SSID: $ssid | color=$color" 23 | echo "Auth: $auth | color=$color" 24 | -------------------------------------------------------------------------------- /Network/viscosity-active-connection.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Viscosity active connection</xbar.title> 4 | # <xbar.desc>Shows the name of the first active connection</xbar.desc> 5 | # <xbar.version>v0.1</xbar.version> 6 | # <xbar.author>Adam Bogdał</xbar.author> 7 | # <xbar.author.github>bogdal</xbar.author.github> 8 | # <xbar.dependencies>bash,viscosity</xbar.dependencies> 9 | 10 | CONNECTION_NAME=$(osascript -e ' 11 | tell application "Viscosity" 12 | repeat with _connection in connections 13 | if the state of _connection is "Connected" then 14 | return name of _connection 15 | end if 16 | end repeat 17 | end tell 18 | ') 19 | 20 | if [ -n "$CONNECTION_NAME" ]; then 21 | echo "$CONNECTION_NAME | color=green" 22 | else 23 | echo "NoVPN | color=#b4b4b4" 24 | fi 25 | -------------------------------------------------------------------------------- /Network/vpn-check.3s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>VPN Checker</xbar.title> 4 | # <xbar.version>v1.2</xbar.version> 5 | # <xbar.author>Pierre-Louis Dubouilh</xbar.author> 6 | # <xbar.author.github>pldubouilh</xbar.author.github> 7 | # <xbar.desc>Checks the availability of tun0 or ipsec0. Also allows to kill a program on deconnection.</xbar.desc> 8 | 9 | # From my infamous one-liner 10 | # ((ifconfig | grep tun0) || (killall Firefox)) 11 | 12 | if ifconfig | grep -q tun0; then 13 | echo "VPN ⬆ | color=green" 14 | ifconfig utun0 2> /dev/null | grep inet | cut -d' ' -f 2 15 | elif ifconfig | grep -q ipsec0; then 16 | echo "VPN ⬆ | color=green" 17 | ifconfig ipsec0 2> /dev/null | grep inet | cut -d' ' -f 2 18 | else 19 | echo "VPN ⬇ | color=red" 20 | #killall Firefox 2&> /dev/null 21 | fi 22 | -------------------------------------------------------------------------------- /Network/vpn-country-flag.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env /usr/local/bin/node 2 | 3 | /* 4 | <xbar.title>VPN Country Flag</xbar.title> 5 | <xbar.version>v0.1</xbar.version> 6 | <xbar.author>Miguel Laginha</xbar.author> 7 | <xbar.author.github>brecke</xbar.author.github> 8 | <xbar.desc>It shows the country flag corresponding to your IP Address (useful when using VPNs).</xbar.desc> 9 | <xbar.image>https://user-images.githubusercontent.com/19879/30689083-d8e4d2bc-9eb7-11e7-8d83-d45a9079c287.png</xbar.image> 10 | <xbar.dependencies>node</xbar.dependencies> 11 | <xbar.abouturl>https://github.com/brecke/bitbar-vpn-flag</xbar.abouturl> 12 | */ 13 | 14 | var ipapi = require('ipapi.co'); 15 | var https = require('https'); 16 | var flag = require('country-code-emoji').flag; 17 | 18 | var IPAddress; 19 | https.get('https://ipapi.co/ip/', function(resp) { 20 | var body = ''; 21 | resp.on('data', function(data) { 22 | body += data; 23 | }); 24 | 25 | resp.on('end', function() { 26 | IPAddress = body; 27 | 28 | ipapi.location(function(country) { 29 | console.log(flag(country)); 30 | }, IPAddress.toString(), '', 'country'); 31 | }); 32 | }); 33 | 34 | 35 | -------------------------------------------------------------------------------- /Network/wakeonlan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>wakeonlan</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Shinya Fujino</xbar.author> 6 | # <xbar.author.github>morinokami</xbar.author.github> 7 | # <xbar.desc>Sends 'magic packets' to turn on a computer.</xbar.desc> 8 | # <xbar.dependencies>wakeonlan</xbar.dependencies> 9 | 10 | # Dependancies: 11 | # wakeonlan (brew install wakeonlan) 12 | 13 | export PATH="/usr/local/bin:$PATH" 14 | 15 | MAC_ADDRESS='01:23:45:67:89:AB' # Replace this with the target computer's MAC address 16 | COMMAND_PATH=$(command -v wakeonlan) 17 | 18 | echo 'WoL' 19 | echo '---' 20 | 21 | if [[ $COMMAND_PATH ]]; then 22 | echo "Turn on ${MAC_ADDRESS} | bash=/bin/bash param1=${COMMAND_PATH} param2=${MAC_ADDRESS} terminal=false" 23 | else 24 | echo 'wakeonlan not installed' 25 | fi 26 | -------------------------------------------------------------------------------- /Network/website-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>website-status</xbar.title> 3 | # <xbar.author>Marc Oehler</xbar.author> 4 | # <xbar.author.github>kemar220</xbar.author.github> 5 | # <xbar.desc>Gets the status of your website</xbar.desc> 6 | # <xbar.version>1.0</xbar.version> 7 | 8 | url='http://www.kemar.ch' # replace with your url 9 | 10 | code=$(curl -o /dev/null --silent --head --write-out '%{http_code}\n' $url) 11 | 12 | case "$code" in 13 | "200") 14 | echo "ok" 15 | ;; 16 | "301" | "302") 17 | echo "redirected" 18 | ;; 19 | *) 20 | echo "error" 21 | ;; 22 | esac 23 | 24 | echo "---" 25 | echo $url 26 | echo "http code $code" 27 | -------------------------------------------------------------------------------- /Network/wifiname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Active WIFI Name</xbar.title> 4 | # <xbar.author>Jiri</xbar.author> 5 | # <xbar.author.github>CzechJiri</xbar.author.github> 6 | # <xbar.desc>Displays currently connected WIFI Name</xbar.desc> 7 | 8 | WIFINAME=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}') 9 | 10 | echo "WIFI: $WIFINAME" 11 | -------------------------------------------------------------------------------- /Politics/parliament.uk-count.5m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Parliament.uk Count</xbar.title> 4 | # <xbar.version>v1.1.0</xbar.version> 5 | # <xbar.author>Keith Cirkel</xbar.author> 6 | # <xbar.author.github>keithamus</xbar.author.github> 7 | # <xbar.desc>See the vote count for a Parliament.uk petition</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/I38h0UJ.png</xbar.image> 9 | # <xbar.dependencies>python</xbar.dependencies> 10 | 11 | import json 12 | import urllib.request, urllib.error, urllib.parse 13 | import locale 14 | locale.setlocale(locale.LC_ALL, 'en_GB') 15 | 16 | id = '131215' 17 | name = 'EU 2nd Ref' 18 | constituents = False 19 | 20 | request = urllib.request.Request( 'https://petition.parliament.uk/petitions/' + id + '.json' ) 21 | response = urllib.request.urlopen( request ) 22 | data = json.load( response )['data']['attributes'] 23 | print(name + ': ' + locale.format_string('%d', data['signature_count'], grouping=True)) 24 | print('---') 25 | if constituents: 26 | for cons in data['signatures_by_constituency']: 27 | print(cons['name'] + ': ' + locale.format_string('%d', cons['signature_count'], grouping=True)) 28 | print('Refresh | refresh=true') 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xbar Plugins 2 | 3 | This repo contains scripts, programs and command-line tools that add functionality to [xbar](https://github.com/matryer/xbar#get-started). 4 | 5 | * [Reporting issues](#reporting-issues) 6 | * [Available Plugins](https://github.com/matryer/xbar-plugins#available-plugins) 7 | * [Contributors](https://github.com/matryer/xbar-plugins#contributors) 8 | * [Add your own plugin](https://github.com/matryer/xbar-plugins#add-your-own-plugin) 9 | 10 | ### Reporting issues 11 | 12 | The best way to report an issue with a plugin is to find the plugin on https://xbarapp.com and click "Open issue". If possible, the author will be tagged in the issue - which greatly increases your chances of getting the issue looked at quickly. 13 | 14 | ### How to use them 15 | 16 | * Just drop the plugin into your xbar plugins folder (if you have the repo, why not use the `Enabled` folder?) 17 | * Make sure it's executable (in Terminal, do `chmod +x plugin.sh`) 18 | * Then choose `Refresh all` from the xbar menus 19 | 20 | ### Available Plugins 21 | 22 | To see a list of available plugins, visit https://xbarapp.com/ 23 | 24 | ## Contributors 25 | 26 | Special thanks to everyone who has contributed: https://xbarapp.com/docs/contributors/index.html 27 | 28 | ## Add your own plugin 29 | 30 | To contribute your own plugin, consult the [plugin development and contribution guide](./CONTRIBUTING.md) 31 | -------------------------------------------------------------------------------- /Science/pubmed.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # <xbar.title>Pubmed Articles</xbar.title> 5 | # <xbar.version>v1.0.0</xbar.version> 6 | # <xbar.author>Dogancan Ozturan</xbar.author> 7 | # <xbar.author.github>ozturan</xbar.author.github> 8 | # <xbar.desc>Number of publications for a given keyword on Pubmed</xbar.desc> 9 | # <xbar.image>http://i.imgur.com/lqCaAJP.png</xbar.image> 10 | # <xbar.dependencies>python</xbar.dependencies> 11 | 12 | import urllib2 13 | from HTMLParser import HTMLParser 14 | 15 | # add as much as you want 16 | keyword_list = ["CRISPR","TALEN", "Zinc+Finger"] 17 | 18 | def get_html(keyword): 19 | f = urllib2.urlopen("https://www.ncbi.nlm.nih.gov/pubmed/?term=%s" %keyword) 20 | return str(f.read()) 21 | 22 | class MyHTMLParser(HTMLParser): 23 | def __init__(self): 24 | HTMLParser.__init__(self) 25 | self.__text = [] 26 | 27 | def handle_starttag(self, tag, attrs): 28 | if tag == "meta": 29 | self.__text.append(attrs[1][1]) 30 | 31 | def text(self): 32 | return self.__text 33 | 34 | 35 | def html(text): 36 | parser = MyHTMLParser() 37 | parser.feed(text) 38 | parser.close() 39 | return parser.text() 40 | 41 | if __name__ == '__main__': 42 | print " 🏛️ " 43 | print "---" 44 | for i in keyword_list: 45 | print "%s" %i + " -- " + html(get_html(i))[15] + " | href=https://www.ncbi.nlm.nih.gov/pubmed/?term=%s" %i -------------------------------------------------------------------------------- /Sports/bundesliga.1h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Bundesliga Matchday</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Alex</xbar.author> 6 | # <xbar.author.github>alexrockt</xbar.author.github> 7 | # <xbar.desc>Shows the next matchday of the Bundesliga</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/alexrockt/misc/master/bundesliga-screenshot.png</xbar.image> 9 | # <xbar.dependencies>Python</xbar.dependencies> 10 | # <xbar.abouturl></xbar.abouturl> 11 | 12 | import requests 13 | import datetime 14 | 15 | URL = "https://www.openligadb.de/api/getmatchdata/bl1" 16 | 17 | result = requests.get(URL) 18 | data = result.json() 19 | 20 | matchday = data[0]['Group']['GroupName'] 21 | 22 | date_time = "" 23 | 24 | print('{} | size=10 color=green'.format(matchday)) 25 | print('---') 26 | for game in data: 27 | if date_time != game['MatchDateTime']: 28 | date_time = game['MatchDateTime'] 29 | print('---') 30 | date_time_fmt = datetime.datetime.strptime(date_time,"%Y-%m-%dT%H:%M:%S") 31 | date_time_fmt = datetime.datetime.strftime(date_time_fmt, "%H:%M / %d.%m.%Y") 32 | print("{} | color=red".format(date_time_fmt)) 33 | date_time = game['MatchDateTime'] 34 | 35 | team1 = game['Team1']['TeamName'] 36 | team2 = game['Team2']['TeamName'] 37 | 38 | print("{} - {} | color=white".format(team1, team2)) -------------------------------------------------------------------------------- /Sports/crossfit-regionals.1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>CrossFit Regionals</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Dean Fogarty</xbar.author> 5 | # <xbar.author.github>angrytongan</xbar.author.github> 6 | # <xbar.desc>Display top 3 results from all CrossFit regionals in current year.</xbar.desc> 7 | # <xbar.dependencies>bash</xbar.dependencies> 8 | 9 | YEAR=$(date +%Y | sed -e "s/.*\(..\)$/\1/") 10 | 11 | declare -a regions 12 | regions[1]="Atlantic" 13 | regions[2]="California" 14 | regions[3]="Central" 15 | regions[4]="East" 16 | regions[5]="Meridian" 17 | regions[6]="Pacific" 18 | regions[7]="South" 19 | regions[8]="West" 20 | 21 | echo "Regionals" 22 | echo "---" 23 | 24 | for region in "${!regions[@]}"; do 25 | echo ${regions[$region]} 26 | 27 | curl -s http://games.crossfit.com/scores/leaderboard.php?year="${YEAR}"\&division=201\®ional="${region}"\&numberperpage=3 | grep 'games.crossfit.com/athlete' | sed "s/.*_top\">\(.*\)<\/a><\/td>/-- \\1/g" 28 | echo "--" 29 | 30 | curl -s http://games.crossfit.com/scores/leaderboard.php?year="${YEAR}"\&division=101\®ional="${region}"\&numberperpage=3 | grep 'games.crossfit.com/athlete' | sed "s/.*_top\">\(.*\)<\/a><\/td>/-- \\1/g" 31 | echo "--" 32 | 33 | curl -s http://games.crossfit.com/scores/leaderboard.php?year="${YEAR}"\&division=301\®ional="${region}"\&numberperpage=3 | grep 'games.crossfit.com/team' | sed "s/.*_top\">\(.*\)<\/a><\/td>/-- \\1/g" 34 | 35 | done 36 | -------------------------------------------------------------------------------- /Sports/fcbarcelona-dk.1h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>FCBarcelona.dk</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Tuk Bredsdorff</xbar.author> 6 | # <xbar.author.github>tiktuk</xbar.author.github> 7 | # <xbar.desc>News from fcbarcelona.dk.</xbar.desc> 8 | # <xbar.image>http://tiktuk.net/sky/fcb-bitbar.png</xbar.image> 9 | # <xbar.dependencies>python3, requests, BeautifulSoup4</xbar.dependencies> 10 | 11 | import requests 12 | from bs4 import BeautifulSoup 13 | 14 | URL = 'http://fcbarcelona.dk' 15 | DIVIDER = '---\n' 16 | 17 | if __name__ == '__main__': 18 | try: 19 | r = requests.get(URL) 20 | 21 | if r.ok: 22 | print('⚽️') 23 | print(DIVIDER) 24 | 25 | soup = BeautifulSoup(r.text, 'html.parser') 26 | main_article_link = soup.find(id='main_story').find('a') 27 | article_links = soup.find(id='article_list').find_all('a') 28 | article_links.insert(0, main_article_link) 29 | 30 | for a in article_links: 31 | dest = f'{URL}/{a.attrs["href"]}' 32 | text = a.text.strip().replace('\xa0\xa0-\xa0\xa0', ': ') 33 | print(f'{text} | href={dest}') 34 | except requests.exceptions.ConnectionError: 35 | print('😳') 36 | print(DIVIDER) 37 | print('Could not connect to %s' % URL) 38 | -------------------------------------------------------------------------------- /System/AirPodsPower.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>AirPods Power</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Gonzalo Serrano Revuelta</xbar.author> 6 | # <xbar.author.github>gonzaloserrano</xbar.author.github> 7 | # <xbar.desc>Displays AirPods battery</xbar.desc> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | 10 | # Based on AirPods Battery CLI, Version 2.3 - https://github.com/duk242/AirPodsBatteryCLI 11 | 12 | OUTPUT='🎧' 13 | BLUETOOTH_DEFAULTS=$(defaults read /Library/Preferences/com.apple.Bluetooth) 14 | SYSTEM_PROFILER=$(system_profiler SPBluetoothDataType 2>/dev/null) 15 | MAC_ADDR=$(grep -b2 "Minor Type: Headphones"<<<"${SYSTEM_PROFILER}"|awk '/Address/{print $3}') 16 | CONNECTED=$(grep -ia6 "${MAC_ADDR}"<<<"${SYSTEM_PROFILER}"|awk '/Connected: Yes/{print 1}') 17 | BLUETOOTH_DATA=$(grep -ia6 '"'"${MAC_ADDR}"'"'<<<"${BLUETOOTH_DEFAULTS}") 18 | BATTERY_LEVELS=("BatteryPercentCombined" "HeadsetBattery" "BatteryPercentSingle" "BatteryPercentCase" "BatteryPercentLeft" "BatteryPercentRight") 19 | 20 | if [[ "${CONNECTED}" ]]; then 21 | for I in "${BATTERY_LEVELS[@]}"; do 22 | declare -x "${I}"="$(awk -v pat="${I}" '$0~pat{gsub (";",""); print $3 }'<<<"${BLUETOOTH_DATA}")" 23 | [[ -n "${!I}" ]] && OUTPUT="${OUTPUT} $(awk '/BatteryPercent/{print substr($0,15,1)}'<<<"${I}")${!I}" 24 | done 25 | echo "${OUTPUT}" 26 | else 27 | printf "%s\n---\nNot connected" "${OUTPUT}" 28 | fi 29 | -------------------------------------------------------------------------------- /System/Battery/battery_cycles.12h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Battery Cycles</xbar.title> 3 | # <xbar.version>1.0</xbar.version> 4 | # <xbar.author>Maxime Bertheau</xbar.author> 5 | # <xbar.author.github>maxoumime</xbar.author.github> 6 | # <xbar.desc>Get your battery cycles and condition on the menu bar !</xbar.desc> 7 | # <xbar.image>https://nothingreally.botler.me/bitbar.battery-cycles.png</xbar.image> 8 | 9 | # Get cycles number 10 | cycles=$(system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}') 11 | 12 | # If you want to change the emoticon before the number, here are some 13 | #echo "🔋 $cycles" 14 | #echo "♾ $cycles" 15 | #echo "♽ $cycles" 16 | 17 | echo "♾ $cycles" 18 | 19 | echo "---" 20 | 21 | # 1000 cycles maximum 22 | # Based on the cycles max number provided by Apple for all Macbooks after 2009 23 | # No way to get the Macbook age from script directly 24 | 25 | color=green 26 | if [ "$cycles" -gt 1000 ]; then 27 | color=red 28 | elif [ "$cycles" -gt 750 ]; then 29 | color=orange 30 | fi 31 | 32 | echo "Cycles: $cycles / 1000 | color=$color href='https://support.apple.com/en-us/HT201585'" 33 | 34 | # Get battery condition 35 | condition=$(system_profiler SPPowerDataType | grep "Condition" | sed -e 's/^.*: //') 36 | 37 | color=green 38 | if [ "$condition" != "Normal" ]; then 39 | color=red 40 | fi 41 | 42 | echo "Battery condition: $condition | color=$color" 43 | -------------------------------------------------------------------------------- /System/Battery/keyboard-system_profiler.1m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # <xbar.title>Battery Apple Bluetooth keyboard</xbar.title> 3 | # <xbar.version>1.0</xbar.version> 4 | # <xbar.author>Alexandre Espinosa Menor</xbar.author> 5 | # <xbar.author.github>alexandregz</xbar.author.github> 6 | # <xbar.desc>Show battery percentage for Bluetooth Keyboard</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/1FlcPYx.png</xbar.image> 8 | # 9 | # command from https://github.com/matryer/bitbar-plugins/issues/84 by @keithamus 10 | # works fine with Apple Keyboard 11 | # 12 | 13 | require 'yaml' 14 | 15 | output = YAML.load(`system_profiler SPBluetoothDataType 2> /dev/null`); 16 | 17 | output['Bluetooth']['Devices (Paired, Configured, etc.)'].each do |device| 18 | puts "Keyboard: "+device[1]['Battery Level'].to_s if device[1]['Minor Type'].eql?('Keyboard') && device[1].has_key?('Battery Level') 19 | end 20 | -------------------------------------------------------------------------------- /System/Battery/keyboard.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Keybard Battery</xbar.title> 4 | # <xbar.author>Mat Ryer</xbar.author> 5 | # <xbar.author.github>matryer</xbar.author.github> 6 | 7 | PERCENTAGE=$(ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | fgrep -v \{ | sed 's/[^[:digit:]]//g') 8 | # Detect and adjust for M1 Mac 9 | if [[ $(uname -m) == 'arm64' ]]; then 10 | PERCENTAGE=$(ioreg -c AppleDeviceManagementHIDEventService -r -l | grep -i keyboard -A 20 | grep BatteryPercent | cut -d = -f2 | cut -d ' ' -f2) 11 | fi 12 | 13 | if [ "$PERCENTAGE" ]; then 14 | echo "Keyboard: $PERCENTAGE%" 15 | #else 16 | # echo "without bluetooth keyboard?" 17 | fi 18 | 19 | -------------------------------------------------------------------------------- /System/Battery/mAh.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | output="$(system_profiler SPPowerDataType | grep "Charge Remaining" | awk '{print $4}')"; 4 | 5 | charge="${output} mAh" 6 | 7 | echo "$charge" 8 | 9 | # <xbar.title>Battery mAh</xbar.title> 10 | # <xbar.version>v1.0</xbar.version> 11 | # <xbar.author>Luca Angioloni</xbar.author> 12 | # <xbar.author.github>LucaAngioloni</xbar.author.github> 13 | # <xbar.desc>Shows the mAh of battery remaining.</xbar.desc> 14 | # <xbar.image>http://s32.postimg.org/6k1iq3051/Screen_Shot_2016_04_27_at_20_0$ 15 | # <xbar.dependencies>none</xbar.dependencies> 16 | -------------------------------------------------------------------------------- /System/Battery/mouse.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Mouse battery</xbar.title> 3 | # <xbar.version>1.0</xbar.version> 4 | # <xbar.author>Alexandre Espinosa Menor</xbar.author> 5 | # <xbar.author.github>alexandregz</xbar.author.github> 6 | # <xbar.desc>Show battery percentage for Bluetooth Mouse</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/IqjZMJg.png</xbar.image> 8 | 9 | # works fine with Magic Mouse 10 | 11 | PERCENTAGE=$(ioreg -n BNBMouseDevice | fgrep BatteryPercent | fgrep -v \{ | sed 's/[^[:digit:]]//g') 12 | # Detect and adjust for M1 Mac 13 | if [[ $(uname -m) == 'arm64' ]]; then 14 | PERCENTAGE=$(ioreg -c AppleDeviceManagementHIDEventService -r -l | grep -i mouse -A 20 | grep BatteryPercent | cut -d = -f2 | cut -d ' ' -f2) 15 | fi 16 | 17 | if [ "$PERCENTAGE" ]; then 18 | echo "Mouse: $PERCENTAGE%" 19 | #else 20 | # echo "without bluetooth mouse?" 21 | fi 22 | 23 | -------------------------------------------------------------------------------- /System/Battery/trackpad-system_profiler.1m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # <xbar.title>Battery Apple Bluetooth Trackpad</xbar.title> 3 | # <xbar.version>1.0</xbar.version> 4 | # <xbar.author>Maxime Bertheau</xbar.author> 5 | # <xbar.author.github>maxoumime</xbar.author.github> 6 | # <xbar.desc>Show battery percentage for Bluetooth Trackpad</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/1FlcPYx.png</xbar.image> 8 | # 9 | # A lot of thanks to @alexandregz, I just changed "Keyboard" to "Trackpad" :grin: 10 | # Works fine with Apple Trackpad 11 | # 12 | 13 | require 'yaml' 14 | 15 | output = YAML.load(`system_profiler SPBluetoothDataType`); 16 | 17 | output['Bluetooth']['Devices (Paired, Configured, etc.)'].each do |device| 18 | puts "Trackpad: "+device[1]['Battery Level'].to_s if device[1]['Minor Type'].eql?('Trackpad') && device[1].has_key?('Battery Level') 19 | end 20 | -------------------------------------------------------------------------------- /System/Battery/trackpad.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # <xbar.title>Trackpad Battery</xbar.title> 4 | # <xbar.author>Mat Ryer</xbar.author> 5 | # <xbar.author.github>matryer</xbar.author.github> 6 | # <xbar.version>1.0</xbar.version> 7 | 8 | PERCENTAGE=$(ioreg -n BNBTrackpadDevice | fgrep BatteryPercent | fgrep -v \{ | sed 's/[^[:digit:]]//g') 9 | 10 | if [ "$PERCENTAGE" ]; then 11 | echo "Trackpad: $PERCENTAGE%" 12 | fi 13 | -------------------------------------------------------------------------------- /System/MicToggle.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Mic Toggle</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Alejandro Narvaja</xbar.author> 6 | # <xbar.author.github>alebarbaja</xbar.author.github> 7 | # <xbar.desc>Toggle microphone on/off and display its status.</xbar.desc> 8 | # <xbar.image>https://i.postimg.cc/nzShGcfN/mute-unmute-mic.gif</xbar.image> 9 | # <xbar.dependencies>osascript</xbar.dependencies> 10 | 11 | # Get the current input volume 12 | current_volume=$(osascript -e "input volume of (get volume settings)") 13 | 14 | # If the volume is 0, the mic is muted 15 | if [ "$current_volume" == "0" ]; then 16 | echo "🔇" 17 | echo "---" 18 | echo "Activate Mic | bash='$0' param1=unmute terminal=false" 19 | else 20 | echo "🔊" 21 | echo "---" 22 | echo "Mute Mic | bash='$0' param1=mute terminal=false" 23 | fi 24 | 25 | # Handle user click 26 | if [ "$1" == "mute" ]; then 27 | osascript -e "set volume input volume 0" 28 | elif [ "$1" == "unmute" ]; then 29 | osascript -e "set volume input volume 100" 30 | fi 31 | -------------------------------------------------------------------------------- /System/ad-pass-expiry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Active Directory Password Expiration Check</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Galen Sprague</xbar.author> 5 | # <xbar.author.github>gsprague</xbar.author.github> 6 | # <xbar.desc>Shows Active Directory Password Expiration in days</xbar.desc> 7 | # <xbar.image></xbar.image> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.abouturl></xbar.abouturl> 10 | 11 | # Set environment vars 12 | DOMAIN="yourDomain" 13 | # Set password policy in days 14 | PWPOLICY="90" 15 | 16 | # Get logged in user 17 | #CURRENTUSER=$(ls -l /dev/console | cut -d " " -f4) 18 | CURRENTUSER=$(id -un) 19 | 20 | # Get data from AD 21 | LASTPWDMS=$(dscl /Active\ Directory/"$DOMAIN"/All\ Domains -read /Users/"$CURRENTUSER" | grep -i "SMBPasswordLastSet" | cut -d ' ' -f 2 | tail -1) 22 | if [[ $LASTPWDMS == "" ]] 23 | then 24 | # No access to AD 25 | echo "AD NA" 26 | else 27 | # Get the current UNIX date 28 | TODAYUNIX=$(date +%s) 29 | 30 | # Convert last set value 31 | LASTPWDUNIX=$((LASTPWDMS/10000000-11644473600)) 32 | 33 | # Subtract last set value from current UNIX date 34 | DIFFUNIX=$((TODAYUNIX-LASTPWDUNIX)) 35 | 36 | # Calculate in days 37 | DIFFDAYS=$((DIFFUNIX/86400)) 38 | 39 | # Subtract password policy from days 40 | PASSWORDEXPIRATION=$((PWPOLICY-DIFFDAYS)) 41 | 42 | echo "Password expires in $PASSWORDEXPIRATION days" 43 | fi 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /System/adminCheck.1m.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # 4 | # <xbar.title>Admin Status for mac</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>Laurent</xbar.author> 7 | # <xbar.author.github>Laurent Taupiac</xbar.author.github> 8 | # <xbar.desc>This plugin indicates whether the user is an admin or not.</xbar.desc> 9 | # <xbar.image>https://raw.githubusercontent.com/ltaupiac/adminCheck/main/Admin.png</xbar.image> 10 | # <xbar.dependencies>macos, zsh, dscl</xbar.dependencies> 11 | # <xbar.abouturl>https://github.com/ltaupiac/adminCheck/README.md</xbar.abouturl> 12 | 13 | if dseditgroup -o checkmember admin > /dev/null; then 14 | echo "⭐️" # Icon for "Admin" 15 | else 16 | echo "👤" # Icon for "not admin" 17 | fi 18 | -------------------------------------------------------------------------------- /System/arp-spoof-detector.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # <xbar.title>ARP Spoof Detector</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>Tuan Nguyen</xbar.author> 7 | # <xbar.author.github>tuannvm</xbar.author.github> 8 | # <xbar.desc>This plugin detect the ARP spoofing attack on local area network and notify user</xbar.desc> 9 | # <xbar.image>http://i.imgur.com/2jE6g7v.png</xbar.image> 10 | # <xbar.abouturl>https://github.com/matryer/bitbar-plugins/tree/master/System/arp-spoof-detector.sh</xbar.abouturl> 11 | # 12 | 13 | # check if it's there any duplicated arp address 14 | duplicated_arp=$(arp -a | awk '{print $4}' | uniq -d) 15 | 16 | if [ -z "$duplicated_arp" ];then 17 | # if not, print OK, no attack on this network 18 | echo "OK" 19 | else 20 | # if there's a duplication, notify the user with the attacker's IP 21 | result=$(arp -a | grep "$duplicated_arp" | cut -d"(" -f2 | cut -d")" -f1 | tail -n 1) 22 | echo "ATTACK FROM" "$result" "!" 23 | fi -------------------------------------------------------------------------------- /System/caffeinate.10h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Caffeinate</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Steffen Froehlich</xbar.author> 6 | # <xbar.author.github>citoki</xbar.author.github> 7 | # <xbar.desc>This plugin will give some caffeine, with lots of sugar, to your Mac to stay awake. 8 | # Technically the commandline tool 'caffeinate' is executed.</xbar.desc> 9 | # <xbar.image>https://i.imgur.com/vsCWLwX.png</birtbar.image> 10 | # <xbar.dependencies></xbar.dependencies> 11 | 12 | if [ "$1" = 'sugar' ]; then 13 | # stop all previous processes 14 | /usr/bin/killall caffeinate 15 | 16 | # start caffeinate program and prevent the system from idle sleeping when 17 | # Mac OSX is running on AC power 18 | /usr/bin/caffeinate -s 19 | fi 20 | 21 | if [ "$1" = 'caffeine' ]; then 22 | # stop all previous processes 23 | /usr/bin/killall caffeinate 24 | 25 | # start caffeinate program and prevent the system from idle sleeping 26 | /usr/bin/caffeinate -i 27 | fi 28 | 29 | if [ "$1" = 'stop' ]; then 30 | # send terminate signal to all processes of program 'caffeinate' 31 | /usr/bin/killall caffeinate 32 | fi 33 | 34 | echo "☕️" 35 | echo '---' 36 | echo "Sugar - stay awake w/ AC power| bash='$0' param1=sugar terminal=false" 37 | echo "Caffeine - stay awake w/o AC power | bash='$0' param1=caffeine terminal=false" 38 | echo "Stop caffeine dose | bash='$0' param1=stop terminal=false" 39 | 40 | -------------------------------------------------------------------------------- /System/copy-to-clipboard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Copy to Clipboard</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Parvez</xbar.author> 6 | # <xbar.author.github>parvez</xbar.author.github> 7 | # <xbar.desc>This plugin will copy text to clipboard</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/SiuAz3C.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | # Hack for language not being set properly and unicode support 12 | export LANG="${LANG:-en_US.UTF-8}" 13 | 14 | # Write the list of Text you want enabled 15 | LIST=" 16 | Text 1 17 | Some Text 2 18 | Some moreText 3 19 | " 20 | 21 | echo "📋" 22 | echo '---' 23 | echo "Clear Clipboard | bash='$0' param1=copy param2=' ' terminal=false" 24 | echo "---" 25 | while read -r line; do 26 | if ! [ "$line" == "" ]; then 27 | echo "$line | bash='/bin/bash' param1='-c' param2='/bin/echo $line | pbcopy' terminal=false" 28 | fi 29 | done <<< "$LIST" 30 | -------------------------------------------------------------------------------- /System/cpu-load.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # <xbar.title>CPU Load</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Paul W. Rankin</xbar.author> 6 | # <xbar.author.github>rnkn</xbar.author.github> 7 | # <xbar.desc>Shows CPU load as a percentage (without using top).</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/B6VAsDg.png</xbar.image> 9 | 10 | # BitBar CPU Load plugin 11 | 12 | ncpu=$(sysctl -n hw.logicalcpu) 13 | total=$(ps -Ao %cpu= | paste -sd+ - | bc) 14 | usage=$(echo "scale = 2; $total / $ncpu" | bc) 15 | 16 | printf "%0.1f%%\n" "$usage" 17 | echo "---" 18 | echo "Refresh | refresh=true" 19 | -------------------------------------------------------------------------------- /System/cpu-thermal-throttle.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>CPU thermal throttling</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Sampo Juustila</xbar.author> 6 | # <xbar.author.github>plaa</xbar.author.github> 7 | # <xbar.desc>Displays the current CPU thermal throttling speed (using `pmset -g therm`).</xbar.desc> 8 | 9 | OUTPUT="$(pmset -g therm)" 10 | SCHEDLIMIT="$(echo "$OUTPUT" | grep CPU_Scheduler_Limit | cut -d= -f2)" 11 | SPEEDLIMIT="$(echo "$OUTPUT" | grep CPU_Speed_Limit | cut -d= -f2)" 12 | AVAILCPU="$(echo "$OUTPUT" | grep CPU_Available_CPUs | cut -d= -f2)" 13 | TOTAL=$(($SCHEDLIMIT * $SPEEDLIMIT / 100)) 14 | 15 | if [ "$TOTAL" -ge 80 ]; then 16 | SYMBOL="🌡" 17 | else 18 | SYMBOL="🔥" 19 | fi 20 | 21 | cat <<EOF 22 | $SYMBOL$TOTAL% 23 | --- 24 | CPU_Speed_Limit $SPEEDLIMIT% 25 | CPU_Scheduler_Limit $SCHEDLIMIT% 26 | CPU_Available_CPUs $AVAILCPU 27 | EOF 28 | -------------------------------------------------------------------------------- /System/cpu-usage-kill.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>CPU Usage, Kill process</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Alex M.</xbar.author> 6 | # <xbar.author.github>Aleksandern</xbar.author.github> 7 | # <xbar.desc>Shows top 3 consuming processes with opportunity to kill them.</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/Aleksandern/devman/master/images/BitBarCpuUsageKill.png</xbar.image> 9 | # <xbar.dependencies>bash</xbar.dependencies> 10 | 11 | 12 | counter=1 13 | ps c -Ao pcpu,command,pid -r | head -n 4 | awk 'NR>1'\ 14 | | while read -r pcpu command pid ; do 15 | 16 | if [ "${counter}" -eq "1" ]; then 17 | echo "$pcpu% $command" 18 | echo "---" 19 | fi 20 | 21 | echo "$pcpu% $command $pid | bash='kill -9 ${pid//[!0-9]/} ; exit' terminal=true" 22 | 23 | counter=$((counter +1)) 24 | 25 | done 26 | 27 | 28 | echo "---" 29 | echo "Refresh | refresh=true terminal=false" 30 | -------------------------------------------------------------------------------- /System/deleteVSCodeTemp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Delete VSCode Temp Files</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author.github>AlexPoulsen</xbar.author.github> 5 | # <xbar.author>AlexPoulsen</xbar.author> 6 | # <xbar.desc>Deletes Visual Studio Code Temporary Files</xbar.desc> 7 | 8 | if [ "$1" = 'clean' ]; then 9 | sudo find /Users/macbookpro/Documents/VSCode\ Projects/ -name "temp*" -d -ok rm {} \; 10 | # shellcheck disable=SC2162 11 | read -p "Files are about to be deleted, continue? [Y/n] " check 12 | if [[ ( $check == "Y" ) || ( $check == "y" ) ]]; then 13 | sudo find /Users/macbookpro/Documents/VSCode\ Projects/ -name "temp*" -d -exec rm {} \; 14 | echo "Deleted from default directory" 15 | else 16 | echo "Files not deleted" 17 | fi 18 | fi 19 | 20 | echo "🗑" 21 | echo '---' 22 | echo "Clean Temp Files | bash='$0' param1=clean terminal=true" -------------------------------------------------------------------------------- /System/disk-read-write.1s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Disk Read Write</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>cghamburg</xbar.author> 6 | # <xbar.author.github>cghamburg</xbar.author.github> 7 | # <xbar.desc>Shows Disk Read Write Speeds per second.</xbar.desc> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.dependencies>iostat</xbar.dependencies> 10 | 11 | # BitBar Disk IO plugin 12 | 13 | STAT=$(iostat -dc 2 disk0) 14 | RATE=$(echo "$STAT"| tail -n1 | rev | cut -d ' ' -f2 | rev) 15 | ABSOLUTE_UNIT=$(echo "$STAT"| head -n2 | tail -n1 | rev | cut -d ' ' -f2 | rev) 16 | echo "🏃$RATE $ABSOLUTE_UNIT"; 17 | echo "---"; 18 | echo "$STAT" 19 | -------------------------------------------------------------------------------- /System/diskAvailable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>DiskAvailable</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Kalak Lanar</xbar.author> 5 | # <xbar.author.github>kalaklanar</xbar.author.github> 6 | # <xbar.desc>displays free disk space of the root volume</xbar.desc> 7 | # <xbar.</xbar.image> 8 | # <xbar.dependencies></xbar.dependencies> 9 | 10 | #diskutil will report the same as in the Finder (purgable space counted as free) 11 | #df will report what is actually on the disk 12 | 13 | DEVICE=$(/bin/df -h |/usr/bin/awk '$9 ~ /^\/$/{print $1}') 14 | diskutil info "$DEVICE" |/usr/bin/awk '$0 ~ /(Container|Volume) Free Space/ {print $4$5}' 15 | 16 | #/bin/df -h / | awk '{print $4}' |grep -v 'Avail' 17 | -------------------------------------------------------------------------------- /System/downloads.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOWNLOADS_DIR="$HOME/Downloads" 4 | 5 | # <xbar.title>Downloads</xbar.title> 6 | # <xbar.version>v1.0</xbar.version> 7 | # <xbar.author>iosdeveloper</xbar.author> 8 | # <xbar.author.github>iosdeveloper</xbar.author.github> 9 | # <xbar.desc>Quick access to your recent downloads. Enter URL to download from. Specify downloads directory at the top of the file. Defaults to ~/Downloads. Contains example of how to refresh from the command line (see https://github.com/matryer/bitbar/blob/master/Docs/URLScheme.md#refreshplugin)</xbar.desc> 10 | # <xbar.image>http://i.imgur.com/Cv4iS3d.png</xbar.image> 11 | # <xbar.abouturl>https://github.com/matryer/bitbar-plugins/blob/master/System/downloads.1h.sh</xbar.abouturl> 12 | 13 | FILENAME=$(basename "$0") 14 | DOWNLOADS=$(ls -t "$DOWNLOADS_DIR") 15 | 16 | echo "Downloads" 17 | echo "---" 18 | echo "Download from URL… | bash='read -p Enter_URL: url && ( cd $DOWNLOADS_DIR && curl -L -# -O \$url ); open' param1=bitbar://refreshPlugin?name=$FILENAME" 19 | echo "---" 20 | echo "$DOWNLOADS" | awk -v DOWNLOADS_DIR="$DOWNLOADS_DIR" '{print $0" | bash=/usr/bin/open param1="DOWNLOADS_DIR"/"$0" terminal=false"}' 21 | -------------------------------------------------------------------------------- /System/emacs.24h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Emacs Menu Controller</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Ken Mankoff</xbar.author> 6 | # <xbar.author.github>mankoff</xbar.author.github> 7 | # <xbar.desc>Emacs controlled</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/ZTScWDa.png</xbar.image> 9 | 10 | PATH=/usr/local/bin:$PATH # where is emacsclient? 11 | 12 | case "$1" in 13 | "email") 14 | open -a Emacs # bring to front 15 | emacsclient -e '(mu4e-compose-new)' 16 | exit 17 | ;; 18 | "buffer") 19 | open -a Emacs 20 | emacsclient -e '(progn (select-frame (make-frame))(switch-to-buffer (get-buffer-create "*scratch*")) (set-frame-size (selected-frame) 92 72)(set-frame-position (selected-frame) 840 0))' 21 | exit 22 | ;; 23 | esac 24 | 25 | echo '🦄' 26 | echo "---"; 27 | echo "📬 Email | bash=\"$0\" param1=email terminal=false" 28 | echo "📠 *scratch* Buffer | bash=\"$0\" param1=buffer terminal=false" 29 | -------------------------------------------------------------------------------- /System/firewall.10m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Firewall</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Eddie A Tejeda</xbar.author> 6 | # <xbar.author.github>eddietejeda</xbar.author.github> 7 | # <xbar.desc>This plugin displays the status of the firewall.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/MOBK8cK.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | enabled=$(/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate); 12 | 13 | if [[ $enabled == *"enabled"* ]] 14 | then 15 | echo '☵' 16 | else 17 | echo '❌' 18 | fi 19 | 20 | echo '---' 21 | echo "👁 $(/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode)" 22 | -------------------------------------------------------------------------------- /System/firewall_status_indicator.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Firewall Status Indicator</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Miles Wolbe</xbar.author> 6 | # <xbar.author.github>tinyapps</xbar.author.github> 7 | # <xbar.desc>Display status of the built-in Application Firewall</xbar.desc> 8 | # <xbar.image>https://tinyapps.org/screenshots/bitbar_firewall_status_indicator.png</xbar.image> 9 | # <xbar.dependencies>bash</xbar.dependencies> 10 | # <xbar.abouturl>https://tinyapps.org/blog/mac/201709100715_mac_firewall_status.html/</xbar.abouturl> 11 | 12 | state=$(defaults read "/Library/Preferences/com.apple.alf" globalstate) 13 | 14 | if [ "$state" -eq 2 ]; then 15 | echo "🔒" 16 | elif [ "$state" -eq 1 ]; then 17 | echo "❗️" 18 | else 19 | echo "‼️" 20 | fi 21 | 22 | echo "---" 23 | echo "Open Firewall preference pane| href='x-apple.systempreferences:com.apple.preference.security?Firewall'" 24 | -------------------------------------------------------------------------------- /System/getComputerInfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Get Computer Info</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Sarah Keenan</xbar.author> 6 | # <xbar.author.github>SKeenan07</xbar.author.github> 7 | # <xbar.desc>This plugin gets the IP address and the computer name.</xbar.desc> 8 | # <xbar.image>https://github-production-user-asset-6210df.s3.amazonaws.com/5545555/239567139-d0546624-25e9-4630-9ab6-1e42cf77861f.png</xbar.image> 9 | 10 | activeNetworkAdapter=$(echo 'show State:/Network/Global/IPv4' | scutil | grep PrimaryInterface | awk -F " . " '{ print $2 }') 11 | 12 | computerName=$(system_profiler SPSoftwareDataType | grep "Computer Name") 13 | 14 | batteryCondition=$(system_profiler SPPowerDataType | grep "Condition") 15 | 16 | echo "🖥" 17 | 18 | echo "---" 19 | 20 | echo "${computerName:21}" 21 | 22 | echo "---" 23 | 24 | # Batery conditions can be Normal, Replace Soon, Replace Now, and Service Battery 25 | echo "Battery Condition: ${batteryCondition:21}" 26 | 27 | echo "---" 28 | 29 | # If the active network adapter is empty, then the Mac isn't connected to the internet 30 | if [[ -z "$activeNetworkAdapter" ]]; then 31 | echo "Not connected to the internet." 32 | else 33 | IPAddress=$(ifconfig "$activeNetworkAdapter" | grep "inet " | awk '{ print $2 }') 34 | echo "$IPAddress" 35 | fi 36 | -------------------------------------------------------------------------------- /System/infinit-drive.10s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Ifinit Drive Journal Stats</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Dimitrie Hoekstra</xbar.author> 6 | # <xbar.author.github>strages</xbar.author.github> 7 | # <xbar.desc>Short description of what your plugin does.</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/strages/infinit-drive-journal-stats-bitbar-plugin/master/screenshot.png</xbar.image> 9 | # <xbar.dependencies>python3</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/strages/infinit-drive-journal-stats-bitbar-plugin</xbar.abouturl> 11 | 12 | 13 | import json 14 | import os 15 | import subprocess 16 | 17 | p = subprocess.Popen( 18 | ['infinit-journal', '--stat', '--script'], 19 | stdout = subprocess.PIPE, 20 | env = {'PATH': '/usr/local/bin:%s' % os.environ['PATH']}, 21 | ) 22 | out, err = p.communicate() 23 | res = json.loads(out.decode('utf-8')) 24 | 25 | total_size = 0 26 | for k, v in res.items(): 27 | total_size += v['size'] 28 | 29 | def GetHumanReadable(size,precision=0): 30 | suffixes=[' B',' KB',' MB',' GB',' TB'] 31 | suffixIndex = 0 32 | while size > 1024 and suffixIndex < 4: 33 | suffixIndex += 1 #increment the index of the suffix 34 | size = size/1024.0 #apply the division 35 | return "%.*f%s"%(precision,size,suffixes[suffixIndex]) 36 | 37 | total_size_readable = GetHumanReadable(total_size) 38 | 39 | print(total_size_readable) 40 | -------------------------------------------------------------------------------- /System/keyboard-symbol.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Keyboard symbol</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Đinh Quang Hiếu</xbar.author> 6 | # <xbar.author.github>dqhieu</xbar.author.github> 7 | # <xbar.desc>This plugin displays a menu of keyboard symbol</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/dqhieu/keyboard-symbol/master/demo.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | print('⌨️') 12 | print('---') 13 | print('⌘ Command') 14 | print('⇧ Shift') 15 | print('⌫ Backspace/Delete') 16 | print('⇥ Tab') 17 | print('⇪ Caps lock') 18 | print('⌥ Option/Alt') 19 | print('⌃ Control') 20 | print('⎋ Escape') 21 | print('←↑→↓ Arrow keys') 22 | print('↩ Return') 23 | -------------------------------------------------------------------------------- /System/killdock.1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>KillDock</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author.github>indapublic</xbar.author.github> 5 | # <xbar.author>indapublic</xbar.author> 6 | # <xbar.desc>Killall Dock</xbar.desc> 7 | 8 | if [ "$1" = 'kill' ]; then 9 | killall Dock 10 | exit 11 | fi 12 | 13 | echo "⏏" 14 | echo '---' 15 | echo "Kill Dock | bash='$0' param1=kill terminal=false" 16 | -------------------------------------------------------------------------------- /System/load_temp_fan.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # <xbar.title>Load Average/Temperature/Fan Speed</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>Ivan Kovnatsky</xbar.author> 7 | # <xbar.author.github>sevenfourk</xbar.author.github> 8 | # <xbar.desc>This plugin displays the current CPU load, CPU temperature, Fan speed (requires iStats ruby gem)</xbar.desc> 9 | # <xbar.image>https://i.imgur.com/y3ytf1l.png</xbar.image> 10 | # <xbar.abouturl>https://github.com/matryer/bitbar-plugins/blob/master/System/load_temp_fan.10s.sh</xbar.abouturl> 11 | # 12 | # iStats -- https://github.com/Chris911/iStats 13 | # gem install iStats 14 | # 15 | 16 | load=$(uptime|sed 's/.*ages: //') 17 | temp=$(/usr/local/bin/istats cpu|awk '{print $3}') 18 | fan=$(/usr/local/bin/istats fan speed|awk '{print $4, $5}') 19 | 20 | echo "$load, $temp, $fan" 21 | -------------------------------------------------------------------------------- /System/lock-screen.10h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Screen Lock</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Chris Tomkins-Tinch</xbar.author> 6 | # <xbar.author.github>tomkinsc</xbar.author.github> 7 | # <xbar.desc>This plugin displays a menu with an item to lock the screen with one click (lock or login screen).</xbar.desc> 8 | # <xbar.image>https://cloud.githubusercontent.com/assets/53064/12120421/e515718c-b39e-11e5-830b-bebe1c6445fc.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | if [ "$1" = 'lock' ]; then 12 | OSVER=$(sw_vers -productVersion | awk -F. '{print $1}') 13 | if [[ "$OSVER" -ge 13 ]]; then 14 | # The first time you run this will prompt to grant xbar access in the Accessibility features settings. 15 | osascript -e 'tell app "System Events" to key code 12 using {control down, command down}' 16 | else 17 | # To perform a sleep action 18 | # Requires "password after sleep or screen saver begins" to be set in Security preferences 19 | #osascript -e 'tell application "Finder" to sleep' 20 | 21 | # To perform a lock (login screen) action 22 | # Requires "Fast User Switching" to be enabled in system Login preferences 23 | /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend 24 | fi 25 | 26 | exit 27 | fi 28 | 29 | echo "🔒" 30 | echo '---' 31 | echo "Lock Now | bash='$0' param1=lock terminal=false" 32 | -------------------------------------------------------------------------------- /System/mas.1d.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Mac App Store</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>iosdeveloper</xbar.author> 6 | # <xbar.author.github>iosdeveloper</xbar.author.github> 7 | # <xbar.desc>Lists available updates from the Mac App Store using mas-cli (https://github.com/argon/mas). Based on brew-updates.1h.sh</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/yPeXDAj.png</xbar.image> 9 | # <xbar.dependencies>mas</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/matryer/bitbar-plugins/blob/master/System/mas.1d.sh</xbar.abouturl> 11 | 12 | if test "$(which /usr/local/bin/mas)" 2> /dev/null; then 13 | UPDATES=$(/usr/local/bin/mas outdated); 14 | UPDATE_COUNT=$(echo "$UPDATES" | grep -c '[^[:space:]]'); 15 | if test "$UPDATE_COUNT" -gt 0; then 16 | echo "↓$UPDATE_COUNT | dropdown=false" 17 | echo "---"; 18 | if [ -n "$UPDATES" ]; then 19 | echo "Upgrade all | bash=/usr/local/bin/mas param1=upgrade terminal=false refresh=true" 20 | echo "$UPDATES" | awk '{itemIdentifier = $1; $1 = ""; print $0 " | bash=/usr/local/bin/mas param1=install param2=" itemIdentifier " terminal=false refresh=true"; }' 21 | fi 22 | fi 23 | else 24 | echo "mas not installed" 25 | fi 26 | -------------------------------------------------------------------------------- /System/power-wattage-advanced.30m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Power Wattage Advanced</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>matanbaruch</xbar.author> 6 | # <xbar.author.github>matanbaruch</xbar.author.github> 7 | # <xbar.desc>The AC Power adapter wattage consumption and current for macos</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/OpKXCQy.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | # <xbar.abouturl>github.matan-baruch.com</xbar.abouturl> 11 | 12 | power_consumption=$(ioreg -rw0 -c AppleSmartBattery | grep BatteryData | grep -o '"SystemPower"=[0-9]*' | cut -c 16- | xargs -I % lldb --batch -o "print/f %" | grep -o '$0 = [0-9.]*' | cut -c 6-9) 13 | 14 | power_wattage=$(ioreg -rw0 -c AppleSmartBattery | grep BatteryData | grep -o '"AdapterPower"=[0-9]*' | cut -c 16- | xargs -I % lldb --batch -o "print/f %" | grep -o '$0 = [0-9.]*' | cut -c 6-9) 15 | 16 | if [ -z "$power_wattage" ] 17 | then 18 | echo "🔋" 19 | else 20 | echo "${power_consumption}W🔌${power_wattage}W" 21 | fi 22 | 23 | echo "---" 24 | echo "Refresh... | refresh=true" 25 | -------------------------------------------------------------------------------- /System/power_status.15s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Power Status</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Jeff Beadles</xbar.author> 6 | # <xbar.author.github>jeffbeadles</xbar.author.github> 7 | # <xbar.desc>Shows power source, current mode and settings</xbar.desc> 8 | # 9 | export PATH="/bin:/usr/bin:$PATH" 10 | 11 | # AC or Battery? 12 | pmset -g cap | sed -ne 's/^Capabilities for \(.*\) Power:$/\1/p' 13 | echo "---" 14 | # Power setting details 15 | pmset -g live | \ 16 | sed -e '1,3d' \ 17 | -e 's/Currently in use.*$/Current power settings/' \ 18 | -e 's/$/ | font=Courier color=black size=12/' 19 | 20 | exit 0 21 | #eof 22 | -------------------------------------------------------------------------------- /System/power_wattage.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Power Wattage</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>vxider</xbar.author> 6 | # <xbar.author.github>vxider</xbar.author.github> 7 | # <xbar.desc>The AC power adapter wattage for macos</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/4N0xk1g.jpg</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | # <xbar.abouturl></xbar.abouturl> 11 | 12 | power_wattage="$(system_profiler SPPowerDataType | grep "Wattage (W)" | awk "{print \$3\"W\"}")" 13 | 14 | if [ -z "$power_wattage" ] 15 | then 16 | echo "🔋" 17 | else 18 | echo "🔌${power_wattage}" 19 | fi 20 | 21 | echo "---" 22 | echo "Refresh... | refresh=true" 23 | -------------------------------------------------------------------------------- /System/real-cpu-usage.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Real CPU Usage</xbar.title> 4 | # <xbar.author>Mat Ryer and Tyler Bunnell</xbar.author> 5 | # <xbar.author.github>matryer</xbar.author.github> 6 | # <xbar.desc>Calcualtes and displays real CPU usage stats.</xbar.desc> 7 | # <xbar.version>1.0</xbar.version> 8 | 9 | if [ "$1" == "activitymonitor" ]; then 10 | open -a "Activity Monitor" 11 | exit 12 | fi 13 | 14 | IDLE=$(top -F -R -l3 | grep "CPU usage" | tail -1 | egrep -o '[0-9]{0,3}\.[0-9]{0,2}% idle' | sed 's/% idle//') 15 | 16 | USED=$(echo 100 - "$IDLE" | bc) 17 | 18 | echo "CPU: $USED%" 19 | echo "---" 20 | echo "Open Activity Monitor| bash='$0' param1=activitymonitor terminal=false" 21 | -------------------------------------------------------------------------------- /System/samplerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>CoreAudio Samplerate Display</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Anthony Lauzon</xbar.author> 5 | # <xbar.author.github>anthonylauzon</xbar.author.github> 6 | # <xbar.desc>Displays current samplerate for an audio device.</xbar.desc> 7 | # <xbar.dependencies>bash</xbar.dependencies> 8 | # <xbar.abouturl></xbar.abouturl> 9 | 10 | IFS=' 11 | ' 12 | 13 | device_index=0 14 | 15 | devices=($(system_profiler \ 16 | SPAudioDataType 2>/dev/null | \ 17 | sed '1,/Devices/d' | \ 18 | grep "^ \w" | \ 19 | sed 's/;$//')) 20 | 21 | if (( $# != 0 )); then 22 | device_index=$(($1-1)) 23 | echo $device_index > ~/.bitbar_audio_device_index 24 | elif [[ -f ~/.bitbar_audio_device_index ]]; then 25 | device_index=$(cat ~/.bitbar_audio_device_index) 26 | fi 27 | 28 | default_device="${devices[$device_index]}" 29 | samplerate=($(system_profiler \ 30 | SPAudioDataType 2>/dev/null | \ 31 | sed '1,/'"${default_device}"'/d' | \ 32 | grep SampleRate | \ 33 | head -n 1 | \ 34 | sed 's/^ Current SampleRate: //')) 35 | 36 | echo \( "${samplerate[0]}" \) 37 | echo '---' 38 | 39 | i=0 40 | for device in "${devices[@]}"; do 41 | ((i += 1)) 42 | device=$(echo "$device" | tr -d ' ' | sed 's/:$//') 43 | echo "$i $device | bash='$0' param1=$i terminal=false refresh=true" 44 | done 45 | -------------------------------------------------------------------------------- /System/show-hide-desktop-icons.1h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Show/Hide Desktop Icons</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Jordi Petit</xbar.author> 6 | # <xbar.author.github>jordi-petit</xbar.author.github> 7 | # <xbar.desc>This plugin displays a menu with two items to show or hide the desktop icons with one click.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/c3KYTAc.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | import sys, os 12 | 13 | if len(sys.argv) == 1: 14 | # print 'Ξ' 15 | print('💻') 16 | print('---') 17 | print('Hide desktop icons | terminal=false bash=%s param1=hide' % sys.argv[0]) 18 | print('Show desktop icons | terminal=false bash=%s param1=show' % sys.argv[0]) 19 | elif sys.argv[1] == 'hide': 20 | os.system('defaults write com.apple.finder CreateDesktop false && killall Finder') 21 | elif sys.argv[1] == 'show': 22 | os.system('defaults write com.apple.finder CreateDesktop true && killall Finder') 23 | -------------------------------------------------------------------------------- /System/swap-usage.1m.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Swap Usage</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Andrzej Wojciechowski (AAWO)</xbar.author> 6 | # <xbar.author.github>AAWO</xbar.author.github> 7 | # <xbar.desc>Swap memory usage indicator</xbar.desc> 8 | # <xbar.image></xbar.image> 9 | # <xbar.dependencies>bash, awk</xbar.dependencies> 10 | # <xbar.abouturl></xbar.abouturl> 11 | 12 | /usr/sbin/sysctl vm.swapusage | awk '{print "swap " $7}' 13 | -------------------------------------------------------------------------------- /System/top5-memory-consuming-processes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Top 5 Memory-Consuming Applications</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Qiansen Y</xbar.author> 6 | # <xbar.author.github>hypersport</xbar.author.github> 7 | # <xbar.desc>top 5 memory-consuming applications</xbar.desc> 8 | # <xbar.image>http://23.105.211.229/images/top5-memory-consuming.jpg</xbar.image> 9 | # <xbar.about>top 5 memory-consuming applications</xbar.about> 10 | 11 | ps xmo rss=,pmem=,comm= | while read -r rss pmem comm; ((n++<5)); do 12 | size="$((rss/1024))"; 13 | short=$((4-${#size})); 14 | size="(${size}M)"; 15 | i=0; 16 | while ((i++ < short)); do size=" $size"; done; 17 | pmem="${pmem%%.*}" 18 | if [ "$pmem" -ge 20 ]; then color=$'\e[31m'; 19 | elif [ "$pmem" -ge 10 ]; then color=$'\e[33m'; 20 | else color=$'\e[32m'; 21 | fi 22 | echo "$color$pmem% $size $(basename "$comm")"$'\e[0m'""; 23 | done 24 | -------------------------------------------------------------------------------- /System/totp.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>YubiKey TOTP generator to clipboard plugin</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>reuel</xbar.author> 6 | # <xbar.author.github>brute-force</xbar.author.github> 7 | # <xbar.desc>generates totp codes using yubikey</xbar.desc> 8 | # <xbar.dependencies>bash</xbar.dependencies> 9 | # <xbar.abouturl>https://github.com/brute-force/</xbar.abouturl> 10 | # <xbar.version>1.0</xbar.version> 11 | # clicking on an item will copy the code to the clipboard 12 | 13 | if [ $# -eq 3 ] && [ "$1" = "copy" ]; then 14 | echo -n "$3" | pbcopy 15 | osascript -e "display notification \" $3 copied to clipboard\" with title \"$2\"" &> /dev/null 16 | exit 17 | else 18 | echo "TOTP" 19 | echo "---" 20 | 21 | /usr/local/bin/ykman oath code | while read -r line 22 | do 23 | account=${line/%:* *[0-9]/} 24 | code=${line##* } 25 | 26 | # trim account name to max characters 27 | account_length_max=20 28 | account=${account:0:account_length_max} 29 | 30 | # pad code to for alignment 31 | code_length_max=6 32 | width=$((account_length_max - ${#account} + code_length_max)) 33 | item=$(printf "%s %*s" "$account" $width "$code") 34 | 35 | echo "$item | color=green font=Menlo size=13 bash='$0' param1=copy param2=\"$account\" param3=$code refresh=true terminal=false" 36 | done 37 | 38 | exit 39 | fi 40 | -------------------------------------------------------------------------------- /System/trash-collector.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Trash Collector</xbar.title> 4 | # <xbar.version>v1.2</xbar.version> 5 | # <xbar.author>Carlson Orozco</xbar.author> 6 | # <xbar.author.github>carlsonorozco</xbar.author.github> 7 | # <xbar.desc>Trash Collector is a plugin for BitBar that enables you to empty your trash.</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/carlsonorozco/trash-collector/master/image.png</xbar.image> 9 | # <xbar.abouturl>https://github.com/carlsonorozco/trash-collector</xbar.abouturl> 10 | 11 | trash_count=$(find "$HOME/.Trash/" | wc -l) 12 | trash_count=$((trash_count-1)) 13 | 14 | trash_size=$(du -sh "$HOME/.Trash/" | xargs | head -n1 | cut -d " " -f1) 15 | 16 | if [ "$1" = 'empty' ]; then 17 | osascript -e ' 18 | tell application "Finder" 19 | empty the trash 20 | end tell' 21 | exit 22 | fi 23 | 24 | if [ "$1" = 'open' ]; then 25 | open "$HOME/.Trash/" 26 | exit 27 | fi 28 | 29 | if [[ "$trash_size" == "0B" ]]; then 30 | echo "🗑 | bash='$0' param1=open terminal=false" 31 | else 32 | echo "$trash_size🗑" 33 | echo "$trash_count items 🗑 | alternate=true" 34 | echo '---' 35 | echo "Open Trash | bash='$0' param1=open terminal=false" 36 | echo "Empty Trash | bash='$0' param1=empty terminal=false" 37 | fi 38 | -------------------------------------------------------------------------------- /System/umbrella.5s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | ## <xbar.title>UmbrellaBeGone</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # # <xbar.author>Jeff Levensailor</xbar.author> 6 | # # <xbar.author.github>levensailor</xbar.author.github> 7 | # # <xbar.desc>Enable/Disable Umbrella with Status on Menubar</xbar.desc> 8 | # # <xbar.dependancies>umbrella.15s.sh</xbar.dependancies> 9 | 10 | # Dependancies: 11 | # If you want seamless integration, add NOPASSWD=ALL to admin account in /etc/sudoers file 12 | 13 | export PATH="$PATH:/usr/local/bin" 14 | umbrella_status() { 15 | status=$(sudo launchctl list | grep com.cisco.anyconnect.vpnagentd) 16 | if [ "$status" != "" ]; then 17 | echo "👆" 18 | elif [ "$status" = "" ]; then 19 | echo "👇" 20 | else echo "err" 21 | fi 22 | #echo "$status" 23 | } 24 | 25 | enable_umbrella() { 26 | sudo launchctl load /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist && umbrella_status 27 | } 28 | disable_umbrella() { 29 | sudo launchctl unload /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist && umbrella_status 30 | } 31 | 32 | if [ "${1}" == "enable" ]; then 33 | enable_umbrella 34 | 35 | 36 | elif [ "${1}" == "disable" ]; then 37 | disable_umbrella 38 | 39 | else 40 | umbrella_status 41 | echo "---" 42 | echo "---" 43 | echo "Enable Umbrella | bash=$0 param1=enable terminal=false" 44 | echo "---" 45 | echo "Disable Umbrella | bash=$0 param1=disable terminal=false" 46 | fi 47 | -------------------------------------------------------------------------------- /System/unmount.10.js: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/node 2 | // <xbar.title>Unmount</xbar.title> 3 | // <xbar.version>v1.0</xbar.version> 4 | // <xbar.author>Nigel Scott</xbar.author> 5 | // <xbar.author.github>gruntfuggly</xbar.author.github> 6 | // <xbar.desc>Allows volumes to be ejected/unmounted.</xbar.desc> 7 | // <xbar.image>https://i.imgur.com/EcCmyng.png</xbar.image> 8 | // <xbar.dependencies>node</xbar.dependencies> 9 | 10 | var child_process = require( 'child_process' ); 11 | 12 | var mountedVolumes = child_process.execSync( "ls -1 /Volumes" ).toString().trim().split( '\n' ); 13 | var volumes = child_process.execSync( "diskutil list external physical" ).toString().trim().split( '\n' ); 14 | 15 | var volumeMap = {}; 16 | 17 | volumes.map( function( volume ) 18 | { 19 | // Should find a better way to do this... 20 | var name = volume.substr( 33, 23 ).trim(); 21 | var identifier = volume.substr( 68 ); 22 | 23 | if( name && identifier !== 'IDENTIFIER' ) 24 | { 25 | volumeMap[ name ] = identifier; 26 | } 27 | } ); 28 | 29 | var entries = []; 30 | 31 | mountedVolumes.map( function( volume ) 32 | { 33 | if( volumeMap[ volume ] ) 34 | { 35 | var entry = volume + " | terminal=false refresh=true bash=/usr/sbin/diskutil param1=unmount param2=" + volumeMap[ volume ]; 36 | entries.push( entry ); 37 | } 38 | } ); 39 | 40 | if( entries.length > 0 ) 41 | { 42 | console.log( "⏏" ); 43 | console.log( "---" ); 44 | entries.map( function( entry ) 45 | { 46 | console.log( entry ); 47 | } ); 48 | } 49 | -------------------------------------------------------------------------------- /System/usbInfo.10s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>USB Device Details</xbar.title> 4 | # <xbar.author>Raemond Bergstrom-Wood</xbar.author> 5 | # <xbar.author.github>RaemondBW</xbar.author.github> 6 | # <xbar.desc>Displays the device details user input usb devices</xbar.desc> 7 | # <xbar.version>1.1</xbar.version> 8 | 9 | print("USB") 10 | print('---') 11 | import plistlib 12 | import subprocess 13 | def findDevices(itemList): 14 | for device in itemList: 15 | if '_items' in device: 16 | findDevices(device['_items']) 17 | elif 'Built-in_Device' in device and device['Built-in_Device'] == 'Yes': 18 | continue 19 | else: 20 | print("Name:\t\t\t" + device['_name'] + '| bash=/usr/bin/open param1="/System/Applications/Utilities/System Information.app" terminal=false') 21 | if 'manufacturer' in device: 22 | print("Manufacturer:\t" + device['manufacturer'] + '| bash=/usr/bin/open param1="/System/Applications/Utilities/System Information.app" terminal=false') 23 | print('---') 24 | 25 | usbPlist = subprocess.check_output(['system_profiler', '-xml', 'SPUSBDataType']) 26 | usbInfo = plistlib.loads(usbPlist) 27 | findDevices(usbInfo) 28 | -------------------------------------------------------------------------------- /System/webpack-status.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # <xbar.title>Webpack Status</xbar.title> 4 | # <xbar.version>v1.1.2</xbar.version> 5 | # <xbar.author>Francesco Belladonna</xbar.author> 6 | # <xbar.author.github>Fire-Dragon-DoL</xbar.author.github> 7 | # <xbar.desc>Display the current status of webpack server compile: completed/ongoing/failed.</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/Fire-Dragon-DoL/bitbar-webpack-status-plugin/master/bitbar-webpack-status-plugin.jpg</xbar.image> 9 | # <xbar.dependencies>node,webpack</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/Fire-Dragon-DoL/bitbar-webpack-status-plugin</xbar.abouturl> 11 | 12 | color_red="✘ | color=#ff0000 dropdown=false" 13 | color_yellow="◉ | color=#ffa500 dropdown=false" 14 | color_green="✔︎ | color=#008000 dropdown=false" 15 | 16 | webpack_status="/tmp/webpack-status" 17 | 18 | semaphore=0 19 | 20 | if [ -f $webpack_status ]; then 21 | semaphore=$(cat $webpack_status) 22 | fi 23 | 24 | semaphore_color=$color_yellow 25 | 26 | # -1 red, 0 yellow, 1 green 27 | case $semaphore in 28 | -1) 29 | # Red 30 | semaphore_color=$color_red 31 | ;; 32 | 1) 33 | # Green 34 | semaphore_color=$color_green 35 | ;; 36 | *) 37 | # Orange 38 | semaphore_color=$color_yellow 39 | ;; 40 | esac 41 | 42 | echo "$semaphore_color" 43 | echo "---" 44 | echo "Clear Webpack Status | terminal=false bash=rm param1=-f param2='$webpack_status'" 45 | -------------------------------------------------------------------------------- /Time/ProcessBarOfYear.1d.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Process Bar of Year: Dividing the year into 100 pieces. 4 | # 5 | # by Cnfn (http://github.com/cnfn) 6 | # 7 | # <xbar.title>Process Bar of Year</xbar.title> 8 | # <xbar.version>v1.0</xbar.version> 9 | # <xbar.author>Cnfn</xbar.author> 10 | # <xbar.author.github>cnfn</xbar.author.github> 11 | # <xbar.desc>Process Bar of Year: Dividing the year into 100 pieces. More info: https://github.com/cnfn/BitBarPlugins/tree/master/ProcessBarOfYear</xbar.desc> 12 | # <xbar.image>https://raw.githubusercontent.com/cnfn/grocery/master/images/blog/bitbar_plugin_process_bar_of_year.png</xbar.image> 13 | # <xbar.dependencies>bash</xbar.dependencies> 14 | # <xbar.abouturl>https://github.com/cnfn/BitBarPlugins/tree/master/ProcessBarOfYear</xbar.abouturl> 15 | 16 | get_total_days_of_year() { 17 | year=$1 18 | if (( !(year % 4) && ( year % 100 || !(year % 400) ) )) 19 | then 20 | echo 366 21 | else 22 | echo 365 23 | fi 24 | } 25 | 26 | days_of_year="$(get_total_days_of_year "$(date +%Y)")" 27 | 28 | echo "$(echo "$(date +%j) * 100 / $days_of_year" | bc)""%" 29 | echo "---" 30 | echo -n "$(date +%Y) has completed " 31 | echo -n "$(date +%j | bc)" 32 | echo " days" 33 | -------------------------------------------------------------------------------- /Time/age-clock.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S PATH="${PATH}:/opt/homebrew/bin:/usr/local/bin" python3 2 | 3 | # <xbar.title>Age Clock</xbar.title> 4 | # <xbar.version>v1.0.0</xbar.version> 5 | # <xbar.author>Richard Jones</xbar.author> 6 | # <xbar.author.github>nomasprime</xbar.author.github> 7 | # <xbar.desc>Displays your age in a clock format [y:m:d]</xbar.desc> 8 | # <xbar.dependencies>python</xbar.dependencies> 9 | # <xbar.var>number(VAR_BIRTH_YEAR=1970): Birth year</xbar.var> 10 | # <xbar.var>number(VAR_BIRTH_MONTH=1): Birth month</xbar.var> 11 | # <xbar.var>number(VAR_BIRTH_DAY=1): Birth day</xbar.var> 12 | 13 | from dateutil.relativedelta import * 14 | from datetime import datetime 15 | import os 16 | 17 | today = datetime.today() 18 | 19 | dob = datetime( 20 | int(os.environ['VAR_BIRTH_YEAR']), 21 | int(os.environ['VAR_BIRTH_MONTH']), 22 | int(os.environ['VAR_BIRTH_DAY']) 23 | ) 24 | 25 | age = relativedelta(today, dob) 26 | 27 | print("%02d:%02d:%02d" % (age.years, age.months, age.days)) 28 | -------------------------------------------------------------------------------- /Time/age-ticker.1s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Age Ticker</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Gary Thung</xbar.author> 6 | # <xbar.author.github>garythung</xbar.author.github> 7 | # <xbar.desc>Displays your age ticking in years with decimals. Set your birthday in the script.</xbar.desc> 8 | # <xbar.image>https://github.com/garythung/bitbar-age-ticker/blob/master/bitbar-age-ticker.gif?raw=true</xbar.image> 9 | # <xbar.dependencies>python</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/garythung/bitbar-age-ticker</xbar.abouturl> 11 | 12 | import datetime 13 | 14 | # Your Birthday 15 | birthday_year = 1970 16 | birthday_month = 1 17 | birthday_day = 1 18 | 19 | birthday = datetime.datetime(birthday_year, birthday_month, birthday_day) 20 | now = datetime.datetime.now() 21 | seconds = (now - birthday).total_seconds() 22 | years = seconds / 31536000 23 | 24 | print("%.12f" % years) # change the number to change precision 25 | -------------------------------------------------------------------------------- /Time/beats.1s.lisp: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/clisp 2 | 3 | ; <xbar.title>Beats Time</xbar.title> 4 | ; <xbar.version>v1.1</xbar.version> 5 | ; <xbar.author>Jannis Segebrecht</xbar.author> 6 | ; <xbar.author.github>queitsch</xbar.author.github> 7 | ; <xbar.desc>Displays Swatch .beats time.</xbar.desc> 8 | ; <xbar.dependencies>clisp</xbar.dependencies> 9 | ; <xbar.image>http://i.imgur.com/W0iKDfu.png</xbar.image> 10 | 11 | (format t "~A" ;print without quotes 12 | (concatenate 'string 13 | "@" 14 | (format nil "~$" ;print two decimal places 15 | (/ (mod (+ (mod 16 | (get-universal-time) 86400) 3600) 86400) 86.4)))) 17 | -------------------------------------------------------------------------------- /Time/cal.1d.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>cal</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Buster Collings</xbar.author> 6 | # <xbar.author.github>busterc</xbar.author.github> 7 | # <xbar.desc>Shows a calendar of the current, previous and next year</xbar.desc> 8 | # <xbar.image>https://raw.githubusercontent.com/busterc/bitbar-cal/master/screenshot.png</xbar.image> 9 | # <xbar.dependencies>bash</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/busterc/bitbar-cal</xbar.abouturl> 11 | 12 | year=$(date +%Y) 13 | last_year=$((year-1)) 14 | next_year=$((year+1)) 15 | 16 | echo "$year" 17 | echo "---" 18 | 19 | echo "$last_year" 20 | cal "$last_year" | while IFS= read -r i; do echo "--$i | trim=false font=courier"; done 21 | (cal -h "$year" 2>/dev/null || cal "$year") | while IFS= read -r i; do echo "$i | trim=false font=courier"; done 22 | cal "$next_year" | while IFS= read -r i; do echo "$i | trim=false font=courier"; done 23 | -------------------------------------------------------------------------------- /Time/epoch.60s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # <xbar.title>Pretty Epoch Time</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Anthony Jarvis-Clark</xbar.author> 6 | # <xbar.author.github>anthonyclarka2</xbar.author.github> 7 | # <xbar.desc>Displays epoch (unix) time separated by commas.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/ltLqOcy.png</xbar.image> 9 | # <xbar.dependencies>bash,gnu-sed</xbar.dependencies> 10 | 11 | BREWPATH=/usr/local/bin 12 | if [[ $(sysctl -n machdep.cpu.brand_string) =~ "Apple" ]]; then 13 | BREWPATH=/opt/homebrew/bin 14 | fi 15 | 16 | EPOCHNOW=$(/bin/date +%s | ${BREWPATH}/gsed ':a;s/\B[0-9]\{3\}\>/,&/;ta') 17 | 18 | echo "{" "${EPOCHNOW}" "}" 19 | -------------------------------------------------------------------------------- /Time/itstimeto.15m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>It's time to</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Kouji Anzai</xbar.author> 6 | # <xbar.author.github>kanzmrsw</xbar.author.github> 7 | # <xbar.desc>Shows emoji means that it's time to do something.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/qRgqIVq.png</xbar.image> 9 | # <xbar.dependencies>python</xbar.dependencies> 10 | 11 | import datetime 12 | 13 | d = datetime.datetime.now().time() 14 | morning = datetime.time(9,0,0) 15 | daytime = datetime.time(17,30,0) 16 | night = datetime.time(22,0,0) 17 | 18 | if d < morning: 19 | print('🌅') 20 | elif morning <= d < daytime: 21 | print('👷') 22 | elif daytime <= d < night: 23 | print('🍺') 24 | else: 25 | print('💤') 26 | -------------------------------------------------------------------------------- /Time/persiandate.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Persian Date</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Ilia Vakili</xbar.author> 6 | # <xbar.author.github>theReticent</xbar.author.github> 7 | # <xbar.desc>Shows Persian date</xbar.desc> 8 | # <xbar.image></xbar.image> 9 | # <xbar.dependencies>jcal</xbar.dependencies> 10 | 11 | # To fix the "command not found" caused by installing jcal using brew 12 | PATH=/usr/local/bin:$PATH 13 | 14 | jdate "+%W" 15 | echo "---" 16 | jdate "+%G %d %V %Y" 17 | -------------------------------------------------------------------------------- /Time/solar-time.1s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Apparent Solar Time</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Alexandre André</xbar.author> 6 | # <xbar.author.github>XanderLeaDaren</xbar.author.github> 7 | # <xbar.desc>Displays the apparent solar time. Specify your longitude in the script.</xbar.desc> 8 | # <xbar.image>https://github.com/XanderLeaDaren/bitbar-solar-time/blob/master/bitbar_solar-time.jpg?raw=true</xbar.image> 9 | # <xbar.dependencies>python</xbar.dependencies> 10 | # <xbar.abouturl>https://github.com/XanderLeaDaren/bitbar-solar-time</xbar.abouturl> 11 | 12 | import datetime 13 | from math import sin 14 | import time 15 | 16 | # Local time and day of the year 17 | today = datetime.datetime.now() 18 | day = today.timetuple().tm_yday 19 | 20 | # Longitude on Earth (easily find it on http://ipinfo.io/json) 21 | lg = 5.1413 22 | pos = lg/360*24*60 23 | 24 | # Time zone and Equation of time 25 | tz = time.timezone 26 | eq_time = 7.655*sin(2*(day-4))+9.873*sin(4*(day-172)) 27 | 28 | # Local solar time 29 | sun = today - datetime.timedelta(minutes=-pos+eq_time,seconds=-tz) 30 | print("☀️ "+sun.strftime('%H:%M:%S')) 31 | print("---") 32 | print("Time Zone Offset: "+str(tz/3600)+" h") 33 | print("Position Offset: %.3f" % pos+" min") 34 | print("Equation of Time: %.3f" % -eq_time+" min") 35 | -------------------------------------------------------------------------------- /Time/spent_time.1s.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>Spent time displayer</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Gabriel de Maeztu</xbar.author> 6 | # <xbar.author.github>merqurio</xbar.author.github> 7 | # <xbar.desc>Display the time of the year already gone as percentage</xbar.desc> 8 | # <xbar.dependencies>python</xbar.dependencies> 9 | 10 | import datetime 11 | from calendar import monthrange, isleap 12 | 13 | now = datetime.datetime.now() 14 | day = datetime.datetime(now.year, now.month, now.day) 15 | month = datetime.datetime(now.year, now.month, 1) 16 | year = datetime.datetime(now.year, 1, 1) 17 | 18 | day_in_seconds = 24*60*60 19 | 20 | if isleap(year.year): 21 | number_of_days = 366 22 | else: 23 | number_of_days = 365 24 | 25 | spent_day = ((now-day).seconds*100)/day_in_seconds 26 | spent_month = (int((now-month).total_seconds()) *100)/(monthrange(month.year, month.month)[1]*day_in_seconds) 27 | spent_year = (int((now-year).total_seconds())*100)/(number_of_days*day_in_seconds) 28 | 29 | def display(): 30 | print(('Day → {:.0f}%'.format(spent_day))) 31 | print('---') 32 | print(('Day → {:.0f}%'.format(spent_day))) 33 | print(('Month → {:.0f}%'.format(spent_month))) 34 | print(('Year → {:.0f}%'.format(spent_year))) 35 | 36 | if __name__ == '__main__': 37 | display() 38 | -------------------------------------------------------------------------------- /Time/timezone.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Timezone</xbar.title> 4 | # <xbar.version>v1.0.0</xbar.version> 5 | # <xbar.author>Toni Hoffmann</xbar.author> 6 | # <xbar.author.github>xremix</xbar.author.github> 7 | # <xbar.desc>Show the current time of a different timezone.</xbar.desc> 8 | 9 | Prefix="FL" 10 | Time_Zone="US/Eastern" 11 | TZ=":$Time_Zone" date "+$Prefix %H:%M" 12 | -------------------------------------------------------------------------------- /Time/timezonesplus.30s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Timezones+</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Aaron Edell</xbar.author> 6 | # <xbar.author.github>aaronedell</xbar.author.github> 7 | # <xbar.desc>Rotates current time through four common timezones </xbar.desc> 8 | # <xbar.image>http://i.imgur.com/Y4nhdZo.png</xbar.image> 9 | # <xbar.dependencies>Bash GNU AWK</xbar.dependencies> 10 | 11 | echo -n "NY " ; TZ=":US/Eastern" date +'%l:%M %p' 12 | echo -n "SF " ; TZ=":US/Pacific" date +'%l:%M %p' 13 | echo -n "LN " ; TZ=":Europe/London" date +'%l:%M %p' 14 | echo -n "HK " ; TZ="Asia/Hong_Kong" date +'%l:%M %p' 15 | -------------------------------------------------------------------------------- /Time/unixtime.5s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Unix Time</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Mat Ryer</xbar.author> 6 | # <xbar.author.github>matryer</xbar.author.github> 7 | # <xbar.desc>Displays unix time.</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/h2cyuYu.png</xbar.image> 9 | 10 | date +%s 11 | -------------------------------------------------------------------------------- /Time/waketime.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Waketime</xbar.title> 4 | # <xbar.version>v1.0.1</xbar.version> 5 | # <xbar.author>Matthias Vogt</xbar.author> 6 | # <xbar.author.github>matthias-vogt</xbar.author.github> 7 | # <xbar.desc>Shows the time since your mac last woke up in hours:minutes</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/jsB66g9.png</xbar.image> 9 | 10 | wake=$( 11 | sysctl -a | grep 'waketime' | grep -o "\d\{10\}" || 12 | sysctl -a | grep 'boottime' | grep -o "\d\{10\}" 13 | ); 14 | now=$(date +'%s'); 15 | 16 | hours=$(echo "($now - $wake)/3600" | bc) 17 | minutes=$(echo "(($now - $wake)/60)%60" | bc) 18 | 19 | echo "$hours:$(printf "%02d" "$minutes")h" 20 | -------------------------------------------------------------------------------- /Time/watson.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Watson Status 4 | # 5 | # by Antoine Corcy <contact@sbin.dk> 6 | # 7 | # <xbar.title>Watson Status</xbar.title> 8 | # <xbar.version>1.0</xbar.version> 9 | # <xbar.author>Antoine Corcy</xbar.author> 10 | # <xbar.author.github>toin0u</xbar.author.github> 11 | # <xbar.desc>Shows Watson's status</xbar.desc> 12 | # <xbar.dependencies>Watson</xbar.dependencies> 13 | # <xbar.image>https://i.imgur.com/3OuXrWn.png</xbar.image> 14 | # 15 | # Dependencies: 16 | # watson (http://tailordev.github.io/Watson/) 17 | 18 | # get the status text 19 | status=$(/usr/local/bin/watson status) 20 | 21 | # show watson 22 | if [[ "$status" == "No project started" ]] 23 | then 24 | echo "⏱ Watson" 25 | exit 1 26 | fi 27 | 28 | # get the project name 29 | project=$(echo "$status" | awk '{printf "⏱ %s", $2}') 30 | 31 | # get the started time and uppercase the sentence 32 | started=$(echo "$status" | grep -E -o 'started (.*) \(') 33 | started="$(tr '[:lower:]' '[:upper:]' <<< "${started:0:1}")${started:1}" 34 | 35 | # get the tags 36 | tags=$(echo "$status" | awk -F "[][]" '{printf "Tags: %s\n", $2}') 37 | 38 | # main 39 | echo "$project" 40 | echo "---" 41 | echo "${started/(/} | color=green" 42 | echo "$tags" 43 | -------------------------------------------------------------------------------- /Time/weeknumber.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Week Number</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Steffen Froehlich</xbar.author> 6 | # <xbar.author.github>citoki</xbar.author.github> 7 | # <xbar.desc>This plugin will show the current week number.</xbar.desc> 8 | # <xbar.image>https://i.imgur.com/bfKN7x2.png</xbar.image> 9 | # <xbar.dependencies></xbar.dependencies> 10 | 11 | date +"%V" 12 | -------------------------------------------------------------------------------- /Time/worldclock.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Display UTC in the menubar, and one or more additional zones in the drop down. 4 | # The current format (HH:MM:SS) works best with a one second refresh, or alter 5 | # the format and refresh rate to taste. 6 | # 7 | # <xbar.title>World Clock</xbar.title> 8 | # <xbar.version>v1.1</xbar.version> 9 | # <xbar.author>Adam Snodgrass</xbar.author> 10 | # <xbar.author.github>asnodgrass</xbar.author.github> 11 | # <xbar.desc>Display current UTC time in the menu bar, with various timezones in the drop-down menu</xbar.desc> 12 | # <xbar.image>https://cloud.githubusercontent.com/assets/6187908/12207887/464ff8b2-b617-11e5-9d61-787eed228552.png</xbar.image> 13 | # <xbar.var>string(VAR_ZONES="Australia/Sydney Europe/Amsterdam America/New_York America/Los_Angeles"): Space delimited set of timezones</xbar.var> 14 | 15 | ZONES=${VAR_ZONES} 16 | date -u +'%H:%M:%S UTC | font=Monaco' 17 | echo '---' 18 | for zone in $ZONES; do 19 | echo "$(TZ=$zone date +'%H:%M:%S %z') $zone | font=Monaco" 20 | done 21 | -------------------------------------------------------------------------------- /Tools/chunkwm_skhd.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>chunkwm/skhd helper</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Shi Han NG</xbar.author> 6 | # <xbar.author.github>shihanng</xbar.author.github> 7 | # <xbar.desc>Plugin that displays desktop id and desktop mode of chunkwm.</xbar.desc> 8 | # <xbar.dependencies>brew,chunkwm,skhd</xbar.dependencies> 9 | 10 | # Info about chunkwm, see: https://github.com/koekeishiya/chunkwm 11 | # For skhd, see: https://github.com/koekeishiya/skhd 12 | 13 | export PATH=/usr/local/bin:$PATH 14 | 15 | if [[ "$1" = "stop" ]]; then 16 | brew services stop chunkwm 17 | brew services stop skhd 18 | fi 19 | 20 | if [[ "$1" = "restart" ]]; then 21 | brew services restart chunkwm 22 | brew services restart skhd 23 | fi 24 | 25 | echo "$(chunkc tiling::query --desktop id):$(chunkc tiling::query --desktop mode) | length=5" 26 | echo "---" 27 | echo "Restart chunkwm & skhd | bash='$0' param1=restart terminal=false" 28 | echo "Stop chunkwm & skhd | bash='$0' param1=stop terminal=false" 29 | -------------------------------------------------------------------------------- /Tools/keybase-encrypt.10m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env LC_ALL=en_US.UTF-8 ruby 2 | 3 | # <xbar.title>Keybase Encrypt/Decrypt</xbar.title> 4 | # <xbar.version>v0.1</xbar.version> 5 | # <xbar.author>Ash Wu(hSATAC), Aaron Huang(aar0ntw)</xbar.author> 6 | # <xbar.author.github>pan-cat</xbar.author.github> 7 | # <xbar.desc>A helper for keybase encryption and decryption. Simply copy content you want to decrypt/encrypt and click action, the result will be copied into your clipboard.</xbar.desc> 8 | # <xbar.dependencies>ruby,keybase</xbar.dependencies> 9 | 10 | #--- User parameters ---------------------------------------------------------- 11 | KEYBASE = "/usr/local/bin/keybase" 12 | 13 | #--- Script internals --------------------------------------------------------- 14 | # TODO: Handle keybase cli error with color or icon? 15 | 16 | REFRESH = "---\nRefresh | refresh=true" 17 | 18 | # decrypt 19 | if ARGV[0] == "decrypt" 20 | `/usr/bin/pbpaste | #{KEYBASE} decrypt | /usr/bin/pbcopy` 21 | exit 22 | end 23 | 24 | # ecrypt 25 | if ARGV[0] == "encrypt" 26 | target = ARGV[1] 27 | `/usr/bin/pbpaste | #{KEYBASE} encrypt #{target} | /usr/bin/pbcopy` 28 | exit 29 | end 30 | 31 | 32 | icon = "🔑" 33 | 34 | 35 | following = `#{KEYBASE} list-following`.split("\n").map{|f| 36 | "--#{f} | bash=#{__FILE__} param1=encrypt param2=#{f} terminal=false" 37 | }.join("\n") 38 | 39 | 40 | puts """ 41 | #{icon} 42 | --- 43 | Encrypt 44 | #{following} 45 | --- 46 | Decrypt | bash='#{__FILE__}' param1=decrypt terminal=false 47 | --- 48 | #{REFRESH} 49 | """ 50 | -------------------------------------------------------------------------------- /Tools/statuspage.1m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matryer/xbar-plugins/81b05a9e584d7891d7c7a9fccc4d8f9aa8596c70/Tools/statuspage.1m.png -------------------------------------------------------------------------------- /Tools/todotxt.15s.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | ## <xbar.title>Todo.txt</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # # <xbar.author>Dwight Spencer</xbar.author> 6 | # # <xbar.author.github>denzuko</xbar.author.github> 7 | # # <xbar.desc>Todo.txt intergration with mac gui, click to do a item</xbar.desc> 8 | # # <xbar.dependancies>todo.sh</xbar.dependancies> 9 | 10 | # Dependancies: 11 | # todo.sh (brew install todo.sh) 12 | 13 | export PATH="$PATH:/usr/local/bin" 14 | 15 | list_items() { 16 | todo.sh ls | awk 'NR>1 {print buf}{buf = $0}' | sed '/--/d' | awk ' { print $0,"| bash=/usr/local/bin/todo.sh param1=do param2="$1" terminal=false refresh=true" }' 17 | } 18 | 19 | add_item() { 20 | todo.sh add "$(osascript -e 'Tell application "System Events" to display dialog "New task:" default answer ""' -e 'text returned of result' 2>/dev/null)" >/dev/null 21 | } 22 | 23 | if [ "${1}" == "add" ]; then 24 | add_item 25 | else 26 | echo "🗒" 27 | echo "---" 28 | list_items 29 | echo "---" 30 | echo "Add task | bash=$0 param1=add" 31 | fi 32 | -------------------------------------------------------------------------------- /Tools/wallpaper_refresh.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Wallpaper refresh</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Anmol Arora</xbar.author> 6 | # <xbar.author.github>anmolarora</xbar.author.github> 7 | # <xbar.desc>A new HD wallpaper every hour.</xbar.desc> 8 | 9 | echo 'W' 10 | echo --- 11 | 12 | # Download image from server 13 | curl "$(curl https://powerful-inlet-26346.herokuapp.com/image_url)" > "/tmp/wallpaper_refresh_image.png" 14 | # Set image as wallpaper 15 | SCRIPT_TEXT='tell application "Finder" to set desktop picture to POSIX file "/tmp/wallpaper_refresh_image.png"' 16 | osascript -e "${SCRIPT_TEXT}" 17 | -------------------------------------------------------------------------------- /Tools/wol/wol-nas.10s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>Wake on LAN (WoL)</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Michael R.</xbar.author> 6 | # <xbar.author.github>The-Michael-R</xbar.author.github> 7 | # <xbar.desc>Small xbar plugin to wake one server/computer using a WoL packet. Needs https://github.com/jpoliv/wakeonlan (brew or place the file wakeonlan to /urs/local/bin</xbar.desc> 8 | # <xbar.image>https://user-images.githubusercontent.com/21987859/131717928-875658f8-2712-4cf8-9765-fbce1dc15506.png</xbar.image> 9 | # <xbar.dependencies>bash, wakeonlan (brew install)</xbar.dependencies> 10 | 11 | # Parameters (please use use the MAC/IP-Address of your server) 12 | # <xbar.var>string(VAR_IP="127.0.0.1"): Server-IP.</xbar.var> 13 | # <xbar.var>string(VAR_MAC="12:34:56:78:AB:CD"): Server-MAC address.</xbar.var> 14 | 15 | GREEN="\033[32m" 16 | RED="\033[31m" 17 | NORMAL="\033[0m" 18 | 19 | if ping -t 1 -c 1 ${VAR_IP} &> /dev/null 20 | then 21 | echo -e "WOL${GREEN}⇡${NORMAL}" 22 | echo "---" 23 | echo "NAS is UP" 24 | else 25 | echo -e "WOL${RED}⇣${NORMAL}" 26 | echo "---" 27 | echo "Wake NAS | shell='/usr/local/bin/wakeonlan' param1='${VAR_MAC}' " 28 | fi 29 | 30 | -------------------------------------------------------------------------------- /Tools/yabai_skhd.1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # <xbar.title>yabai/skhd helper</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>James Won</xbar.author> 6 | # <xbar.author.github>jwon</xbar.author.github> 7 | # <xbar.desc>Plugin that displays desktop id and desktop mode of yabai.</xbar.desc> 8 | # <xbar.dependencies>brew,yabai,skhd</xbar.dependencies> 9 | 10 | # Info about yabai, see: https://github.com/koekeishiya/yabai 11 | # For skhd, see: https://github.com/koekeishiya/skhd 12 | # This plugin has been forked from https://github.com/matryer/bitbar-plugins/blob/master/Tools/chunkwm_skhd.1s.sh 13 | 14 | export PATH=/usr/local/bin:$PATH 15 | 16 | if [[ "$1" = "stop" ]]; then 17 | brew services stop yabai 18 | brew services stop skhd 19 | fi 20 | 21 | if [[ "$1" = "restart" ]]; then 22 | brew services restart yabai 23 | brew services restart skhd 24 | fi 25 | 26 | echo "$(yabai -m query --spaces --display | jq 'map(select(."has-focus"))[-1].index'):$(yabai -m query --spaces --display | jq -r 'map(select(."has-focus"))[-1].type') | length=5" 27 | echo "---" 28 | echo "Restart yabai & skhd | bash='$0' param1=restart terminal=false" 29 | echo "Stop yabai & skhd | bash='$0' param1=stop terminal=false" 30 | -------------------------------------------------------------------------------- /Weather/sunrise-sunset/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Kipras Melnikovas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Weather/sunrise-sunset/README.md: -------------------------------------------------------------------------------- 1 | # sunset-sunrise 2 | 3 | ![](./sun-full.png) 4 | 5 | https://github.com/kiprasmel/xbar-plugins 6 | 7 | [MIT](./LICENSE) (c) 2024 Kipras Melnikovas 8 | -------------------------------------------------------------------------------- /Weather/sunrise-sunset/sun-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matryer/xbar-plugins/81b05a9e584d7891d7c7a9fccc4d8f9aa8596c70/Weather/sunrise-sunset/sun-full.png -------------------------------------------------------------------------------- /Weather/sunrise-sunset/sun-indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matryer/xbar-plugins/81b05a9e584d7891d7c7a9fccc4d8f9aa8596c70/Weather/sunrise-sunset/sun-indicator.png -------------------------------------------------------------------------------- /Weather/wttr-in.15m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Metadata: 4 | # <xbar.title>wttr.in</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>kawarimidoll</xbar.author> 7 | # <xbar.author.github>kawarimidoll</xbar.author.github> 8 | # <xbar.desc>Show current weather using wttr.in.</xbar.desc> 9 | # <xbar.image>https://raw.githubusercontent.com/kawarimidoll/kawarimidoll/master/assets/xbar-wttr-in.png</xbar.image> 10 | # <xbar.dependencies>curl</xbar.dependencies> 11 | 12 | # Variables: 13 | # <xbar.var>string(VAR_LOCATION="Cupertino"): Your location.</xbar.var> 14 | # <xbar.var>string(VAR_FORMAT="3"): Display format. Ref: https://github.com/chubin/wttr.in#one-line-output</xbar.var> 15 | 16 | curl "wttr.in/${VAR_LOCATION}?format=${VAR_FORMAT}" 17 | -------------------------------------------------------------------------------- /Web/beeminder.10m.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # <xbar.title>Beeminder</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>Ben Congdon</xbar.author> 7 | # <xbar.author.github>bcongdon</xbar.author.github> 8 | # <xbar.image>https://i.imgur.com/XamwU1E.png</xbar.image> 9 | # <xbar.desc>Displays your active Beeminder goals and their due dates/amounts</xbar.desc> 10 | # <xbar.dependencies>python,requests</xbar.dependencies> 11 | 12 | import requests 13 | 14 | # NOTE: Change these to set your credentials 15 | USERNAME = '' 16 | AUTH_TOKEN = '' 17 | 18 | # Don't change anythine below this line 19 | if not USERNAME or not AUTH_TOKEN: 20 | print('⚠️\n---\nBeeminder: No username and/or auth token provided!') 21 | exit(1) 22 | API_URL = 'https://www.beeminder.com/api/v1/users/{}.json'.format(USERNAME) 23 | 24 | req = requests.get(API_URL, params=dict( 25 | auth_token=AUTH_TOKEN, datapoints_count=1, associations=True)) 26 | 27 | data = req.json() 28 | goals = data['goals'] 29 | 30 | output = '🐝\n---\n' 31 | max_slug_len = max(len(goal['slug']) + 1 for goal in goals) 32 | for goal in goals: 33 | if goal.get('coasting'): 34 | continue 35 | goal_url = 'https://www.beeminder.com/{}/{}'.format(USERNAME, goal['slug']) 36 | goal_params = 'href={} color={}'.format( 37 | goal_url, goal['roadstatuscolor']) 38 | output += "{:<20.15s}\t{}|{}\n".format(goal['slug'] + ':', 39 | goal['limsum'], goal_params) 40 | 41 | print(output) 42 | -------------------------------------------------------------------------------- /Web/bilibili.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # <xbar.title>B站UP主粉丝和投稿视频播放信息获取</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>胖哥带你入坑带你飞</xbar.author> 6 | # <xbar.author.github>bihell</xbar.author.github> 7 | # <xbar.desc>实时显示B站粉丝数和最新20次投稿的视频信息,请把userId改为你自己的。</xbar.desc> 8 | # <xbar.image>https://bihell.com/media/2020/02/bilibili-bitbar.jpg</xbar.image> 9 | # <xbar.dependencies>python</xbar.dependencies> 10 | # 11 | # by tpxcer 12 | 13 | import requests 14 | from datetime import datetime 15 | 16 | # 请把下面88900889改为你的用户Id 17 | userId = 88900889 18 | 19 | userInfoUrl = "https://api.bilibili.com/x/web-interface/card?mid=" + str(userId) 20 | userInfoRes = requests.request("GET", userInfoUrl).json() 21 | print("粉丝:" + str(userInfoRes['data']['follower'])) 22 | 23 | subMitVideosUrl = "http://space.bilibili.com/ajax/member/getSubmitVideos?mid=" + str(userId) 24 | subMitVideosRes = requests.request("GET", subMitVideosUrl).json() 25 | print("---") 26 | for video in subMitVideosRes["data"]["vlist"]: 27 | print(video["title"] + "| color=#123def href=http://bilibili.com/video/av" + str(video["aid"])) 28 | print(" 投稿时间:" + datetime.fromtimestamp(video["created"]).strftime("%Y-%m-%d %H:%M:%S") + 29 | " 时长:" + str(video["length"]) + 30 | " 播放:{0:6}".format(video["play"]) + 31 | " 收藏:" + str(video["favorites"]) + 32 | " 评论:" + str(video["comment"]) + 33 | " 弹幕:" + str(video["video_review"])) 34 | -------------------------------------------------------------------------------- /Web/cornify.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # <xbar.title>Unicorn!</xbar.title> 4 | # <xbar.version>v1.1</xbar.version> 5 | # <xbar.author>Martin Wilhelmi</xbar.author> 6 | # <xbar.author.github>mnin</xbar.author.github> 7 | # <xbar.desc>Unicorn</xbar.desc> 8 | # <xbar.image>http://i.imgur.com/UMphE3q.png</xbar.image> 9 | 10 | TIMESTAMP=$(date +"%s") 11 | IMAGE=$(curl -s -L "https://www.cornify.com/getacorn.php?r=$TIMESTAMP" | base64) 12 | 13 | echo '🦄' 14 | echo '---'; 15 | echo "| href=https://www.cornify.com/unicornpictures terminal=false image=$IMAGE" 16 | -------------------------------------------------------------------------------- /Web/faith_in_humanity_score.6h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=utf-8 3 | # 4 | # <xbar.title>Faith in humanity score</xbar.title> 5 | # <xbar.version>v1.0</xbar.version> 6 | # <xbar.author>impshum</xbar.author> 7 | # <xbar.author.github>impshum</xbar.author.github> 8 | # <xbar.desc>Displays current score from https://faithinhumanityscore.com</xbar.desc> 9 | # 10 | # by impshum 11 | 12 | from requests import get 13 | 14 | data = get('https://faithinhumanityscore.com/api.php').json() 15 | score = data['score'] 16 | print(score) 17 | -------------------------------------------------------------------------------- /Web/fb-dns/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Spencer Brown 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Web/fb-dns/README.md: -------------------------------------------------------------------------------- 1 | # fb-dns 2 | Watch Facebook DNS 3 | -------------------------------------------------------------------------------- /Web/fb-dns/screen-shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matryer/xbar-plugins/81b05a9e584d7891d7c7a9fccc4d8f9aa8596c70/Web/fb-dns/screen-shot.png -------------------------------------------------------------------------------- /Web/mailchimp.10m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | # <xbar.title>MailChimp Subscribers</xbar.title> 3 | # <xbar.version>v0.1.0</xbar.version> 4 | # <xbar.author>Tim Novis</xbar.author> 5 | # <xbar.author.github>timnovis</xbar.author.github> 6 | # <xbar.desc>Display your MailChimp subscriber count for a given list</xbar.desc> 7 | # <xbar.image>https://www.novis.co/media/misc/mc-bitbar.png</xbar.image> 8 | # <xbar.dependencies>ruby</xbar.dependencies> 9 | 10 | require 'net/http' 11 | require 'json' 12 | 13 | def main 14 | mc_user = "" # your mailchimp username 15 | mc_key = "" # a valid mailchimp API key 16 | mc_list = "" # the list ID you woud like to track 17 | mc_dc = "" # your mc datacenter location, e.g. us16 18 | 19 | req_uri = URI("https://#{mc_dc}.api.mailchimp.com/3.0/lists/#{mc_list}") 20 | 21 | http = Net::HTTP.new(req_uri.host, req_uri.port) 22 | http.use_ssl = true 23 | 24 | request = Net::HTTP::Get.new(req_uri) 25 | request.basic_auth(mc_user, mc_key) 26 | 27 | res = http.request(request) 28 | 29 | response = JSON.parse(res.body) 30 | 31 | return "MailChimp: " + response['stats']['member_count'].to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse 32 | end 33 | 34 | puts main 35 | -------------------------------------------------------------------------------- /Web/next_train.1m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>Irish Rail Trains</xbar.title> 3 | # <xbar.version>v1.0</xbar.version> 4 | # <xbar.author>Daniel Burke</xbar.author> 5 | # <xbar.author.github>dan.burke</xbar.author.github> 6 | # <xbar.desc>Retrieves next three trains at a particular station from Irish Rail</xbar.desc> 7 | # <xbar.image>http://i.imgur.com/PRa5B1m.png</xbar.image> 8 | # <xbar.dependencies>bash,jq</xbar.dependencies> 9 | # Depends on jq - https://stedolan.github.io/jq/ 10 | 11 | # Replace the STATIONID with the appropriate ID 12 | STATIONID='PERSE' 13 | # Replace the DIRECTION with the appropriate DIRECTION 14 | DIRECTION='Southbound' 15 | json=$(curl -s "https://dublin-trains.herokuapp.com/api/stations/$STATIONID/trains" | /usr/local/bin/jq -r '[ .[] | select(.direction == "'$DIRECTION'")| select(.train_type == "DART")]') 16 | echo "$json" | /usr/local/bin/jq -r 'map(select(.scheduled | contains ("--") | not) )| .[0] | "\(.last_update) - \(.due_in)"' 17 | echo '---' 18 | echo "$json" | /usr/local/bin/jq -r 'map(select(.scheduled | contains ("--") | not) )| .[] | "\(.destination): \(.last_update) - \(.actual)"' 19 | -------------------------------------------------------------------------------- /Web/openui5ver.1h.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # <xbar.title>OpenUI5 Latest Version Display</xbar.title> 3 | # <xbar.author>DJ Adams</xbar.author> 4 | # <xbar.author.github>qmacro</xbar.author.github> 5 | # <xbar.image>https://i.imgur.com/5GVxySB.png</xbar.image> 6 | # <xbar.version>1.0</xbar.version> 7 | 8 | # OpenUI5 Latest Version Display 9 | # BitBar plugin 10 | # 11 | # by DJ Adams 12 | 13 | URI="https://openui5.hana.ondemand.com/resources/sap-ui-version.json" 14 | 15 | VER=$(curl -s --compressed $URI | grep '"version"' | head -1 | sed -E 's/^.+([0-9]+\.[0-9]+\.[0-9]+).+$/\1/') 16 | 17 | echo "$VER" 18 | -------------------------------------------------------------------------------- /Web/weibo.1h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Metadata allows your plugin to show up in the app, and website. 4 | # 5 | # <xbar.title>Hot Search of Weibo</xbar.title> 6 | # <xbar.version>v1.0</xbar.version> 7 | # <xbar.author>Garden Yuen</xbar.author> 8 | # <xbar.author.github>weaming</xbar.author.github> 9 | # <xbar.desc>Show the hot search list on China Weibo.(微博热搜)</xbar.desc> 10 | # <xbar.image>https://user-images.githubusercontent.com/10275711/215465324-0fc864fa-a8c7-4e9c-bc9e-00efd7ba1ab6.png</xbar.image> 11 | # <xbar.dependencies>python</xbar.dependencies> 12 | # <xbar.abouturl>https://github.com/weaming</xbar.abouturl> 13 | 14 | from urllib.parse import quote 15 | import json 16 | import urllib.request 17 | 18 | print("热搜") 19 | print("---") 20 | r = urllib.request.urlopen("https://weibo.com/ajax/side/hotSearch") 21 | s = json.loads(r.read()) 22 | for x in s['data']['realtime']: 23 | xx = x['word'] 24 | print(f"{xx} | href=https://s.weibo.com/weibo?q={quote(xx)}") 25 | -------------------------------------------------------------------------------- /Web/whirlpool-watched.1m.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # <xbar.title>Whirlpool watched threads checker</xbar.title> 4 | # <xbar.version>v1.0</xbar.version> 5 | # <xbar.author>Tristan Harmer</xbar.author> 6 | # <xbar.author.github>gondalez</xbar.author.github> 7 | # <xbar.desc>List unread threads from your watch list</xbar.desc> 8 | # <xbar.dependencies>ruby</xbar.dependencies> 9 | 10 | require 'json' 11 | require 'time' 12 | require 'net/https' 13 | 14 | API_KEY = 'YOUR_KEY_HERE' # see https://whirlpool.net.au/profile/?action=account 15 | 16 | uri = URI.parse("https://whirlpool.net.au/api/?key=#{API_KEY}&get=watched&watchedmode=0&output=json") 17 | 18 | res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http| 19 | req = Net::HTTP::Get.new(uri) 20 | http.request(req) 21 | end 22 | 23 | puts 'http error' and exit unless res.is_a? Net::HTTPSuccess 24 | 25 | watched = JSON.parse(res.body)['WATCHED'] 26 | 27 | puts ":cyclone: #{watched.length}|color=##{watched.length > 0 ? '000000' : 'cccccc'}" 28 | 29 | puts '---' 30 | watched.each do |thread| 31 | last_post_time = Time.parse(thread['LAST_DATE']).getlocal 32 | last_post_time_minutes = ((Time.now - last_post_time) / 60).round 33 | href = "https://forums.whirlpool.net.au/forum-replies.cfm?t=#{thread['ID']}&p=#{thread['LASTPAGE']}&#r#{thread['LASTREAD']}" 34 | puts "#{thread['TITLE']} -- #{last_post_time_minutes} mins ago | href=#{href}" 35 | end 36 | -------------------------------------------------------------------------------- /Web/wikipedia_on_this_day.12h.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # <xbar.title>Wikipedia On This Day</xbar.title> 3 | # <xbar.version>0.1.0</xbar.version> 4 | # <xbar.author>Ryan Scott Lewis</xbar.author> 5 | # <xbar.author.github>RyanScottLewis</xbar.author.github> 6 | # <xbar.desc>Display Wikipedia On This Day information.</xbar.desc> 7 | # <xbar.dependencies>ruby (wikipedia, wikicloth, nokogiri rubygems)</xbar.dependencies> 8 | 9 | require "wikipedia" # gem install wikipedia-client 10 | require "wikicloth" # gem install wikicloth 11 | require "nokogiri" # gem install nokogiri 12 | 13 | def convert_wiki_to_html(data) 14 | WikiCloth::Parser.new(data: data).to_html 15 | end 16 | 17 | day_str = Time.now.strftime("%B %e") 18 | page = Wikipedia.find(day_str, prop: "revisions", rvprop: "content") 19 | 20 | within_events_section = false 21 | lines = page.content.lines.each_with_object([]) do |line, memo| 22 | 23 | html = convert_wiki_to_html(line) 24 | html_document = Nokogiri::HTML(html) 25 | 26 | headline_node = html_document.xpath("//h2/span[@class='mw-headline']").first 27 | 28 | if !headline_node.nil? 29 | within_events_section = headline_node.text == "Events" 30 | else 31 | next unless within_events_section 32 | 33 | list_item_node = html_document.xpath("//ul/li") 34 | 35 | memo << list_item_node.text 36 | end 37 | end 38 | 39 | puts "ⓦ" 40 | puts "---" 41 | lines.each { |line| puts(line) } 42 | 43 | # TODO: 44 | # * Links! 45 | # * Sort by date 46 | # * Date format 47 | # * Strip references: "[1]", etc 48 | --------------------------------------------------------------------------------