This commit is contained in:
Vinicius Moreira
2019-06-14 11:24:25 -03:00
parent 3e64c80a97
commit 5f77f4dcb1
5 changed files with 85 additions and 43 deletions

13
CHANGELOG.md Normal file
View File

@@ -0,0 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.1.0] - 2019-06-14
### Features
- System tray icon.
- Applications management window.
- Support for the following locales: PT, EN, ES.
- System notification for new updates.
- Update applications.

22
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,22 @@
# How can I contribute?
Well, you can...
* Report bugs
* Add improvements
* Fix bugs
* Add new translations or fix the current ones
# Reporting bugs
The best means of reporting bugs is by following these basic guidelines:
* First describe in the title of the issue tracker what's gone wrong.
* In the body, explain a basic synopsis of what exactly happens, explain how you got the bug one step at a time. If you're including script output, make sure you run the script with the verbose flag `-v`.
* Explain what you had expected to occur, and what really occurred.
* Optionally, if you want, if you're a programmer, you can try to issue a pull request yourself that fixes the issue.
# Adding improvements
The way to go here is to ask yourself if the improvement would be useful for more than just a singular person, if it's for a certain use case then sure!
* In any pull request, explain thoroughly what changes you made
* Explain why you think these changes could be useful
* If it fixes a bug, be sure to link to the issue itself.
* Follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) code style to keep the code consistent.

View File

@@ -1,19 +1,46 @@
## fpakman ## fpakman
Graphical interface for Flatpak application management. It is a tray icon to let the user known when new updates are available. Graphical user interface for Flatpak application management. It is a tray icon to let the user known when new updates are available.
It has also a management window allowing the user to see all installed apllications and update them. It has also a management window allowing the user to see all installed applications and update them.
### Developed with: ### Developed with:
- Python3 and QT 5. - Python3 and QT 5.
### Requirements ### Requirements
- Python >= 3.5 #### Debian-based distros
- qt5 packages
- libappindicator3 (for GTK3 desktop environments) - libappindicator3 (for GTK3 desktop environments)
- python3-venv (for Debian based distros -> Ubuntu, Linux Mint, ...) - python3-venv
#### Arch-based distros
- python
- python-requests
- python-pip
- python-pyqt5
## Installation script
You can install the application without compromising your system via the provided installation script called 'sandbox_installer.py'. ### Installation script
Type in the terminal: sudo python3 sandbox_installer.py. If you want to uninstall the application, just call the script the same way. You can install the application without compromising your system via the provided installation script called 'install.py'.
Type in the terminal:
```
sudo python3 install.py.
```
If you want to uninstall the application, just call the script the same way.
To start the application, type in the terminal:
```
fpakman
```
### Manual installation:
Inside the project directory type the following commands:
```
python3 -m venv env
env/bin/pip install -r requirements.txt
chmod +x app.py
./app.py
```
### Autostart
In order to autostart the application, use your Desktop Environment settings to register it as startup script ("fpakman").
(P.S: the installation script currently does not do that)
### Settings ### Settings
You can change some application settings via environment variables: You can change some application settings via environment variables:
@@ -21,5 +48,6 @@ You can change some application settings via environment variables:
- **FPAKMAN_CHECK_INTERVAL**: define the updates check interval in seconds. Default: 60. - **FPAKMAN_CHECK_INTERVAL**: define the updates check interval in seconds. Default: 60.
### Roadmap ### Roadmap
- Show update commands - Show updates being applied.
- Search and install applications. - Search and install applications.
- Uninstall applications.

4
app.py
View File

