Skip to content

Commit

Permalink
Add snap notice (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus authored Jun 9, 2024
1 parent 3bb9dd8 commit bb86083
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions buzz/widgets/main_window.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import logging
import sounddevice
import keyring
from typing import Tuple, List, Optional

from PyQt6 import QtGui
Expand Down Expand Up @@ -141,6 +142,7 @@ def __init__(self, transcription_service: TranscriptionService):
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):
Expand All @@ -151,6 +153,12 @@ def check_linux_permissions(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb86083

Please sign in to comment.