diff --git a/.gitignore b/.gitignore index 19d7a23..3817f1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,18 @@ +# gitginore template for creating Snap packages +# website: https://snapcraft.io/ + +parts/ +prime/ +stage/ +*.snap + +# Snapcraft global state tracking data(automatically generated) +# https://forum.snapcraft.io/t/location-to-save-global-state/768 +/snap/.snapcraft/ + +# Source archive packed by `snapcraft cleanbuild` before pushing to the LXD container +/*_source.tar.bz2 + # Prerequisites *.d diff --git a/README.md b/README.md index d2e95f4..5ffa1b1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Donate](https://img.shields.io/badge/-Donate-yellow?logo=paypal)](https://paypal.me/aristocratos) [![Sponsor](https://img.shields.io/badge/-Sponsor-red?logo=github)](https://github.com/sponsors/aristocratos) [![Coffee](https://img.shields.io/badge/-Buy%20me%20a%20Coffee-grey?logo=Ko-fi)](https://ko-fi.com/aristocratos) - +[![btop](https://snapcraft.io/btop/badge.svg)](https://snapcraft.io/btop) ## Index @@ -23,6 +23,7 @@ * [Keybindings](#help-menu) * [Installation](#installation) * [Manual compilation](#compilation) +* [Install the snap](#install-the-snap) * [Configurability](#configurability) * [License](#license) @@ -279,6 +280,21 @@ Also needs a UTF8 locale and a font that covers: ```bash make help ``` + +## Install the snap +[![btop](https://snapcraft.io/btop/badge.svg)](https://snapcraft.io/btop) + + `sudo snap install btop` + + * **Connect the interfaces** + ``` + sudo snap connect btop:system-observe + sudo snap connect btop:physical-memory-observe + sudo snap connect btop:mount-observe + sudo snap connect btop:hardware-observe + sudo snap connect btop:network-observe + ``` + ## Configurability diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..5af4ced --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,78 @@ +name: btop +adopt-info: btop +summary: Resource monitor that shows usage and stats +description: | + Resource monitor that shows usage and stats for processor, memory, disks, network and processes. + C++ version and continuation of bashtop and bpytop. + +license: Apache-2.0 + +assumes: + - command-chain + +base: core20 +grade: stable +confinement: strict +compression: lzo + +architectures: + - build-on: amd64 + - build-on: arm64 + - build-on: armhf + - build-on: ppc64el + - build-on: s390x + +package-repositories: + - type: apt + ppa: ubuntu-toolchain-r/test + +apps: + btop: + command: usr/local/bin/btop + command-chain: + - bin/homeishome-launch + environment: + LC_ALL: C.UTF-8 + LANG: C.UTF-8 + plugs: + - mount-observe + - process-control + - system-observe + - hardware-observe + - network + - network-observe + - physical-memory-observe + - home + +parts: + btop: + source: https://github.com/aristocratos/btop + source-type: git + plugin: make + make-parameters: + - PREFIX=/usr/local + build-packages: + - coreutils + - sed + - git + - build-essential + - gcc-11 + - g++-11 + + stage-packages: + - coreutils + - sed + - git + - build-essential + - gcc-11 + - g++-11 + + override-pull: | + snapcraftctl pull + snapcraftctl set-version "$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)" + + homeishome-launch: + plugin: nil + stage-snaps: + - homeishome-launch +