├── .github ├── CODEOWNERS └── workflows │ └── release.yml ├── .gitignore ├── LICENSE ├── README.md ├── example.json ├── feather_icons ├── activity.svg ├── airplay.svg ├── alert-circle.svg ├── alert-octagon.svg ├── alert-triangle.svg ├── align-center.svg ├── align-justify.svg ├── align-left.svg ├── align-right.svg ├── anchor.svg ├── aperture.svg ├── archive.svg ├── arrow-down-circle.svg ├── arrow-down-left.svg ├── arrow-down-right.svg ├── arrow-down.svg ├── arrow-left-circle.svg ├── arrow-left.svg ├── arrow-right-circle.svg ├── arrow-right.svg ├── arrow-up-circle.svg ├── arrow-up-left.svg ├── arrow-up-right.svg ├── arrow-up.svg ├── at-sign.svg ├── award.svg ├── bar-chart-2.svg ├── bar-chart.svg ├── battery-charging.svg ├── battery.svg ├── bell-off.svg ├── bell.svg ├── bluetooth.svg ├── bold.svg ├── book-open.svg ├── book.svg ├── bookmark.svg ├── box.svg ├── briefcase.svg ├── calendar.svg ├── camera-off.svg ├── camera.svg ├── cast.svg ├── check-circle.svg ├── check-square.svg ├── check.svg ├── chevron-down.svg ├── chevron-left.svg ├── chevron-right.svg ├── chevron-up.svg ├── chevrons-down.svg ├── chevrons-left.svg ├── chevrons-right.svg ├── chevrons-up.svg ├── chrome.svg ├── circle.svg ├── clipboard.svg ├── clock.svg ├── cloud-drizzle.svg ├── cloud-lightning.svg ├── cloud-off.svg ├── cloud-rain.svg ├── cloud-snow.svg ├── cloud.svg ├── code.svg ├── codepen.svg ├── codesandbox.svg ├── coffee.svg ├── columns.svg ├── command.svg ├── compass.svg ├── copy.svg ├── corner-down-left.svg ├── corner-down-right.svg ├── corner-left-down.svg ├── corner-left-up.svg ├── corner-right-down.svg ├── corner-right-up.svg ├── corner-up-left.svg ├── corner-up-right.svg ├── cpu.svg ├── credit-card.svg ├── crop.svg ├── crosshair.svg ├── database.svg ├── delete.svg ├── disc.svg ├── dollar-sign.svg ├── download-cloud.svg ├── download.svg ├── droplet.svg ├── edit-2.svg ├── edit-3.svg ├── edit.svg ├── external-link.svg ├── eye-off.svg ├── eye.svg ├── facebook.svg ├── fast-forward.svg ├── feather.svg ├── figma.svg ├── file-minus.svg ├── file-plus.svg ├── file-text.svg ├── file.svg ├── film.svg ├── filter.svg ├── flag.svg ├── folder-minus.svg ├── folder-plus.svg ├── folder.svg ├── framer.svg ├── frown.svg ├── gift.svg ├── git-branch.svg ├── git-commit.svg ├── git-merge.svg ├── git-pull-request.svg ├── github.svg ├── gitlab.svg ├── globe.svg ├── grid.svg ├── hard-drive.svg ├── hash.svg ├── headphones.svg ├── heart.svg ├── help-circle.svg ├── hexagon.svg ├── home.svg ├── image.svg ├── inbox.svg ├── info.svg ├── instagram.svg ├── italic.svg ├── key.svg ├── layers.svg ├── layout.svg ├── life-buoy.svg ├── link-2.svg ├── link.svg ├── linkedin.svg ├── list.svg ├── loader.svg ├── lock.svg ├── log-in.svg ├── log-out.svg ├── mail.svg ├── map-pin.svg ├── map.svg ├── maximize-2.svg ├── maximize.svg ├── meh.svg ├── menu.svg ├── message-circle.svg ├── message-square.svg ├── mic-off.svg ├── mic.svg ├── minimize-2.svg ├── minimize.svg ├── minus-circle.svg ├── minus-square.svg ├── minus.svg ├── monitor.svg ├── moon.svg ├── more-horizontal.svg ├── more-vertical.svg ├── mouse-pointer.svg ├── move.svg ├── music.svg ├── navigation-2.svg ├── navigation.svg ├── octagon.svg ├── package.svg ├── paperclip.svg ├── pause-circle.svg ├── pause.svg ├── pen-tool.svg ├── percent.svg ├── phone-call.svg ├── phone-forwarded.svg ├── phone-incoming.svg ├── phone-missed.svg ├── phone-off.svg ├── phone-outgoing.svg ├── phone.svg ├── pie-chart.svg ├── play-circle.svg ├── play.svg ├── plus-circle.svg ├── plus-square.svg ├── plus.svg ├── pocket.svg ├── power.svg ├── printer.svg ├── radio.svg ├── refresh-ccw.svg ├── refresh-cw.svg ├── repeat.svg ├── rewind.svg ├── rotate-ccw.svg ├── rotate-cw.svg ├── rss.svg ├── save.svg ├── scissors.svg ├── search.svg ├── send.svg ├── server.svg ├── settings.svg ├── share-2.svg ├── share.svg ├── shield-off.svg ├── shield.svg ├── shopping-bag.svg ├── shopping-cart.svg ├── shuffle.svg ├── sidebar.svg ├── skip-back.svg ├── skip-forward.svg ├── slack.svg ├── slash.svg ├── sliders.svg ├── smartphone.svg ├── smile.svg ├── speaker.svg ├── square.svg ├── star.svg ├── stop-circle.svg ├── sun.svg ├── sunrise.svg ├── sunset.svg ├── tablet.svg ├── tag.svg ├── target.svg ├── terminal.svg ├── thermometer.svg ├── thumbs-down.svg ├── thumbs-up.svg ├── toggle-left.svg ├── toggle-right.svg ├── tool.svg ├── trash-2.svg ├── trash.svg ├── trello.svg ├── trending-down.svg ├── trending-up.svg ├── triangle.svg ├── truck.svg ├── tv.svg ├── twitch.svg ├── twitter.svg ├── type.svg ├── umbrella.svg ├── underline.svg ├── unlock.svg ├── upload-cloud.svg ├── upload.svg ├── user-check.svg ├── user-minus.svg ├── user-plus.svg ├── user-x.svg ├── user.svg ├── users.svg ├── video-off.svg ├── video.svg ├── voicemail.svg ├── volume-1.svg ├── volume-2.svg ├── volume-x.svg ├── volume.svg ├── watch.svg ├── wifi-off.svg ├── wifi.svg ├── wind.svg ├── x-circle.svg ├── x-octagon.svg ├── x-square.svg ├── x.svg ├── youtube.svg ├── zap-off.svg ├── zap.svg ├── zoom-in.svg └── zoom-out.svg ├── init.lua ├── noobie.schema.json ├── row_builder.lua ├── screenshots ├── screenshot-errors.png ├── screenshot.png ├── screenshot2.png └── screenshot3.png └── test.sh /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | streetturtle 2 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | # Sequence of patterns matched against refs/tags 4 | tags: 5 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 6 | 7 | name: Upload Release Asset 8 | 9 | jobs: 10 | build: 11 | name: Upload Release Asset 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | - name: Build project # This would actually build your project, using zip for an example artifact 17 | run: | 18 | zip -r ${{ github.event.repository.name }}.zip . -x ".git/*" ".github/* ${{ github.event.repository.name }}.zip" 19 | - name: Create Release 20 | id: create_release 21 | uses: actions/create-release@v1 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | with: 25 | tag_name: ${{ github.ref }} 26 | release_name: Release ${{ github.ref }} 27 | draft: false 28 | prerelease: false 29 | - name: Upload Release Asset 30 | id: upload-release-asset 31 | uses: actions/upload-release-asset@v1 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | with: 35 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 36 | asset_path: ./${{ github.event.repository.name }}.zip 37 | asset_name: ${{ github.event.repository.name }}.zip 38 | asset_content_type: application/zip -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 streetturtle 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # noobie 2 | 3 | This is a widget-maker tool - it creates a widget based on a JSON definition returned by a script. 4 | For example, if your script returns following JSON: 5 | 6 | ```json 7 | { 8 | "widget": { 9 | "icon": "smile", 10 | "text": "noobie", 11 | "mouse_actions": { 12 | "on_right_click": "echo 'right click'" 13 | } 14 | } 15 | } 16 | ``` 17 | 18 | noobie will convert it to the widget: 19 | 20 | ![screenshot](./screenshots/screenshot.png). 21 | 22 | More complex example (from a [people-in-space](https://github.com/streetturtle/noobie-plugins/tree/master/people-in-space) plugin) with a menu, each menu item has an icon, title and subtitle: 23 | 24 | ![screenshot](./screenshots/screenshot3.png). 25 | 26 | For more examples check out plugins repository: [noobie-plugins](https://github.com/streetturtle/noobie-plugins) 27 | 28 | ## Features: 29 | 30 | - dropdown menu: 31 | 32 | ![menu](./screenshots/screenshot2.png) 33 | 34 | - mouse actions (scroll up/down, right click); 35 | - icon could be either a local file, a [feathericons](https://feathericons.com/) icon or an image from URL; 36 | - a notification with details in case your script failed: 37 | 38 | ![error notification](./screenshots/screenshot-errors.png) 39 | 40 | ## Plugins 41 | 42 | Check out existing plugins in this repo: https://github.com/streetturtle/noobie-plugins. 43 | 44 | ## Creating a plugin 45 | 46 | Please consult a **noobie.schema.json** for details. Below are few important excerpts: 47 | 48 | - `icon` of the widget or menu item can be one of 49 | - a name of feathericons icon, you can get it here: [feathericons.com](https://feathericons.com/); 50 | - an absolute path to the image file; 51 | - URL to the image file. If you are not sure image exists, you can add a `icon_fallback` field with an absolute path to the fallback image; 52 | - for a horizontal line in the menu add an item with title equals to '-', like 53 | ```json 54 | { "title": "-" } 55 | ``` 56 | - for a header menu item set `header` field to true, note that the `icon` field will be ignored: 57 | ```json 58 | { 59 | "header": "true", 60 | "title": "Header Title" 61 | } 62 | ``` 63 | 64 | ## Installation 65 | 66 | 1. Clone the repo under ~/.config/awesome/ folder 67 | 1. At the top of rc.lua add an import: 68 | 69 | ```lua 70 | local noobie_exmaple_1 = require("noobie") 71 | local noobie_exmaple_2 = require("noobie") 72 | ``` 73 | 1. Add a widget to wibox and provide a path to your script: 74 | 75 | ```lua 76 | noobie_exmaple_1{ path = os.getenv("HOME") .. '/.config/awesome/noobie/test.sh' }, 77 | noobie_exmaple_2{ path = os.getenv("HOME") .. '/.config/awesome/noobie/othertest.py' }, 78 | ``` 79 | If your widget is static you can define it in a JSON file and use like this: 80 | 81 | ```lua 82 | noobie_exmaple_1{ path = 'cat ' .. os.getenv("HOME") .. '/.config/awesome/noobie/test.json' }, 83 | ``` 84 | 85 | # Troubleshooting 86 | 87 | In case of any problem / issue / question: 88 | - create an [issue](https://github.com/streetturtle/noobie/issues/new/choose) 89 | - raise a question on [Discussions](https://github.com/streetturtle/noobie/discussions)! 90 | - ping me on AwesomeWM's discord, here's an [invite](https://discord.gg/XYvn8R5) 91 | -------------------------------------------------------------------------------- /example.json: -------------------------------------------------------------------------------- 1 | { 2 | "widget": { 3 | "icon": "smile", 4 | "text": "noobie", 5 | "mouse_actions": { 6 | "on_scroll_up": "echo 'scroll up'", 7 | "on_scroll_down": "echo 'scroll down'", 8 | "on_right_click": "echo 'right click'" 9 | } 10 | }, 11 | "menu": { 12 | "items": [ 13 | { 14 | "icon": "https://avatars.githubusercontent.com/u/9363150?v=4", 15 | "icon_size": 40, 16 | "title": "Say hi!", 17 | "onclick": "notify-send 'hi!'" 18 | }, 19 | { 20 | "icon": "terminal", 21 | "title": "Execute some script", 22 | "onclick": "/tmp/somescript.sh" 23 | }, 24 | { 25 | "type": "header", 26 | "title": "Header" 27 | }, 28 | { 29 | "icon": "slack", 30 | "title": "OpenSlack", 31 | "onclick": "xdg-open https://slack.com" 32 | }, 33 | { 34 | "type" : "separator" 35 | }, 36 | { 37 | "title": "Menu item with no icon and no action" 38 | } 39 | ] 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /feather_icons/activity.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/airplay.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/alert-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/alert-octagon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/alert-triangle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/align-center.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/align-justify.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/align-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/align-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/anchor.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/aperture.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/archive.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-down-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-down-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-down-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-left-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-right-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-up-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-up-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-up-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/arrow-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/at-sign.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/award.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bar-chart-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bar-chart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/battery-charging.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/battery.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bell-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bell.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bluetooth.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bold.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/book-open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/book.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/bookmark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/box.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/briefcase.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/calendar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/camera-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/camera.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cast.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/check-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/check-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/check.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevron-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevron-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevron-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevron-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevrons-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevrons-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevrons-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chevrons-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/chrome.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/clipboard.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/clock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud-drizzle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud-lightning.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud-rain.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud-snow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cloud.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/code.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/codepen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/codesandbox.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/coffee.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/columns.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/command.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/compass.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/copy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-down-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-down-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-left-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-left-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-right-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-right-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-up-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/corner-up-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/cpu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/credit-card.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/crop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/crosshair.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/database.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/delete.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/disc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/dollar-sign.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/download-cloud.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/droplet.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/edit-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/edit-3.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/external-link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/eye-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/eye.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/fast-forward.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/feather.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/figma.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/file-minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/file-plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/file-text.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/film.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/filter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/flag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/folder-minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/folder-plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/framer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/frown.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/gift.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/git-branch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/git-commit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/git-merge.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/git-pull-request.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/gitlab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/globe.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/grid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/hard-drive.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/hash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/headphones.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/heart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/help-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/hexagon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/image.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/inbox.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/info.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/instagram.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/italic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/key.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/layers.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/layout.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/life-buoy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/link-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/linkedin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/list.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/loader.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/lock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/log-in.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/log-out.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/mail.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/map-pin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/map.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/maximize-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/maximize.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/meh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/message-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/message-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/mic-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/mic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/minimize-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/minimize.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/minus-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/minus-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/monitor.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/moon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/more-horizontal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/more-vertical.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/mouse-pointer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/move.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/music.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/navigation-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/navigation.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/octagon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/package.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/paperclip.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/pause-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/pause.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/pen-tool.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/percent.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-call.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-forwarded.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-incoming.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-missed.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone-outgoing.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/phone.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/pie-chart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/play-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/play.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/plus-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/plus-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/pocket.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/power.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/printer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/radio.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/refresh-ccw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/refresh-cw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/repeat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/rewind.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/rotate-ccw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/rotate-cw.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/rss.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/save.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/scissors.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/send.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/server.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/settings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/share-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/share.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/shield-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/shield.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/shopping-bag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/shopping-cart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/shuffle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/sidebar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/skip-back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/skip-forward.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/slack.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/slash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/sliders.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/smartphone.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/smile.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/speaker.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/stop-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/sun.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/sunrise.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/sunset.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/tablet.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/tag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/target.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/terminal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/thermometer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/thumbs-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/thumbs-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/toggle-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/toggle-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/tool.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/trash-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/trash.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/trello.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/trending-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/trending-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/triangle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/truck.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/tv.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/twitch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/type.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/umbrella.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/underline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/unlock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/upload-cloud.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/upload.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/user-check.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/user-minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/user-plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/user-x.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/user.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/users.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/video-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/video.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/voicemail.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/volume-1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/volume-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/volume-x.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/volume.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/watch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/wifi-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/wifi.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/wind.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/x-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/x-octagon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/x-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/x.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/youtube.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/zap-off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/zap.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/zoom-in.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /feather_icons/zoom-out.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local watch = require("awful.widget.watch") 3 | local wibox = require("wibox") 4 | local beautiful = require("beautiful") 5 | local gears = require("gears") 6 | local json = require("json") 7 | local gfs = require("gears.filesystem") 8 | local spawn = require("awful.spawn") 9 | local naughty = require("naughty") 10 | local row_builder = require("noobie.row_builder") 11 | 12 | 13 | local HOME_DIR = os.getenv("HOME") 14 | local WIDGET_DIR = HOME_DIR .. '/.config/awesome/noobie' 15 | local ICONS_DIR = WIDGET_DIR .. '/feather_icons/' 16 | local CACHE_DIR = os.getenv("HOME") .. '/.cache/noobie/icons' 17 | 18 | 19 | local cur_stdout 20 | local noobie_widget = {} 21 | 22 | local function show_warning(message) 23 | naughty.notify{ 24 | preset = naughty.config.presets.critical, 25 | title = 'Noobie', 26 | text = message} 27 | end 28 | 29 | 30 | local function worker(user_args) 31 | local args = user_args or {} 32 | local refresh_rate = args.refresh_rate or 600 33 | local path = args.path 34 | local background = args.background or '#00000000' 35 | 36 | if path == nil then 37 | show_warning("Cannot create a widget, required parameter 'path' is not provided") 38 | return 39 | end 40 | 41 | if not gfs.dir_readable(CACHE_DIR) then 42 | gfs.make_directories(CACHE_DIR) 43 | end 44 | 45 | local noobie_popup = awful.popup{ 46 | ontop = true, 47 | visible = false, 48 | shape = function(cr, width, height) 49 | gears.shape.rounded_rect(cr, width, height, 4) 50 | end, 51 | border_width = 1, 52 | border_color = beautiful.bg_focus, 53 | width = 200, 54 | minimum_width = 100, 55 | maximum_width = 400, 56 | offset = { y = 5 }, 57 | widget = {} 58 | } 59 | local has_menu = false 60 | local has_mouse_actions = false 61 | local menu_buttons = {} 62 | local mouse_actions_buttons = {} 63 | 64 | noobie_widget = wibox.widget { 65 | { 66 | { 67 | { 68 | { 69 | id = 'icn', 70 | --forced_height = 20, 71 | --forced_width = 20, 72 | resize = true, 73 | widget = wibox.widget.imagebox 74 | }, 75 | valign = 'center', 76 | layout = wibox.container.place 77 | }, 78 | { 79 | id = 'txt', 80 | widget = wibox.widget.textbox 81 | }, 82 | id = 'spc', 83 | spacing = 4, 84 | layout = wibox.layout.fixed.horizontal 85 | }, 86 | margins = 4, 87 | widget = wibox.container.margin 88 | }, 89 | shape = function(cr, width, height) 90 | gears.shape.rounded_rect(cr, width, height, 4) 91 | end, 92 | bg = background, 93 | widget = wibox.container.background, 94 | set_text = function(self, new_text) 95 | if new_text == nil or new_text == '' then 96 | self:get_children_by_id('txt')[1]:set_text('') 97 | self:get_children_by_id('spc')[1]:set_spacing(0) 98 | else 99 | self:get_children_by_id('txt')[1]:set_text(new_text) 100 | end 101 | end, 102 | set_icon = function(self, new_icon) 103 | -- new_icon is a path to a file 104 | if new_icon:sub(1, 1) == '/' then 105 | self:get_children_by_id('icn')[1]:set_image(new_icon) 106 | 107 | -- new_icon is a relative path to the file 108 | elseif new_icon:sub(1, 1) == '~' then 109 | self:get_children_by_id('icn')[1]:set_image(HOME_DIR .. '/' .. new_icon:sub(3)) 110 | 111 | -- new_icon is a url to the icon 112 | elseif new_icon:sub(1, 4) == 'http' then 113 | local icon_path = CACHE_DIR .. '/' .. new_icon:sub(-16) 114 | if not gfs.file_readable(icon_path) then 115 | local download_cmd = string.format([[sh -c "curl -n --create-dirs -o %s %s"]], icon_path, new_icon) 116 | spawn.easy_async(download_cmd, 117 | function() self:get_children_by_id('icn')[1]:set_image(icon_path) end) 118 | else 119 | self:get_children_by_id('icn')[1]:set_image(icon_path) 120 | end 121 | 122 | -- new_icon is a feather icon 123 | else 124 | self:get_children_by_id('icn')[1]:set_image(ICONS_DIR .. new_icon .. '.svg') 125 | end 126 | end 127 | } 128 | 129 | local update_widget = function(widget, stdout, stderr) 130 | if stderr ~= '' then 131 | show_warning(stderr) 132 | return 133 | end 134 | 135 | --- do nothing if the output hasn't changed 136 | if (cur_stdout == stdout) then return 137 | else cur_stdout = stdout 138 | end 139 | 140 | local result = json.decode(stdout) 141 | widget:set_text(result.widget.text) 142 | widget:set_icon(result.widget.icon) 143 | 144 | has_menu = result.menu ~= nil and result.menu.items ~= nil and #result.menu.items > 0 145 | 146 | if has_menu then 147 | local rows = { layout = wibox.layout.fixed.vertical } 148 | 149 | for i = 0, #rows do rows[i]=nil end 150 | for _, item in ipairs(result.menu.items) do 151 | 152 | local row = row_builder:build_row(item, widget, noobie_popup) 153 | 154 | table.insert(rows, row) 155 | end 156 | 157 | noobie_popup:setup(rows) 158 | 159 | menu_buttons = gears.table.join( 160 | awful.button({}, 1, function() 161 | if noobie_popup.visible then 162 | widget:set_bg(background) 163 | noobie_popup.visible = not noobie_popup.visible 164 | else 165 | widget:set_bg(beautiful.bg_focus) 166 | noobie_popup:move_next_to(mouse.current_widget_geometry) 167 | end 168 | end) 169 | ) 170 | end 171 | 172 | local actions = result.widget.mouse_actions 173 | has_mouse_actions = actions ~= nil 174 | 175 | if has_mouse_actions then 176 | 177 | mouse_actions_buttons = gears.table.join( 178 | awful.button({}, 1, function() if actions.on_left_click ~= nil then awful.spawn.with_shell(actions.on_left_click) end end), 179 | awful.button({}, 2, function() if actions.on_right_click ~= nil then awful.spawn.with_shell(actions.on_right_click) end end), 180 | awful.button({}, 4, function() if actions.on_scroll_up ~= nil then awful.spawn.with_shell(actions.on_scroll_up) end end), 181 | awful.button({}, 5, function() if actions.on_scroll_down ~= nil then awful.spawn.with_shell(actions.on_scroll_down) end end) 182 | ) 183 | end 184 | 185 | widget:buttons(gears.table.join(mouse_actions_buttons, menu_buttons)) 186 | end 187 | 188 | watch(string.format([[sh -c "%s"]], path), refresh_rate, update_widget, noobie_widget) 189 | 190 | return noobie_widget 191 | end 192 | 193 | return setmetatable(noobie_widget, { __call = function(_, ...) 194 | return worker(...) 195 | end }) 196 | -------------------------------------------------------------------------------- /noobie.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "widget": { 6 | "type": "object", 7 | "properties": { 8 | "icon": { 9 | "type": "string" 10 | }, 11 | "text": { 12 | "type": "string" 13 | }, 14 | "mouse_actions": { 15 | "type": "object", 16 | "properties": { 17 | "on_scroll_up": { 18 | "type": "string" 19 | }, 20 | "on_scroll_down": { 21 | "type": "string" 22 | }, 23 | "on_right_click": { 24 | "type": "string" 25 | } 26 | } 27 | } 28 | } 29 | }, 30 | "menu": { 31 | "type": "object", 32 | "properties": { 33 | "items": { 34 | "type": "array", 35 | "items": [ 36 | { 37 | "type": "object", 38 | "properties": { 39 | "icon": { 40 | "type": "string" 41 | }, 42 | "icon_height": { 43 | "type": "integer" 44 | }, 45 | "title": { 46 | "type": "string" 47 | }, 48 | "onclick": { 49 | "type": "string" 50 | } 51 | }, 52 | "required": [ 53 | "title", 54 | "onclick" 55 | ] 56 | } 57 | ] 58 | } 59 | }, 60 | "required": [ 61 | "items" 62 | ] 63 | } 64 | }, 65 | "required": [ 66 | "widget" 67 | ] 68 | } -------------------------------------------------------------------------------- /row_builder.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local beautiful = require("beautiful") 4 | local gears = require("gears") 5 | local gfs = require("gears.filesystem") 6 | local spawn = require("awful.spawn") 7 | 8 | local HOME_DIR = os.getenv("HOME") 9 | local WIDGET_DIR = HOME_DIR .. '/.config/awesome/noobie' 10 | local ICONS_DIR = WIDGET_DIR .. '/feather_icons/' 11 | local CACHE_DIR = os.getenv("HOME") .. '/.cache/noobie/icons' 12 | 13 | local row_builder = {} 14 | 15 | local function build_header_row(item) 16 | return wibox.widget { 17 | { 18 | { 19 | markup = "" .. item.title .. "", 20 | widget = wibox.widget.textbox, 21 | }, 22 | left = 8, 23 | layout = wibox.container.margin 24 | }, 25 | bg = beautiful.bg_normal, 26 | widget = wibox.container.background 27 | } 28 | end 29 | 30 | local function build_icon_and_text_row(item, widget, noobie_popup) 31 | local item_image = wibox.widget{ 32 | resize = true, 33 | forced_height = item.icon_size or 20, 34 | forced_width = item.icon_size or 20 , 35 | widget = wibox.widget.imagebox 36 | } 37 | 38 | -- new_icon is an absolute path to a file 39 | if item.icon:sub(1, 1) == '/' then 40 | item_image:set_image(item.icon) 41 | 42 | -- new_icon is a relative path to the file 43 | elseif item.icon:sub(1, 1) == '~' then 44 | print(HOME_DIR .. '/' .. item.icon:sub(3)) 45 | item_image:set_image(HOME_DIR .. '/' .. item.icon:sub(3)) 46 | 47 | -- new_icon is a url of the icon 48 | elseif item.icon:sub(1, 4) == 'http' then 49 | local icon_path = CACHE_DIR .. '/' .. item.icon:sub(-16) 50 | if gfs.file_readable(icon_path) then 51 | item_image:set_image(icon_path) 52 | else 53 | local download_cmd = string.format([[sh -c "curl -L -f --create-dirs -o %s %s"]], icon_path, item.icon) 54 | spawn.easy_async(download_cmd, function(stdout, stderr, reason, exit_code) 55 | if (exit_code == 0) then 56 | item_image:set_image(icon_path) 57 | else 58 | item_image:set_image(item.icon_fallback) 59 | end 60 | end) 61 | end 62 | 63 | -- new_icon is a feather icon 64 | else 65 | item_image:set_image(ICONS_DIR .. item.icon .. '.svg') 66 | end 67 | 68 | local right_part 69 | if item.subtitle ~=nil and #item.subtitle > 0 then 70 | right_part = wibox.widget { 71 | { 72 | markup = item.title, 73 | font = font, 74 | widget = wibox.widget.textbox 75 | }, 76 | { 77 | markup = item.subtitle, 78 | font = font, 79 | widget = wibox.widget.textbox 80 | }, 81 | spacing = 4, 82 | layout = wibox.layout.fixed.vertical 83 | } 84 | else 85 | right_part = wibox.widget { 86 | markup = item.title, 87 | font = font, 88 | widget = wibox.widget.textbox 89 | } 90 | end 91 | 92 | 93 | local row = wibox.widget { 94 | { 95 | { 96 | { 97 | item_image, 98 | valign = 'center', 99 | layout = wibox.container.place, 100 | }, 101 | right_part, 102 | spacing = 12, 103 | layout = wibox.layout.fixed.horizontal 104 | }, 105 | margins = 8, 106 | layout = wibox.container.margin 107 | }, 108 | bg = beautiful.bg_normal, 109 | widget = wibox.container.background 110 | } 111 | 112 | local old_cursor, old_wibox 113 | row:connect_signal("mouse::enter", function(c) 114 | c:set_bg(beautiful.bg_focus) 115 | local wb = mouse.current_wibox 116 | old_cursor, old_wibox = wb.cursor, wb 117 | wb.cursor = "hand1" 118 | end) 119 | row:connect_signal("mouse::leave", function(c) 120 | c:set_bg(beautiful.bg_normal) 121 | if old_wibox then 122 | old_wibox.cursor = old_cursor 123 | old_wibox = nil 124 | end 125 | end) 126 | 127 | row:buttons(gears.table.join(awful.button({}, 1, function() 128 | awful.spawn.with_shell(item.onclick) 129 | widget:set_bg(background) 130 | noobie_popup.visible = not noobie_popup.visible 131 | end))) 132 | 133 | return row 134 | end 135 | 136 | 137 | function row_builder:build_row(item, widget, noobie_popup) 138 | if item.type == 'header' then 139 | return build_header_row(item) 140 | elseif item.title ~= nil and #item.title > 0 and item.icon ~= nil and #item.icon > 0 then 141 | return build_icon_and_text_row(item, widget, noobie_popup) 142 | elseif item.type == 'separator' then 143 | return wibox.widget { 144 | { 145 | orientation = 'horizontal', 146 | forced_height = 1, 147 | span_ratio = 0.95, 148 | forced_width = 100, 149 | color = beautiful.bg_focus, 150 | widget = wibox.widget.separator 151 | }, 152 | strategy = 'exact', 153 | widget = wibox.container.background 154 | 155 | } 156 | elseif item.title ~= nil and #item.title > 0 and item.icon == nil then 157 | local row = wibox.widget { 158 | { 159 | { 160 | markup = item.title, 161 | font = font, 162 | widget = wibox.widget.textbox 163 | }, 164 | margins = 8, 165 | layout = wibox.container.margin 166 | }, 167 | bg = beautiful.bg_normal, 168 | widget = wibox.container.background 169 | } 170 | 171 | if item.onclick ~= nil then 172 | local old_cursor, old_wibox 173 | row:connect_signal("mouse::enter", function(c) 174 | c:set_bg(beautiful.bg_focus) 175 | local wb = mouse.current_wibox 176 | old_cursor, old_wibox = wb.cursor, wb 177 | wb.cursor = "hand1" 178 | end) 179 | row:connect_signal("mouse::leave", function(c) 180 | c:set_bg(beautiful.bg_normal) 181 | if old_wibox then 182 | old_wibox.cursor = old_cursor 183 | old_wibox = nil 184 | end 185 | end) 186 | 187 | row:buttons(gears.table.join(awful.button({}, 1, function() 188 | awful.spawn.with_shell(item.onclick) 189 | widget:set_bg(background) 190 | noobie_popup.visible = not noobie_popup.visible 191 | end))) 192 | end 193 | 194 | return row 195 | end 196 | end 197 | 198 | 199 | return row_builder -------------------------------------------------------------------------------- /screenshots/screenshot-errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/streetturtle/noobie/a401737791b09cf23c019bdcf7481c809c9bde79/screenshots/screenshot-errors.png -------------------------------------------------------------------------------- /screenshots/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/streetturtle/noobie/a401737791b09cf23c019bdcf7481c809c9bde79/screenshots/screenshot.png -------------------------------------------------------------------------------- /screenshots/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/streetturtle/noobie/a401737791b09cf23c019bdcf7481c809c9bde79/screenshots/screenshot2.png -------------------------------------------------------------------------------- /screenshots/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/streetturtle/noobie/a401737791b09cf23c019bdcf7481c809c9bde79/screenshots/screenshot3.png -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | cat '/home/pmakhov/.config/awesome/noobie/example.json' --------------------------------------------------------------------------------