Compare commits
No commits in common. "d511c4bb428d4af751282f282980ee0e9211f1f3" and "466af2ccf09be1c15a564b21b51be99b01e15bc4" have entirely different histories.
d511c4bb42
...
466af2ccf0
@ -21,18 +21,17 @@ imgsort
|
||||
## Installation
|
||||
Clone this repository and install it using python-pip.
|
||||
pip should also install https://github.com/seebye/ueberzug, which lets you view images in a terminal.
|
||||
https://github.com/jstkdng/ueberzugpp
|
||||
```shell
|
||||
cd ~/Downloads
|
||||
git clone https://github.com/MatthiasQuintern/imgsort.git
|
||||
cd imgsort
|
||||
python3 -m pip install .
|
||||
```
|
||||
You can also install it system-wide using `sudo python3 -m pip install.`
|
||||
|
||||
## Changelog
|
||||
### 1.2
|
||||
- Works with ueberzugpp
|
||||
- Added option to open file with `xdg-open`
|
||||
- Use pyproject.toml for installation
|
||||
|
||||
### 1.1
|
||||
|
@ -122,7 +122,7 @@ class Sorter:
|
||||
|
||||
self.pressed_key = self.window.getkey() # wait until user presses something
|
||||
|
||||
# check for quit, skip, undo or open
|
||||
# check for quit, skip or undo
|
||||
if self.pressed_key in self.settings:
|
||||
if self.settings[self.pressed_key] == "quit":
|
||||
self.quit(f"Key '{self.pressed_key}' pressed. Canceling image sorting")
|
||||
@ -142,11 +142,10 @@ class Sorter:
|
||||
continue
|
||||
elif settings[self.pressed_key] == "open":
|
||||
try:
|
||||
subprocess.run(['xdg-open', self.image], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
|
||||
subprocess.run(['xdg-open', self.image])
|
||||
self.message = "Opening with xdg-open"
|
||||
except Exception as e:
|
||||
print(f"open: Error: {e}")
|
||||
continue
|
||||
|
||||
# move to folder
|
||||
elif self.pressed_key in self.keys:
|
||||
@ -165,7 +164,6 @@ class Sorter:
|
||||
Draw lines and text
|
||||
"""
|
||||
self.window.erase()
|
||||
self.win_y, self.win_x = self.window.getmaxyx()
|
||||
|
||||
# lines
|
||||
self.window.hline(self.win_y - FOOTER_HEIGHT, FOOTER_LEFT, '=', self.win_x)
|
||||
@ -236,14 +234,12 @@ class Sorter:
|
||||
return new_path
|
||||
|
||||
def quit(self, message = ""):
|
||||
print(message)
|
||||
print(f"Quitting imgsort {version}")
|
||||
exit(0)
|
||||
|
||||
def __del__(self):
|
||||
self.window.clear()
|
||||
self.window.refresh()
|
||||
c.endwin()
|
||||
print(message)
|
||||
print(f"Quitting imgsort {version}")
|
||||
exit(0)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user