diff --git a/.gitignore b/.gitignore index 2a9e322..4c83e55 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ package/contents/config/main.xml *.plasmoid /*.sh +/release \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 71b6d42..0d6cf7d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +# Changelog + +* v1.1.2 (2023-02-21) + * Corrected usage of `tput`. + * v1.1.1 (2022-01-05) * `meta.sh` now also creates targetd directory. diff --git a/README.md b/README.md index 6e68391..a00eadb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # KDE QML/Plasma Applet Developer Tools # -Helper tools and scripts I wrote to help me while working on KDE QML Plasmoids. +Helper tools and scripts I wrote to help me while working on KDE QML Plasmoids (widgets). # Tools # @@ -11,11 +11,11 @@ they will try to determine proper root directory of QML plasmoid if needed, base your current working directory (traversing up if needed). This means that your working directory **must** be one of plasmoid's directories. You currently cannot manually specify where plasmoid is manually, but that's mostly because I do not work that way -and it was not needed (adding support for that is trivial though). +and it was not needed by my workflow (adding support for that is trivial though). # Determinig plasmoid root directory # -When you invoke i.e. `test.sh` tool, it will try to determine root folder of the plasmoid. +When you invoke i.e. `test.sh` script, it will try to determine root folder of the plasmoid. This is done by looking for `metadata.desktop` file in current directory. If file is not present, the parent dir is checked and so on. @@ -23,30 +23,30 @@ present, the parent dir is checked and so on. Available tools: - * `test.sh`: runs your plasmoid in `plasmaviewer`. When invoked without arguments, - will try to use `CompactRepresentation` by enforcing smaller widget area, which - mimics docking plasmoid in the Panel. When invoked with any argument (literaly - any will work, i.e. `test.sh foo`), will run you plasmoid as it is installed as - desktop widget (so `FullRepresentation` should kick in). - * `meta.sh`: This is my work around for Plasma API not exposing metadata file content - in any other way. It parses project's `metadata.desktop` and creates `/contents/js/meta.js` - containing extracted information, that can be later imported and used in your JavaScript - code. Currently exposes metadata's `X-KDE-PluginInfo-Version` as `version`, - `Name` as `name`, `X-KDE-PluginInfo-Website` as `url`, `X-KDE-PluginInfo-Author` as `authorName`. - It also looks for additional, non-standard fields: `X-KDE-PluginInfo-Author-Url` (exported - as `authorUrl`), `X-KDE-PluginInfo-UpdateChecker-Url` (exported as `updateCheckerUrl`) and - `X-KDE-PluginInfo-FirstReleaseYear` exported as `firstReleaseYear`. - * `install.sh`: installs/upgrades your plasmoid in `~/.local/share/plasma/plasmoids/` - folderm then restarts plasmashell. Please note it will upgrade existing installation - without any confirmation. Note: it automatically updates `meta.js` file. - * `release.sh`: packs plasmoid sources and creates release file. Target file name is - going to be `PACKAGE-VERSION.plasmoid` and constructed using `metadata.desktop` information. - Note: it automatically updates `meta.js` file. +* `test.sh`: runs your plasmoid in `plasmaviewer`. When invoked without arguments, + will try to use `CompactRepresentation` by enforcing smaller widget area, which + mimics docking plasmoid in the Panel. When invoked with any argument (literaly + any will work, i.e. `test.sh foo`), will run you plasmoid as it is installed as + desktop widget (so `FullRepresentation` should kick in). +* `meta.sh`: This is my work around for Plasma API not exposing metadata file content + in any other way. It parses project's `metadata.desktop` and creates `/contents/js/meta.js` + containing extracted information, that can be later imported and used in your JavaScript + code. Currently exposes metadata's `X-KDE-PluginInfo-Version` as `version`, + `Name` as `name`, `X-KDE-PluginInfo-Website` as `url`, `X-KDE-PluginInfo-Author` as `authorName`. + It also looks for additional, non-standard fields: `X-KDE-PluginInfo-Author-Url` (exported + as `authorUrl`), `X-KDE-PluginInfo-UpdateChecker-Url` (exported as `updateCheckerUrl`) and + `X-KDE-PluginInfo-FirstReleaseYear` exported as `firstReleaseYear`. +* `install.sh`: installs/upgrades your plasmoid in `~/.local/share/plasma/plasmoids/` + folderm then restarts plasmashell. Please note it will upgrade existing installation + without any confirmation. Note: it automatically updates `meta.js` file. +* `release.sh`: packs plasmoid sources and creates release file. Target file name is + going to be `PACKAGE-VERSION.plasmoid` and constructed using `metadata.desktop` information. + Note: it automatically updates `meta.js` file. # Installation # -As mentioned, scripts are "location agnostic" and can be invoked from any directory. +As mentioned, scripts are "location agnostic" and can be invoked from any directory. You can add it to your `$PATH`. I personally use [Fish shell](https://fishshell.com/) and added following aliases to my `~/.config/fish/config.fish`: @@ -59,14 +59,13 @@ alias ometa "/bin/meta.sh" # Tips # - * If your plasmoid misbehave, you may want to run it using "desktop" mode (`test.sh foo`). - That will make any syntax error related messages nicely visible in plasmaviewer window. - * You can easily customize QT log entries (thrown by `console.xxx()` calls) and i.e. - add file name or line number to it by setting `QT_MESSAGE_PATTERN`. See `test.sh` souces - for details and additional links. +* If your plasmoid misbehave, you may want to run it using "desktop" mode (`test.sh foo`). + That will make any syntax error related messages nicely visible in plasmaviewer window. +* You can easily customize QT log entries (thrown by `console.xxx()` calls) and i.e. + add file name or line number to it by setting `QT_MESSAGE_PATTERN`. See `test.sh` souces + for details and additional links. ## License ## - * Written and copyrighted ©2020-2022 by Marcin Orlowski - * Plasmoid Tools is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) - +* Written and copyrighted ©2020-2023 by Marcin Orlowski +* Plasmoid Tools is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/bin/colors.sh b/bin/colors.sh index f0daf66..e1105f1 100644 --- a/bin/colors.sh +++ b/bin/colors.sh @@ -2,7 +2,7 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # @@ -22,7 +22,8 @@ function TPUT { # We need to have $TERM set otherwise tput would fail # When invoked by cron, we may or may not have it so... if [[ -n "${TERM:-}" && "${TERM}" != "dumb" ]]; then - tput "${1:-}" "${2:-}" "${3:-}" + echo tput "${1:-}" ${2:-} ${3:-} + tput "${1:-}" ${2:-} ${3:-} else echo -n "" fi diff --git a/bin/common.sh b/bin/common.sh index 16d8575..30de065 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -3,7 +3,7 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # diff --git a/bin/install.sh b/bin/install.sh index 400ecea..57c8212 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -3,11 +3,11 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # -# Packs plasmoid and installs/upgrades it locally, then restarts plasmashell. +# Packs plasmoid and installs/upgrades it locally (for your user), then restarts plasmashell. # set -euo pipefail diff --git a/bin/meta.sh b/bin/meta.sh index 87d35bb..0bf0a09 100755 --- a/bin/meta.sh +++ b/bin/meta.sh @@ -3,11 +3,11 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # -# Creates /contents/js/meta.js file +# Creates /contents/js/meta.js file with plasmoid metadata. # set -euo pipefail diff --git a/bin/release.sh b/bin/release.sh index 0ecb1db..d20a599 100755 --- a/bin/release.sh +++ b/bin/release.sh @@ -3,10 +3,12 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # +# Packs plasmoid files for the release. +# set -euo pipefail diff --git a/bin/test.sh b/bin/test.sh index 365c076..5017774 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -3,10 +3,12 @@ # KDE Plasma Applets Developer Tools # # @author Marcin Orlowski -# @copyright 2020-2022 Marcin Orlowski +# @copyright 2020-2023 Marcin Orlowski # @license http://www.opensource.org/licenses/mit-license.php MIT # @link https://github.com/MarcinOrlowski/plasmoid-tools # +# Runs instance of the plasmoid in plasmoidviewer. +# set -euo pipefail