From 1c4fbdcd14fd97027bae0c5a5ec613b1e06e0821 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 12:48:21 -0500 Subject: [PATCH 01/20] Create snapcraft.yaml --- snap/snapcraft.yaml | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 snap/snapcraft.yaml diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000..eb540e2 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,67 @@ +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 + +apps: + btop: + command: usr/bin/btop + command-chain: + - bin/homeishome-launch + plugs: + - mount-observe + - process-control + - system-observe + - hardware-observe + - network + - physical-memory-observe + - home + +parts: + btop: + source: https://github.com/aristocratos/btop + plugin: make + 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 + From 11a843530bb0b84ef2e95c6de088a71c119f1ab3 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 14:19:50 -0500 Subject: [PATCH 02/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index eb540e2..b436a2f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -39,6 +39,7 @@ apps: parts: btop: source: https://github.com/aristocratos/btop + source-type: git plugin: make build-packages: - coreutils From a8bd4cb7f0837631b494e407a44da722aa9f45d1 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 14:30:16 -0500 Subject: [PATCH 03/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b436a2f..aba5ca4 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -21,7 +21,11 @@ architectures: - build-on: armhf - build-on: ppc64el - build-on: s390x - + +package-repositories: + - type: apt + ppa: ubuntu-toolchain-r/test + apps: btop: command: usr/bin/btop @@ -41,6 +45,7 @@ parts: source: https://github.com/aristocratos/btop source-type: git plugin: make + build-packages: - coreutils - sed From 8bc4b15ba8f05a6dbccb05e2f2cef6e96ee5238b Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 14:39:17 -0500 Subject: [PATCH 04/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index aba5ca4..3deb149 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: usr/bin/btop + command: bin/btop command-chain: - bin/homeishome-launch plugs: From 231646d9c72799e335c98bd2c516baeb6a8b7ad6 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 14:51:56 -0500 Subject: [PATCH 05/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3deb149..dc3be41 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: bin/btop + command: btop command-chain: - bin/homeishome-launch plugs: From c83e807fafb9451ff1a4bcedf36cd94eb72ffcbb Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 15:03:11 -0500 Subject: [PATCH 06/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index dc3be41..0417b9d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: btop + command: usr/local/btop command-chain: - bin/homeishome-launch plugs: From b4eb23fec3160a8ce2cf78c999f4f911da55c7a5 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 15:22:19 -0500 Subject: [PATCH 07/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 0417b9d..5257b6c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: usr/local/btop + command: usr/local/bin/btop command-chain: - bin/homeishome-launch plugs: @@ -45,6 +45,11 @@ parts: source: https://github.com/aristocratos/btop source-type: git plugin: make + make-parameters: + - PREFIX=/usr/local/bin + build-environment: + - LC_ALL: C.UTF-8 + - LANG: C.UTF-8 build-packages: - coreutils From 0f81dc6bda6e46d17bd0b971324e5a3a76f7383e Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 15:28:43 -0500 Subject: [PATCH 08/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 5257b6c..1553555 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: usr/local/bin/btop + command: usr/local/btop command-chain: - bin/homeishome-launch plugs: @@ -46,7 +46,7 @@ parts: source-type: git plugin: make make-parameters: - - PREFIX=/usr/local/bin + - PREFIX=/usr/local build-environment: - LC_ALL: C.UTF-8 - LANG: C.UTF-8 From bfa0e16f18e16dd0613b4fc3d543b8eb92e321d8 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 17:44:29 -0500 Subject: [PATCH 09/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1553555..b033a8c 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,7 +28,7 @@ package-repositories: apps: btop: - command: usr/local/btop + command: usr/local/bin/btop command-chain: - bin/homeishome-launch plugs: From 60f6c89b2a4f0822fe801e0421a705d4ab1ae647 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sat, 18 Sep 2021 17:58:20 -0500 Subject: [PATCH 10/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b033a8c..261234f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -47,6 +47,7 @@ parts: plugin: make make-parameters: - PREFIX=/usr/local + - STATIC=true build-environment: - LC_ALL: C.UTF-8 - LANG: C.UTF-8 From f4afb040a36bba14bc1e73128aa72b92bfffbb1e Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Thu, 23 Sep 2021 14:52:58 -0500 Subject: [PATCH 11/20] trying override build Build is successful but fails to run: ``` terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid Aborted (core dumped) ``` --- snap/snapcraft.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 261234f..fa0deb0 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -44,14 +44,7 @@ parts: btop: source: https://github.com/aristocratos/btop source-type: git - plugin: make - make-parameters: - - PREFIX=/usr/local - - STATIC=true - build-environment: - - LC_ALL: C.UTF-8 - - LANG: C.UTF-8 - + plugin: nil build-packages: - coreutils - sed @@ -67,11 +60,18 @@ parts: - build-essential - gcc-11 - g++-11 - + override-pull: | snapcraftctl pull snapcraftctl set-version "$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)" + override-build: | + mkdir -p $SNAPCRAFT_PART_INSTALL/btop + cd $SNAPCRAFT_PART_INSTALL/btop + make install --prefix=/usr/local + make setuid + make clean + homeishome-launch: plugin: nil stage-snaps: From 18f7e13ba86b10ff57142e2b94bc79dffb1ea801 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Thu, 23 Sep 2021 14:59:18 -0500 Subject: [PATCH 12/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index fa0deb0..725bb07 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -68,7 +68,7 @@ parts: override-build: | mkdir -p $SNAPCRAFT_PART_INSTALL/btop cd $SNAPCRAFT_PART_INSTALL/btop - make install --prefix=/usr/local + make install make setuid make clean From 93c8d1ba6d620c99c04ae04324da9285dec4eb0c Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Thu, 23 Sep 2021 15:03:53 -0500 Subject: [PATCH 13/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 725bb07..c18c1c4 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -68,7 +68,7 @@ parts: override-build: | mkdir -p $SNAPCRAFT_PART_INSTALL/btop cd $SNAPCRAFT_PART_INSTALL/btop - make install + make install PREFIX=/usr/local make setuid make clean From abdc2f48787a55e126ea015d25f4baec1d2f4abd Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Thu, 23 Sep 2021 15:10:03 -0500 Subject: [PATCH 14/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c18c1c4..094f50e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -68,7 +68,7 @@ parts: override-build: | mkdir -p $SNAPCRAFT_PART_INSTALL/btop cd $SNAPCRAFT_PART_INSTALL/btop - make install PREFIX=/usr/local + make install PREFIX=$SNAPCRAFT_PART_INSTALL/usr/local make setuid make clean From 62e016f7db058e7fd348270fd92b4d70e4336c3d Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Thu, 23 Sep 2021 15:21:46 -0500 Subject: [PATCH 15/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 094f50e..2a9be52 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -44,7 +44,9 @@ parts: btop: source: https://github.com/aristocratos/btop source-type: git - plugin: nil + plugin: make + make-parameters: + - PREFIX=/usr/local build-packages: - coreutils - sed @@ -65,13 +67,6 @@ parts: snapcraftctl pull snapcraftctl set-version "$(git describe --tags | sed 's/^v//' | cut -d "-" -f1)" - override-build: | - mkdir -p $SNAPCRAFT_PART_INSTALL/btop - cd $SNAPCRAFT_PART_INSTALL/btop - make install PREFIX=$SNAPCRAFT_PART_INSTALL/usr/local - make setuid - make clean - homeishome-launch: plugin: nil stage-snaps: From 3114c6cd804851fca219a0eda6cbfb7b7792ea0e Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Fri, 24 Sep 2021 16:58:26 -0500 Subject: [PATCH 16/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 2a9be52..24c5b5f 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -30,7 +30,10 @@ apps: btop: command: usr/local/bin/btop command-chain: - - bin/homeishome-launch + - bin/homeishome-launch + environment: + LC_ALL: C.UTF-8 + LANG: C.UTF-8 plugs: - mount-observe - process-control From ca57a992204d6641051f6ee676899bd96e657928 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sun, 26 Sep 2021 12:46:27 -0500 Subject: [PATCH 17/20] Update README.md --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7443ab..5e87e4a 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) @@ -275,6 +276,20 @@ 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 + ``` + ## Configurability From 5d486f36d1995b7928d0d73e30ee27192aa0638e Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sun, 26 Sep 2021 12:51:36 -0500 Subject: [PATCH 18/20] Update .gitignore --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index bf37c5f..6772cda 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 From 91566597af3fcbef09b05f90f4c011dcb5da2995 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sun, 26 Sep 2021 12:54:58 -0500 Subject: [PATCH 19/20] Update snapcraft.yaml --- snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 24c5b5f..5af4ced 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -40,6 +40,7 @@ apps: - system-observe - hardware-observe - network + - network-observe - physical-memory-observe - home From 3349fe8da2c9420c4122e67191152d35351b0445 Mon Sep 17 00:00:00 2001 From: kz6fittycent Date: Sun, 26 Sep 2021 13:42:35 -0500 Subject: [PATCH 20/20] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5e87e4a..8403456 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,7 @@ Also needs a UTF8 locale and a font that covers: 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 ```