Skip to content

Commit

Permalink
Merge pull request #61 from nwg-piotr/screenshot
Browse files Browse the repository at this point in the history
add Screenshot applet; improve updates applet
  • Loading branch information
nwg-piotr authored Nov 17, 2023
2 parents 3aa178d + a487963 commit 4cd43fd
Show file tree
Hide file tree
Showing 13 changed files with 436 additions and 8 deletions.
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ cp nwg-shell-translate.svg /usr/share/pixmaps/
cp nwg-update-noupdate.svg /usr/share/pixmaps/
cp nwg-update-available.svg /usr/share/pixmaps/
cp nwg-update-checking.svg /usr/share/pixmaps/
cp nwg-screenshot.svg /usr/share/pixmaps/
cp nwg-3.svg /usr/share/pixmaps/
cp nwg-2.svg /usr/share/pixmaps/
cp nwg-1.svg /usr/share/pixmaps/
cp nwg-system-update /usr/local/bin/
41 changes: 41 additions & 0 deletions nwg-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions nwg-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions nwg-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions nwg-screenshot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions nwg_shell_config/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@
"run-with-gtk-theme": "Run with GTK_THEME=",
"run-with-gtk-theme-tooltip": "Run apps with GTK_THEME=<default-gtk-theme> environment variable. Necessary to set a theme other than Adwaita for libadwaita/GTK4 apps.",
"screen-settings": "Screen settings",
"screenshot": "Screenshot",
"screenshot-applet": "Screenshot applet",
"screenshot-applet-tooltip": "Determines if to show the screenshot applet in the system tray",
"screenshot-display": "Focused display",
"screenshot-focused": "Focused window",
"screenshot-fullscreen": "Full screen",
"screenshot-region": "Region",
"scroll-button": "Scroll button",
"scroll-button-tooltip": "Sets the scroll button. Has to be an int, cannot be a string.\nCheck `wev` if you have any doubts regarding the ID. 0 means default.",
"scroll-factor": "Scroll factor",
Expand Down
7 changes: 7 additions & 0 deletions nwg_shell_config/langs/pl_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@
"run-with-gtk-theme": "Uruchamiaj z GTK_THEME=",
"run-with-gtk-theme-tooltip": "Uruchamiaj programy ze zmienną środowiskową GTK_THEME=<default-gtk-theme>. Konieczne by aplikacjom libadwaita/GTK4 ustawić inny motyw niż Adwaita.",
"screen-settings": "Ustawienia ekranu",
"screenshot": "Zrzut ekranu",
"screenshot-applet": "Applet zrzutu ekranu",
"screenshot-applet-tooltip": "Określa czy uruchamiać applet zrzutu ekranu w tacce systemowej.",
"screenshot-display": "Aktywny wyświetlacz",
"screenshot-focused": "Aktywne okno",
"screenshot-fullscreen": "Pełny ekran",
"screenshot-region": "Obszar",
"scroll-button": "Przycisk przewijania",
"scroll-button-tooltip": "Ustawia przycisk przewijania, wartość int. Sprawdź `wev` jeśli masz wątpliwości.\n0 oznacza przycisk domyślny.",
"scroll-factor": "Współczynnik przewijania",
Expand Down
8 changes: 8 additions & 0 deletions nwg_shell_config/main_hyprland.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ def save_includes():
if settings["update-indicator-on"]:
includes.append("exec-once = nwg-update-indicator")

if settings["screenshot"]:
includes.append("exec = nwg-screenshot-applet")

if settings["show-on-startup"]:
includes.append("exec-once = nwg-shell-config")

Expand Down Expand Up @@ -935,6 +938,10 @@ def reload():
subprocess.call("pkill -f nwg-update-indicator", shell=True, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)

if not settings["screenshot"]:
subprocess.call("pkill -f nwg-screenshot", shell=True, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)


def load_settings():
settings_file = os.path.join(data_dir, "settings-hyprland")
Expand All @@ -952,6 +959,7 @@ def load_settings():
"browser": "",
"panel-preset": "hyprland-0",
"panel-custom": "",
"screenshot": True,
"show-on-startup": True,

"gen-use-settings": True,
Expand Down
8 changes: 8 additions & 0 deletions nwg_shell_config/main_sway.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,9 @@ def save_includes():
if settings["update-indicator-on"]:
autostart.append("exec nwg-update-indicator")

if settings["screenshot"]:
autostart.append("exec_always nwg-screenshot-applet")

if settings["show-on-startup"]:
autostart.append("exec nwg-shell-config")

Expand Down Expand Up @@ -827,6 +830,10 @@ def reload():
else:
subprocess.call("pkill -f nwg-update-indicator", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)

if not settings["screenshot"]:
subprocess.call("pkill -f nwg-screenshot", shell=True, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)


def load_settings():
settings_file = os.path.join(data_dir, "settings")
Expand All @@ -851,6 +858,7 @@ def load_settings():
"browser": "",
"panel-preset": "preset-0",
"panel-custom": "",
"screenshot": True,
"show-on-startup": True,
"keyboard-use-settings": True,
"keyboard-identifier": "",
Expand Down
Loading

0 comments on commit 4cd43fd

Please sign in to comment.