@@ -8,7 +8,7 @@ from PyQt5.QtWidgets import QApplication, QWidget
from core.controller import FlatpakController from core.controller import FlatpakController
from core.model import FlatpakManager from core.model import FlatpakManager
from view.qt.systray import TrayIcon from view.qt.systray import TrayIcon
from core import __version__, resource, util from core import __version__, util
parser = argparse.ArgumentParser(prog='fpakman', description="GUI for Flatpak applications management") parser = argparse.ArgumentParser(prog='fpakman', description="GUI for Flatpak applications management")
parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__)) parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__))
@@ -25,7 +25,7 @@ hidden_widget = QWidget()
trayIcon = TrayIcon(locale_keys=locale_keys, trayIcon = TrayIcon(locale_keys=locale_keys,
parent=hidden_widget, parent=hidden_widget,
controller=controller, controller=controller,
check_interval=int(os.getenv('FPAKMAN_CHECK_INTERVAL', 30))) check_interval=int(os.getenv('FPAKMAN_CHECK_INTERVAL', 60)))
trayIcon.show() trayIcon.show()
sys.exit(app.exec_()) sys.exit(app.exec_())

View File

@@ -1,9 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
################################################################ ################################################################
# It installs the application without compromising you system. #
# libraries. 'qt5' is required to be installed. #
# #
# If you use GTK, install 'libappindicator3' also. #
# # # #
# EXECUTE THIS SCRIPT INSIDE THE PROJECT FOLDER AS ROOT # # EXECUTE THIS SCRIPT INSIDE THE PROJECT FOLDER AS ROOT #
# # # #
@@ -18,8 +14,7 @@ if not os.geteuid() == 0:
sys.exit("\nOnly root can run this script\n") sys.exit("\nOnly root can run this script\n")
link_path = '/usr/local/bin/fpakman' runner_file = '/usr/local/bin/fpakman'
runner_file = 'run.sh'
env_name = 'env' env_name = 'env'
@@ -27,19 +22,21 @@ def log(msg: str):
print('[fpakman] {}'.format(msg)) print('[fpakman] {}'.format(msg))
if os.path.exists(link_path): if os.path.exists(runner_file):
log('already installed') log('already installed')
log('Do you wish to uninstall it ? (y/N)') log('Do you wish to uninstall it ? (y/N)')
uninstall = input() uninstall = input()
if uninstall.lower() == 'y': if uninstall.lower() == 'y':
try: if os.path.exists(runner_file):
os.unlink(link_path)
except: try:
log("Could not remove the runner syslink '{}'".format(link_path)) os.remove(runner_file)
log("Aborting...") except:
exit(1) log("Could not remove the runner file '{}'".format(runner_file))
log("Aborting...")
exit(1)
if os.path.exists('{}/{}'.format(os.getcwd(), env_name)): if os.path.exists('{}/{}'.format(os.getcwd(), env_name)):
try: try:
@@ -49,15 +46,6 @@ if os.path.exists(link_path):
log("Aborting") log("Aborting")
exit(1) exit(1)
if os.path.exists('{}/{}'.format(os.getcwd(), runner_file)):
try:
os.remove(runner_file)
except:
log("Could not remove the runner file '{}'".format(runner_file))
log("Aborting...")
exit(1)
log("Successfully uninstalled") log("Successfully uninstalled")
else: else:
@@ -80,20 +68,11 @@ else:
if res: if res:
log("Creating runner as '{}'".format(runner_file)) log("Creating runner as '{}'".format(runner_file))
with open('run.sh', 'w+') as f: with open(runner_file, 'w+') as f:
f.write('#!/bin/bash\n{d}/env/bin/python {d}/app.py'.format(d=os.getcwd())) f.write('#!/bin/bash\n{d}/env/bin/python {d}/app.py'.format(d=os.getcwd()))
system.run_cmd('chmod +x ' + runner_file) system.run_cmd('chmod +x ' + runner_file)
log("Creating syslink as '{}'".format(link_path))
try:
os.link('{}/{}'.format(os.getcwd(), runner_file), link_path)
except:
log("Could not create the syslink")
log("Aborting...")
exit(1)
log('Successfully installed') log('Successfully installed')
else: else:
log('Could not install python requirements to the virtualenv') log('Could not install python requirements to the virtualenv')