mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-30 22:47:14 +02:00
reverts unsafe shell=True, add option for skipping reload environment
This commit is contained in:
parent
648ff3c4f0
commit
282605376d
@ -65,6 +65,9 @@ def get_args(args):
|
|||||||
arg.add_argument("-v", action="store_true",
|
arg.add_argument("-v", action="store_true",
|
||||||
help="Print \"wal\" version.")
|
help="Print \"wal\" version.")
|
||||||
|
|
||||||
|
arg.add_argument("-e", action="store_true",
|
||||||
|
help="Skip Reloading Environment gtk/xrdb/i3/polybar")
|
||||||
|
|
||||||
return arg.parse_args(args)
|
return arg.parse_args(args)
|
||||||
|
|
||||||
|
|
||||||
@ -114,7 +117,9 @@ def process_args(args):
|
|||||||
wallpaper.change(colors_plain["wallpaper"])
|
wallpaper.change(colors_plain["wallpaper"])
|
||||||
|
|
||||||
export.every(colors_plain)
|
export.every(colors_plain)
|
||||||
reload.env()
|
|
||||||
|
if not args.e:
|
||||||
|
reload.env()
|
||||||
|
|
||||||
if args.o:
|
if args.o:
|
||||||
util.disown([args.o])
|
util.disown([args.o])
|
||||||
|
@ -83,7 +83,14 @@ def set_desktop_wallpaper(desktop, img):
|
|||||||
|
|
||||||
def set_mac_wallpaper(img):
|
def set_mac_wallpaper(img):
|
||||||
"""Set the wallpaper on macOS."""
|
"""Set the wallpaper on macOS."""
|
||||||
subprocess.Popen(f"""osascript -e 'tell application "Finder" to set desktop picture to POSIX file "{img}"'""", shell=True)
|
db_file = HOME / "Library/Application Support/Dock/desktoppicture.db"
|
||||||
|
subprocess.call(["sqlite3", db_file, f"update data set value = '{img}'"])
|
||||||
|
|
||||||
|
# Kill the dock to fix issues with cached wallpapers.
|
||||||
|
# macOS caches wallpapers and if a wallpaper is set that shares
|
||||||
|
# the filename with a cached wallpaper, the cached wallpaper is
|
||||||
|
# used instead.
|
||||||
|
subprocess.call(["killall", "Dock"])
|
||||||
|
|
||||||
|
|
||||||
def change(img):
|
def change(img):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user