Skip to content

Commit

Permalink
Merge pull request #120 from sakithb/rewrite
Browse files Browse the repository at this point in the history
[WIP] Rewriting the internals of how the extension works
  • Loading branch information
sakithb authored Jan 16, 2024
2 parents 6bbd146 + dacc4d2 commit 6263699
Show file tree
Hide file tree
Showing 73 changed files with 9,073 additions and 5,010 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

[*.{js,ts,css}]
indent_size = 4
117 changes: 117 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"root": true,
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/recommended", "plugin:import/typescript"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"env": {
"es2021": true
},
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"globals": {
"ARGV": "readonly",
"Debugger": "readonly",
"GIRepositoryGType": "readonly",
"globalThis": "readonly",
"imports": "readonly",
"Intl": "readonly",
"log": "readonly",
"logError": "readonly",
"pkg": "readonly",
"print": "readonly",
"printerr": "readonly",
"window": "readonly",
"TextEncoder": "readonly",
"TextDecoder": "readonly",
"console": "readonly",
"setTimeout": "readonly",
"setInterval": "readonly",
"clearTimeout": "readonly",
"clearInterval": "readonly"
},
"rules": {
"import/extensions": ["error", "ignorePackages"],
"import/no-unresolved": "off",
"max-len": [
"warn",
{
"code": 140,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"no-use-before-define": [
"error",
{
"functions": false,
"classes": true,
"variables": true,
"allowNamedExports": true
}
],
"no-restricted-globals": [
"error",
{
"name": "Debugger",
"message": "Internal use only"
},
{
"name": "GIRepositoryGType",
"message": "Internal use only"
},
{
"name": "log",
"message": "Use debugLog()"
},
{
"name": "logError",
"message": "Use errorLog()"
}
],
"no-restricted-properties": [
"error",
{
"object": "imports",
"property": "format",
"message": "Use template strings"
},
{
"object": "pkg",
"property": "initFormat",
"message": "Use template strings"
},
{
"object": "Lang",
"property": "copyProperties",
"message": "Use Object.assign()"
},
{
"object": "Lang",
"property": "bind",
"message": "Use arrow notation or Function.prototype.bind()"
},
{
"object": "Lang",
"property": "Class",
"message": "Use ES6 classes"
}
],
"no-restricted-syntax": [
"error",
{
"selector": "MethodDefinition[key.name=\"_init\"] CallExpression[arguments.length<=1][callee.object.type=\"Super\"][callee.property.name=\"_init\"]",
"message": "Use constructor() and super()"
}
],
"no-constant-condition": [
"warn",
{
"checkLoops": false
}
]
}
}
31 changes: 0 additions & 31 deletions .eslintrc.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint and format

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install packages
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Lint
run: ./mediacontrols.sh lint
format:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install packages
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Format
run: ./mediacontrols.sh format
15 changes: 0 additions & 15 deletions .github/workflows/linter.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
*.compiled
*.zip
.vscode
builds
dist
node_modules
dist
.vscode
14 changes: 4 additions & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"indent_size": 4,
"semi": true,
"singleQuote": false,
"indent_style": "space",
"useTabs": false,
"printWidth": 120,
"arrowParens": "always"
"printWidth": 120,
"bracketSameLine": true,
"quoteProps": "consistent",
"singleQuote": false
}

67 changes: 27 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
### This extension is being rewritten. [More information](https://github.com/sakithb/media-controls/issues/123)

## What does this extension do?

Show controls and information of the currently playing media in the panel.

## Features

- Customize how the extension looks
- Disable elements you don't want
- Invoke different actions in many ways through mouse actions
- Basic media controls (play/pause/next/prev)
- Other media controls (loop/shuffle)
- And more...

---

## Notes

- Supports GNOME 3.36 and 3.38 (unmaintained), 40, 41, 42, 43, 44 and 45.
- GNOME 44 and below will not receive updates after v29/v28;
- Customize the extension the way you want it
- Basic media controls (play/pause/next/previous/loop/shuffle/seek)
- Mouse actions lets you run different actions via left/middle/right/scroll.
- Popup with album art and a slider to control the playback
- Scrolling animations
- Blacklist players

---

## Reporting issues

- Please attach a screenshot when you report something about visuals
- Please include version of the extension, gnome version and linux distribution
- Please attach a screenshot when you report something about visuals
- Please include version of the extension, gnome version and linux distribution

---

## How to install

#### Install from extensions.gnome.org (Recommended)

[<img src="./images/get-ego.png" height="100">](https://extensions.gnome.org/extension/4470/media-controls/)
[<img src="assets/images/ego.png" height="100">](https://extensions.gnome.org/extension/4470/media-controls/)

#### Arch Linux (AUR)

`yay -S gnome-shell-extension-media-controls` _Stable release_

`yay -S gnome-shell-extension-media-controls-git` _Build of the main branch_

#### Other distributions
#### Manual installation

Install from source

- Download "extension.zip" file from the releases tab
- Open a terminal in the path of extension.zip
- Install and enable the extension by executing `gnome-extensions install extension.zip --force` in the terminal
- Download archive file from the releases tab
- Open a terminal in the directory containing the downloaded file
- Install and enable the extension by executing `gnome-extensions install extension.zip --force` in the terminal

---

Expand All @@ -57,32 +42,34 @@ Pull requests are welcome.

To update the translation files run `./debug.sh -t` in the extensions directory after your code changes are finished. This will update the files in po folder. Then poedit (https://poedit.net/download) can be used to translate the strings. poedit can also be used to create new localization files.

## Screenshots
<a href="https://github.com/sakithb/media-controls/graphs/contributors">
<img src="https://contrib.rocks/image?repo=sakithb/media-controls" />
</a>

#### Track information menu
Made with [contrib.rocks](https://contrib.rocks).

![Screenshot](/images/track_info_menu.png)
## Screenshots

#### Sources menu
#### Popup menu

![Screenshot](/images/sources_menu.png)
[<img src="assets/images/popup.png" width="400">]()

#### General settings

![Screenshot](/images/settings_page_1.png)
[<img src="assets/images/prefs_general.png" width="400">]()

#### Visibility settings
#### Panel settings

![Screenshot](/images/settings_page_2.png)
[<img src="assets/images/prefs_panel.png" width="400">]()

#### Appearance settings
#### Position settings

![Screenshot](/images/settings_page_3.png)
[<img src="assets/images/prefs_positions.png" width="400">]()

#### Shortcut settings

![Screenshot](/images/settings_page_4.png)
[<img src="assets/images/prefs_shortcuts.png" width="400">]()

#### Other settings

![Screenshot](/images/settings_page_5.png)
[<img src="assets/images/prefs_other.png" width="400">]()
Loading

0 comments on commit 6263699

Please sign in to comment.