added necessary files for snap + first working snap version

This commit is contained in:
Adnan Hodzic 2020-01-21 23:44:42 +01:00
parent 787560c056
commit 1cc0099d22
5 changed files with 79 additions and 2 deletions

View File

@ -1,8 +1,12 @@
#!/usr/bin/env python3
#
# auto-cpufreq - Automatic CPU speed & power optimizer for Linux
#
# Blog post: http://foolcontrol.org/?p=3124
import sys
sys.path.append('../')
from app_source.core import *
from source.core import *
# cli
@click.command()
@ -20,7 +24,7 @@ def main(monitor, live, daemon, install, log):
print("\nExample usage:\nauto-cpufreq --monitor")
print("\n-----\n")
s.call(["python3", "auto-cpufreq", "--help"])
s.call(["python3", "bin/auto-cpufreq", "--help"])
footer(79)
else:
if daemon:

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
psutil
click
distro
power

35
setup.py Normal file
View File

@ -0,0 +1,35 @@
import os
from setuptools import setup
with open('README.md') as readme_file:
readme = readme_file.read()
this = os.path.dirname(os.path.realpath(__file__))
def read(name):
with open(os.path.join(this, name)) as f:
return f.read()
setup(
name='auto-cpufreq',
version='1.0',
description='Automatic CPU speed & power optimizer for Linux',
long_description=readme,
author='Adnan Hodzic',
author_email='adnan@hodzic.org',
url='https://github.com/AdnanHodzic/auto-cpufreq',
packages=['source'],
install_requires=read('requirements.txt'),
include_package_data=True,
zip_safe=True,
licence='GPLv3',
keywords='linux cpu speed power frequency turbo optimzier auto cpufreq',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Operating System :: POSIX :: Linux'
'Environment :: Console'
'Natural Language :: English'
],
scripts=['bin/auto-cpufreq']
)

34
snap/snapcraft.yaml Normal file
View File

@ -0,0 +1,34 @@
name: auto-cpufreq
base: core18
version: '1.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: Automatic CPU speed & power optimizer for Linux
description: |
Automatic CPU speed & power optimizer for Linux based on active
monitoring of laptop's battery state, CPU usage and system load.
Ultimately allowing you to improve battery life without making
any compromises.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
auto-cpufreq:
# See 'snapcraft plugins'
plugin: python
python-version: python3
source: .
#stage-packages:
# - python3-pip
# - python3-dev
#python-packages:
# - psutil
# - click
# - distro
# - power
apps:
auto-cpufreq:
command: bin/auto-cpufreq
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8