Skip to content

Commit

Permalink
feat: small improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
brpaz committed Jun 15, 2022
1 parent 92f81be commit de2e58d
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 35 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Dependabot configuration
# see: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates#configuration-options-for-dependabotyml
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
assignees:
- "@brpaz"
labels:
- "dependencies"
open-pull-requests-limit: 3
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: CI

on: [push]
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
Expand All @@ -17,3 +27,19 @@ jobs:
pip install flake8
- name: Lint with flake8
run: make lint

release:
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- repo: local
hooks:
- id: yapf
name: yapf
entry: make format
language: system
types: [python]
- id: lint
name: flake8
entry: make lint
language: system
types: [python]
- id: format
name: format
entry: make format
language: system
types: [python]
- id: lint
name: flake8
entry: make lint
language: system
types: [python]
12 changes: 12 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/changelog",
"@semantic-release/git"
]
}
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

EXT_NAME:=ulauncher-brotab
EXT_NAME:=com.github.com.brpaz.ulauncher-brotab
EXT_DIR:=$(shell pwd)

.PHONY: help lint format link unlink deps dev setup
.DEFAULT_GOAL := help
.PHONY: help lint format link unlink deps dev
.DEFAULT_TARGET: help

setup: ## Setups the project
pre-commit install
help: ## Show help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

lint: ## Run Lint
@flake8 --ignore=E402,F401
lint: ## Run Pylint
@flake8

format: ## Format code using yapf
@yapf --in-place --recursive .
Expand All @@ -18,13 +18,10 @@ link: ## Symlink the project source directory with Ulauncher extensions dir.
@ln -s ${EXT_DIR} ~/.local/share/ulauncher/extensions/${EXT_NAME}

unlink: ## Unlink extension from Ulauncher
@rm -r ~/.local/share/ulauncher/extensions/${EXT_NAME}
@rm -rf ~/.local/share/ulauncher/extensions/${EXT_NAME}

deps: ## Install Python Dependencies
@pip3 install -r requirements.txt

dev: ## Runs ulauncher on development mode
ulauncher -v --dev --no-extensions |& grep "${EXT_NAME}"

help: ## Show help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
ulauncher --no-extensions --dev -v |& grep "ulauncher-brotab"
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Brotab Ulauncher Extension

> Control your browser tabs directly from Ulauncher with [Brotab](https://github.com/balta2ar/brotab).
[![Ulauncher Extension](https://img.shields.io/badge/Ulauncher-Extension-yellowgreen.svg?style=for-the-badge)](https://ext.ulauncher.io/)
[![CI Status](https://img.shields.io/github/workflow/status/brpaz/ulauncher-brotab/CI?color=orange&label=actions&logo=github&logoColor=orange&style=for-the-badge)](https://github.com/brpaz/ulauncher-brotab)
[![license](https://img.shields.io/github/license/brpaz/ulauncher-brotab.svg?style=for-the-badge)](LICENSE)

> Control your browser tabs directly from Ulauncher with [Brotab](https://github.com/balta2ar/brotab).


## Demo

Expand All @@ -22,12 +24,11 @@ You also need to have some Python packages installed on your system.
You can do so, by running the following command:

```sh
pip install --user memoization==0.3.1
pip install --user memoization==0.4.0
```

In some systems, you might need to run `pip3` instead of `pip`.


## Install

Open ulauncher preferences window -> extensions -> add extension and paste the following url:
Expand Down Expand Up @@ -60,7 +61,7 @@ The output will display something like this:
2020-11-15 10:24:16,869 | WARNING | ulauncher.api.server.ExtensionRunner: _run_process() | VERBOSE=1 ULAUNCHER_WS_API=ws://127.0.0.1:5054/ulauncher-brotab PYTHONPATH=/usr/lib/python3.8/site-packages /usr/bin/python3 /home/bruno/.local/share/ulauncher/extensions/ulauncher-brotab/main.py
```

Open another terminal window and execute the command displayed, "starting at VERBOSE=1". This will activate the extension.
Open another terminal window and execute the command displayed, "starting at VERBOSE=1". This will activate the extension.

To see your changes, CTRL+C the previous command and run it again to refresh.

Expand Down Expand Up @@ -108,3 +109,5 @@ Or if you prefer a one time donation to the project, you can simple:
Copyright © 2020 [Bruno Paz](https://github.com/brpaz).

This project is [MIT](https://opensource.org/licenses/MIT) licensed.

<a href="https://www.flaticon.com/free-icons/tab" title="tab icons">Tab icons created by Freepik - Flaticon</a>
2 changes: 1 addition & 1 deletion brotab_ulauncher/brotab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from brotab.inout import is_port_accepting_connections
from brotab.inout import get_mediator_ports
from brotab.inout import in_temp_dir
from brotab import in_temp_dir
from brotab.api import SingleMediatorAPI, MultipleMediatorsAPI

FORMAT = '%(asctime)-15s %(levelname)-10s %(message)s'
Expand Down
6 changes: 1 addition & 5 deletions brotab_ulauncher/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
Extension Class
"""

import gi

gi.require_version("Gtk", "3.0")

from gi.repository import Gtk
from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultItem import ExtensionResultItem
Expand All @@ -22,6 +17,7 @@

class BrotabExtension(Extension):
""" Main Extension Class """

def __init__(self):
""" Initializes the extension """
super(BrotabExtension, self).__init__()
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brotab=~1.4.2
memoization=~0.4.0

0 comments on commit de2e58d

Please sign in to comment.