Compare commits

...

5 Commits

Author SHA1 Message Date
nikolaizombie1
bfa12c25ae
Merge 050eba6e34 into 3cb3ef6a79 2024-06-10 15:02:23 +02:00
Roman
3cb3ef6a79
Merge pull request #60 from bitSheriff/feature/quitWithESC
Quit the Appication with ESC
2024-06-10 06:53:13 -04:00
bitSheriff
9c4ae6a717 quit the application with ESC 2024-06-10 12:42:28 +02:00
nikolaizombie1
050eba6e34 Add listing of monitors and wallpapers through a command line option 2024-06-07 16:36:21 -04:00
nikolaizombie1
6f461d6e9f Add json export 2024-06-07 16:05:14 -04:00
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@
import argparse
import sys
import time
import json
from waypaper.aboutdata import AboutData
from waypaper.app import App
@ -43,6 +44,7 @@ parser.add_argument("--restore", help=txt.msg_arg_rest, action="store_true")
parser.add_argument("--random", help=txt.msg_arg_rand, action="store_true")
parser.add_argument("--fill", help=txt.msg_arg_fill, choices=FILL_OPTIONS)
parser.add_argument("--backend", help=txt.msg_arg_back, choices=BACKEND_OPTIONS)
parser.add_argument("--list", help=txt.msg_arg_list, action='store_true')
args = parser.parse_args()
@ -71,6 +73,12 @@ def run():
if args.version:
print(f"{about.applicationName()} v.{about.applicationVersion()}")
sys.exit(0)
if args.list:
# Get the wallpapers and monitors and create a list of dictionaries
wallpapers_and_monitors = list(map(lambda x: {"monitor": x[0], "wallpaper": x[1]} ,zip(cf.monitors,cf.wallpapers_str.split(','))))
print(json.dumps(wallpapers_and_monitors))
sys.exit(0)
# Start GUI:
app = App(txt)

View File

@ -512,7 +512,7 @@ class App(Gtk.Window):
def on_key_pressed(self, widget, event) -> None:
"""Process various key binding"""
if event.keyval == Gdk.KEY_q:
if (event.keyval == Gdk.KEY_q) or (event.keyval == Gdk.KEY_Escape):
Gtk.main_quit()
elif event.keyval == Gdk.KEY_r: