Verified Commit 48ad1006 authored by Sumner Evans's avatar Sumner Evans 💬
Browse files

Merge branch 'master' of gitlab.com:sumner/sublime-music

parents b333b797 d42fd396
......@@ -45,6 +45,19 @@ build:
- dist/*
expire_in: 7 days
build_logo:
image: ubuntu:19.10
stage: build
before_script:
- apt update && apt install -y inkscape make
script:
- cd docs/logo
- make
artifacts:
paths:
- docs/logo
- sublime-music.desktop
build_flatpak:
image: registry.gitlab.com/sumner/sublime-music/flatpak-build:latest
allow_failure: true
......
v0.8.11
=======
* Added a logo. It's pretty bad, but it's something.
* Added a ``.desktop`` file for the app.
* Standardized the way that command line parameters are handled to use Python's
``argparse`` instead of the GTK argument parsing.
* **Infrastructure**
* Added build step for logo at various different sizes.
v0.8.10
=======
......
......@@ -17,11 +17,16 @@ Requirements
- Probably other things... Please create an MR with any other dependencies that
you had to install to develop the app.
Install the Sublime Music app locally (commands may differ from what is
described below, this is merely an outline)::
This project uses a ``Pipfile`` for managing dev dependencies. Make sure that
you have Pipenv_ (and Pyenv_ if necessary) set up properly, then run::
pip install -e . --user
pip install -r dev-requirements.txt
pipenv install --dev
to install the development dependencies as well as install ``sublime-music``
into the virtual environment as editable.
.. _Pipenv: https://pipenv.readthedocs.io/
.. _Pyenv: https://github.com/pyenv/pyenv
Building the flatpak
--------------------
......
RAW_DIMENS=16 22 24 32 36 48 64 72 96 128 192 512 1024
DIMENS=$(join $(RAW_DIMENS:%=%x), $(RAW_DIMENS))
PNGFILES=$(patsubst %, build/%.png, $(DIMENS))
all: $(PNGFILES)
builddir:
mkdir -p build
build/%.png: logo.svg | builddir
inkscape -z -e $@ -w $(*F) $<
clean:
rm -rf build
This diff is collapsed.
[Desktop Entry]
Version=1.1
Type=Application
Name=Sublime Music
Name[es]=Música Sublime
GenericName=Music Player
Comment=Native Subsonic client for Linux
Exec=/usr/bin/sublime-music
Icon=sublime-music
Terminal=false
Categories=AudioVideo;Audio;Music;
__version__ = '0.8.10'
__version__ = '0.8.11'
#! /usr/bin/env python3
import os
import argparse
import logging
......@@ -29,6 +30,12 @@ def main():
help='the minium level of logging to do',
default='WARNING',
)
parser.add_argument(
'-c',
'--config',
help='specify a configuration file. Defaults to '
'~/.config/sublime-music/config.json',
)
args, unknown_args = parser.parse_known_args()
if args.version:
......@@ -46,5 +53,15 @@ def main():
format='%(asctime)s:%(levelname)s:%(name)s:%(module)s:%(message)s',
)
app = SublimeMusicApp()
# Config File
config_file = args.config
if not config_file:
# Default to ~/.config/sublime-music.
config_folder = (
os.environ.get('XDG_CONFIG_HOME') or os.environ.get('APPDATA')
or os.path.join(os.environ.get('HOME'), '.config'))
config_folder = os.path.join(config_folder, 'sublime-music')
config_file = os.path.join(config_folder, 'config.json')
app = SublimeMusicApp(config_file)
app.run(unknown_args)
......@@ -3,8 +3,6 @@ import logging
import math
import random
from os import environ
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Notify', '0.7')
......@@ -22,53 +20,15 @@ from .ui.common.players import PlayerEvent, MPVPlayer, ChromecastPlayer
class SublimeMusicApp(Gtk.Application):
def __init__(self, *args, **kwargs):
super().__init__(
*args,
application_id="com.sumnerevans.sublimemusic",
flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
**kwargs,
)
def __init__(self, config_file):
super().__init__(application_id="com.sumnerevans.sublimemusic")
Notify.init('Sublime Music')
self.window = None
self.state = ApplicationState()
# Specify Command Line Options
self.add_main_option(
'config',
ord('c'),
GLib.OptionFlags.NONE,
GLib.OptionArg.FILENAME,
'Specify a configuration file. Defaults to '
'~/.config/sublime-music/config.json',
None,
)
self.connect('shutdown', self.on_app_shutdown)
# Handle command line option parsing.
def do_command_line(self, command_line):
options = command_line.get_options_dict()
# Config File
config_file = options.lookup_value('config')
if config_file:
config_file = config_file.get_bytestring().decode('utf-8')
else:
# Default to ~/.config/sublime-music.
config_folder = (
environ.get('XDG_CONFIG_HOME') or environ.get('APPDATA')
or os.path.join(environ.get('HOME'), '.config'))
config_folder = os.path.join(config_folder, 'sublime-music')
config_file = os.path.join(config_folder, 'config.json')
self.state.config_file = config_file
# Have to do this or else the application doesn't work. Not entirely
# sure why, but C-bindings...
self.activate()
return 0
self.connect('shutdown', self.on_app_shutdown)
def do_startup(self):
Gtk.Application.do_startup(self)
......
......@@ -208,8 +208,7 @@ class DBusManager:
'CanRaise': True,
'HasTrackList': True,
'Identity': 'Sublime Music',
# TODO should implement in #29
'DesktopEntry': 'foo',
'DesktopEntry': 'sublime-music',
'SupportedUriSchemes': [],
'SupportedMimeTypes': [],
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment