diff --git a/.gitignore b/.gitignore index f42fdfe..8a28ddc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -/build/ -/install/ +/mcg* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bacb769 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing + +There are multiple ways to contribute code to this project: + +* Submit a Pull Request on +[https://git.suruatoel.xyz/coderkun/mcg](git.suruatoel.xyz/coderkun/mcg) or +[https://codeberg.org/suruatoel/mcg](codeberg.org/suruatoel/mcg) +* Send a git pull request via eMail +* Send a patch via eMail + +## Internationalization + +Update `.pot` files: + + $ xgettext --language=Go --keyword=T --from-code=UTF-8 --package-name=mcg --output=po/mcg-go.pot $(git ls-files '*.go') + $ xgettext --language=Glade --from-code=UTF-8 --output=po/mcg-ui.pot $(git ls-files '*.ui') + $ msgcat --use-first -o po/mcg.pot po/mcg-go.pot po/mcg-ui.pot + +Use a tool like [Poedit](https://poedit.net/) to create or update translations +in the `locale/` folder. + +## AI Policy + +This project uses a _No AI policy_. Any code you submit to this project has to +be written by yourself. If you put this project’s code into any AI tool, you +will be banned from this project. diff --git a/CONTRIBUTING.textile b/CONTRIBUTING.textile deleted file mode 100644 index f5b11fb..0000000 --- a/CONTRIBUTING.textile +++ /dev/null @@ -1,22 +0,0 @@ -h1. Contributing - -There are several ways to participate in this project. This guide covers only the contribution of code (i. e. any change to any file in the repository). - -There are basically two ways to contribute code to this project: Either via GitLab or via e‑mail. The first one is probably easier for most people. However -it requires a account at GitLab.com. For people who don’t want to create an account—or have any other reason to not use GitLab—e‑mail is an alternative option. - -h2. Contributing via GitLab - -Create an account on GitLab.com or use your already existing account. Fork this repository inside GitLab, add changes to your fork and finally create a Merge Request to contribute your changes back to this repository. - -h2. Contributing via E‑mail - -To contribute via e‑mail, first clone this repository to your local harddrive. After adding changes to your local copy you have two options to send them back to this repository: as patch or as Pull Request - -h3. E‑mail Patch - -To send a patch with your changes, use git’s @send-email@ option as explained in "Public Project over Email":https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_project_over_email of section "5.2 Distributed Git - Contributing to a Project":https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project of the "Git Pro Book":https://git-scm.com/book/en/v2/. You will find the e‑mail address at "suruatoel.xyz":https://www.suruatoel.xyz. - -h3. E‑mail Pull Request - -Sending a Pull Request via e‑mail requires to publish your copy of the repository (that includes your changes) at a publicly available URL (it is your responsibility to choose a trusted host). Then use git’s @request-pull@ command to send an e‑mail with your pull request. The e‑mail will contain a link to the public repository which can be used to pull your changes from. You will find the e‑mail address at "suruatoel.xyz":https://www.suruatoel.xyz. For more details, please take a look at "Forked Public Project":https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_public_project of section "5.2 Distributed Git - Contributing to a Project":https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project of the "Git Pro Book":https://git-scm.com/book/en/v2. \ No newline at end of file diff --git a/LICENSE b/LICENSE index bb13eb5..1f5cef4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ CoverGrid (mcg) is a client for the Music Player Daemon, focusing on albums instead of single tracks. -Copyright ® 2013 – 2017 coderkun +Copyright ® 2013 – 2026 Olli This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/README.md b/README.md index f37f2db..c65ad22 100644 --- a/README.md +++ b/README.md @@ -5,60 +5,51 @@ Daemon](http://www.musicpd.org) (MPD), focusing on albums instead of single tracks. It is not intended to be a replacement for your favorite MPD client but an addition to get a better album-experience. -Website: https://www.suruatoel.xyz/codes/mcg +Website: [https://www.suruatoel.xyz/codes/mcg](www.suruatoel.xyz/codes/mcg) License: [GPL](http://www.gnu.org/licenses/gpl.html) v3 Dependencies: -* [Python](http://www.python.org) 3 -* [python-dateutil](https://pypi.org/project/python-dateutil/) -* [GTK](http://www.gtk.org) 4 (>= 4.18) ([python-gobject](https://live.gnome.org/PyGObject)) +* [GTK](http://www.gtk.org) 4 (>= 4.18) * [libadwaita](https://gnome.pages.gitlab.gnome.org/libadwaita/) (>= 1.2) -* [Avahi](http://www.avahi.org) (optional) -* [python-keyring](http://pypi.python.org/pypi/keyring) (optional) -* [meson](https://mesonbuild.com/) and [ninja](https://ninja-build.org/) (building) +* [go](https://go.dev/) (build only) -Additionally a [MPD](http://www.musicpd.org) server (version >= 0.21.0) is +Additionally, an [MPD](http://www.musicpd.org) server (version >= 0.21.0) is required at runtime. ## Building -Build the application with _meson_ and _ninja_: +Build the application with _go_: - $ meson build - $ ninja -C build + $ go build . -## Running/Testing +## Running -For testing the application and running it without (system-wide) installation, -donwload/clone the code, build it with the `--prefix` option and install it -with `ninja`: +Run the application for testing purposes: - $ meson setup --prefix $(pwd)/install build - $ ninja -C build - $ ninja -C build install + $ go run . -After that you can run it with _meson’s_ `devenv` command: +Run the application: - $ meson devenv -C build src/mcg + $ ./mcg -## Installing +## Packaging -Install the application system-wide with _meson_ (after building): +The suggested package name for this project is “mcg”. To build a production +binary, please use the following command: - $ ninja -C build install + $ go build --ldflags="-s -w -X main.Version=$(git describe)" -trimpath ./... -Note: _On Linux using the distribution’s package manager is the preferred way -of installing applications system-wide._ +In the “data/” folder you will find a `.desktop` file and an SVG icon. ## Screenshots -![CoverGrid’s cover panel with album details and track list.](https://suruatoel.xyz/images/mcg-cover-s.png "CoverGrid’s cover panel with album details and track list.") +![CoverGrid’s cover panel with album details and track list.](https://www.suruatoel.xyz/images/mcg-cover-s.png "CoverGrid’s cover panel with album details and track list.") -![CoverGrid’s playlist panel with queued albums.](https://suruatoel.xyz/images/mcg-playlist.png "CoverGrid’s playlist panel with queued albums.") +![CoverGrid’s playlist panel with queued albums.](https://www.suruatoel.xyz/images/mcg-playlist.png "CoverGrid’s playlist panel with queued albums.") -![CoverGrid’s library panel showing the albums middle-sized.](https://suruatoel.xyz/images/mcg-library-m.png "CoverGrid’s library panel showing the albums middle-sized.") +![CoverGrid’s library panel showing the albums middle-sized.](https://www.suruatoel.xyz/images/mcg-library-m.png "CoverGrid’s library panel showing the albums middle-sized.") -![CoverGrid’s library panel showing the albums small-sized.](https://suruatoel.xyz/images/mcg-library-s.png "CoverGrid’s library panel showing the albums small-sized.") +![CoverGrid’s library panel showing the albums small-sized.](https://www.suruatoel.xyz/images/mcg-library-s.png "CoverGrid’s library panel showing the albums small-sized.") diff --git a/data/data.go b/data/data.go new file mode 100644 index 0000000..3383a7d --- /dev/null +++ b/data/data.go @@ -0,0 +1,43 @@ +package data + +import ( + _ "embed" + "encoding/base64" + "strings" +) + +//go:embed ui/window.ui +var WindowXML string + +//go:embed ui/shortcuts-dialog.ui +var ShortcutsDialogXML string + +//go:embed ui/connection-panel.ui +var ConnectionPanelXML string + +//go:embed ui/server-panel.ui +var ServerPanelXML string + +//go:embed ui/cover-panel.ui +var CoverPanelXML string + +//go:embed ui/playlist-panel.ui +var PlaylistPanelXML string + +//go:embed ui/album-headerbar.ui +var AlbumHeaderbarXML string + +//go:embed ui/library-panel.ui +var LibraryPanelXML string + +//go:embed gtk.css +var MainCSS string + +//go:embed noise-texture.png +var NoiseTexture []byte + +func BuildMainCSS() string { + noiseTextureEncoded := "data:image/png;base64," + base64.StdEncoding.EncodeToString(NoiseTexture) + + return strings.ReplaceAll(MainCSS, "@NOISETEXTURE@", noiseTextureEncoded) +} diff --git a/data/gtk.css b/data/gtk.css index 1b361de..9e74f64 100644 --- a/data/gtk.css +++ b/data/gtk.css @@ -1,6 +1,6 @@ #content_stack { box-shadow:inset 4px 4px 10px rgba(0,0,0,0.3); - background-image:url('noise-texture.png'); + background-image:url("@NOISETEXTURE@"); } #port_spinner { @@ -30,10 +30,6 @@ font-weight:bold; } -window.fullscreen #cover_box { - background: black; -} - #cover_info_revealer { background-color:alpha(@theme_bg_color, 0.8); box-shadow:0 0 10px @theme_bg_color; diff --git a/data/icons/meson.build b/data/icons/meson.build deleted file mode 100644 index 20bdb7c..0000000 --- a/data/icons/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -application_id = 'xyz.suruatoel.mcg' - -scalable_dir = join_paths('hicolor', 'scalable', 'apps') -install_data( - join_paths(scalable_dir, ('@0@.svg').format(application_id)), - install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir) -) diff --git a/data/ui/album-headerbar.ui b/data/ui/album-headerbar.ui index bda26a8..8a1be95 100644 --- a/data/ui/album-headerbar.ui +++ b/data/ui/album-headerbar.ui @@ -2,7 +2,7 @@ - + diff --git a/data/ui/connection-panel.ui b/data/ui/connection-panel.ui index d9e7364..42a280c 100644 --- a/data/ui/connection-panel.ui +++ b/data/ui/connection-panel.ui @@ -9,79 +9,58 @@ 1 100 - - horizontal - 6 - - + diff --git a/data/ui/cover-panel.ui b/data/ui/cover-panel.ui index d869e76..f42cfe7 100644 --- a/data/ui/cover-panel.ui +++ b/data/ui/cover-panel.ui @@ -19,7 +19,7 @@ - + diff --git a/data/ui/library-panel.ui b/data/ui/library-panel.ui index b835e3f..2ef262d 100644 --- a/data/ui/library-panel.ui +++ b/data/ui/library-panel.ui @@ -26,13 +26,11 @@ 0 0 False - update library - @@ -53,7 +51,6 @@ sort by artist False sort_year - @@ -61,14 +58,12 @@ sort by title False sort_year - sort by year False - @@ -76,7 +71,6 @@ sort by modification False sort_year - @@ -86,7 +80,6 @@ True False True - @@ -108,9 +101,6 @@ system-search-symbolic - @@ -119,7 +109,6 @@ True True Select multiple albums - object-select-symbolic @@ -145,7 +134,7 @@ -