Skip to content

Commit

Permalink
fix: Re-apply pywal color theme if any
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Mar 27, 2020
1 parent 2d197ab commit 3e19deb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/aria2p/interface.py
Expand Up @@ -17,8 +17,10 @@
# pylint: disable=invalid-name

import os
import sys
import time
from collections import defaultdict
from pathlib import Path

from asciimatics.event import KeyboardEvent, MouseEvent
from asciimatics.screen import ManagedScreen, Screen
Expand Down Expand Up @@ -420,10 +422,22 @@ def run(self):
time.sleep(self.sleep)
self.frame = (self.frame + 1) % self.frames
logger.debug("Screen has resized")
self.post_resize()
except Exception as error:
logger.exception(error)
return False

def post_resize(self):
logger.debug(f"Running post-resize function")
logger.debug("Trying to re-apply pywal color theme")
wal_sequences = Path.home() / ".cache" / "wal" / "sequences"
try:
with wal_sequences.open("rb") as fd:
contents = fd.read()
sys.stdout.buffer.write(contents)
except Exception:
pass

def update_select_sort_rows(self):
self.select_sort_rows = self.columns_order

Expand Down

0 comments on commit 3e19deb

Please sign in to comment.