Add snap notice (#792)

This commit is contained in:
Raivis Dejus 2024-06-09 19:03:20 +03:00 committed by GitHub
parent 3bb9dd8044
commit bb86083a33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View file

@ -40,7 +40,7 @@ Download and run the `.exe` file in the [releases page](https://github.com/chidi
**Linux**:
```shell
sudo apt-get install libportaudio2
sudo apt-get install libportaudio2 libcanberra-gtk-module libcanberra-gtk3-module
sudo snap install buzz
sudo snap connect buzz:audio-record
sudo snap connect buzz:password-manager-service

View file

@ -1,6 +1,7 @@
import os
import logging
import sounddevice
import keyring
from typing import Tuple, List, Optional
from PyQt6 import QtGui
@ -141,6 +142,7 @@ class MainWindow(QMainWindow):
self.folder_watcher.find_tasks()
if os.environ.get('SNAP_NAME', '') == 'buzz':
logging.debug("Running in a snap environment")
self.check_linux_permissions()
def check_linux_permissions(self):
@ -151,6 +153,12 @@ class MainWindow(QMainWindow):
snap_notice = SnapNotice(self)
snap_notice.show()
try:
_ = keyring.get_password(APP_NAME, username="random")
except Exception:
snap_notice = SnapNotice(self)
snap_notice.show()
def on_preferences_changed(self, preferences: Preferences):
self.preferences = preferences
self.save_preferences(preferences)

View file

@ -28,7 +28,7 @@ Download and run the `Buzz-x.y.z.exe` file.
## Linux
```shell
sudo apt-get install libportaudio2
sudo apt-get install libportaudio2 libcanberra-gtk-module libcanberra-gtk3-module
sudo snap install buzz
sudo snap connect buzz:audio-record
sudo snap connect buzz:password-manager-service