diff --git a/CHANGELOG b/CHANGELOG index 3725189..e44b27e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,4 +16,10 @@ · Added "copy password to clipboard" command - 0.6: · Added "random string for password" function - · Fixed a bug with the copy command when the database is empty \ No newline at end of file + · Fixed a bug with the copy command when the database is empty +- 1.0: + · Code cleanup + · Added 'help' command + · Minor bug fixes: + · ITEM_CURSOR and GLOBAL_CURSOR now behave properly under all(tested) circumstances + · Added random string to modify password \ No newline at end of file diff --git a/README.md b/README.md index 44a9957..5180562 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ Just run `install.sh` **WITHOUT SUDO** If you're upgrading Steelbox, don't worry: `install.sh` will do it automatically without messing with your password file #### Dependencies: -As of V0.5, you need the [pyperclip](https://pypi.org/project/pyperclip/) module. You can install it with [pip](https://pypi.org/project/pip/): +Clipboard support needs the [pyperclip](https://pypi.org/project/pyperclip/) module. You can install it with [pip](https://pypi.org/project/pip/): `pip3 install pyperclip` -Also, for clipboard support to work, you need [xclip](https://github.com/astrand/xclip) or [xsel](https://github.com/kfish/xsel) on your machine. +Also for clipboard support, you need [xclip](https://github.com/astrand/xclip) or [xsel](https://github.com/kfish/xsel) on your machine. -This program has no support for the wayland clipboard. +This program has no support for the wayland clipboard... Unless pyperclip starts supporting it :P -The standard ( this program was made with 3.10 ) python installation comes with the `curses` and `csv` modules, just make sure you have [GnuPG](https://gnupg.org/) installed. \ No newline at end of file +The standard ( this program was made with v3.10 ) python installation comes with the `curses` and `csv` modules, just make sure you have [GnuPG](https://gnupg.org/) installed. \ No newline at end of file diff --git a/sbhelp b/sbhelp new file mode 100644 index 0000000..0df418c --- /dev/null +++ b/sbhelp @@ -0,0 +1,29 @@ +Made by Kamal 'brejela' Curi, kamalcuri@outlook.com ││ +For licensing information, read LICENSE ││ +-------------------------------------------------------------------------------- ││ +Directional keys:...........Move the cursor ││ +PgDown/F1:..................Previous Page ││ +PgUp/F2:....................Next Page ││ +Enter/E:....................View password ││ +R:..........................Opens a window with a random string ││ +##### These commands work wether there's an open password or not ##### ││ +C/F3:.......................Copy password to clipboard (Requires xclip or xsel) ││ +N/F4:.......................New password ││ +M/F5:.......................Modify password ││ +D/Del:......................Delete password ││ +###################################################################### ││ +When creating a password, you can leave the PSWD field empty, a random password ││ +will be generated in its place. ││ +Leaving the PSWD field empty when modifying a password will also give it ││ +a random string. +------------------------------------------------------------------------ ││ +In case you're not running this software under st or alacritty, ││ +cursor navigation can be a bit janky: ││ +CTRL+A to go to the far left of the field ││ +CTRL+E to go to the far right of the field ││ +CTRL+B to move the cursor once to the left ││ +CTRL+F to move the cursor once to the right ││ +CTRL+H to remove one character (Backspace) ││ +CTRL+D to remove highlghted character (Delete) ││ +CTRL+O to clear the field +------------------------------------------------------------------------ \ No newline at end of file diff --git a/steelbox.py b/steelbox.py index c4063d9..edd7bb4 100644 --- a/steelbox.py +++ b/steelbox.py @@ -1,6 +1,5 @@ import csv import curses -from curses import wrapper from curses.textpad import Textbox import sys import os @@ -170,14 +169,16 @@ def command(): examine() elif c == ord('c') or c == curses.KEY_F3: copy() - elif c == ord('n'): + elif c == ord('n') or c == curses.KEY_F4: newFile() - elif c == ord('m'): + elif c == ord('m') or c == curses.KEY_F5: modFile() elif c == ord('d') or c == curses.KEY_DC: delFile() elif c == ord('r'): rwin() + elif c == ord('h'): + sbhelp() def newFile(): @@ -303,6 +304,8 @@ def modFile(): displayStatus(STATUS_MESSAGE) psBox.edit() passPswd = psBox.gather() + if passPswd == '': + passPswd = randString() modFile = {'service' : passService, 'user' : passUser, 'pswd' : passPswd} files.insert(GLOBAL_CURSOR, modFile) with open(PASFILE, mode='w') as pasfile: @@ -375,9 +378,6 @@ def displayItems(): for ps_name in files: displayList.append(ps_name['service'][:15]) - - - # Reset global necessities LINE = 0 COLUMN = 0 @@ -414,6 +414,19 @@ def displayStatus(msg): statuswin.addstr(0,0, msg) statuswin.refresh() +def sbhelp(): + helpwin = curses.newwin(TERM_LINES - 1, TERM_COLS - 1, 0, 0) + helpwin.border() + helpwin.addstr(1, 1, "Steelbox V." + version) + line = 2 + with open("sbhelp", mode='r') as sbhfile: + sbh = sbhfile.readlines() + for lines in sbh: + helpwin.addstr(line, 1, lines) + line+=1 + line+=1 + helpwin.addstr(line, 1, "PRESS ANY KEY TO CONTINUE", curses.A_REVERSE) + helpwin.getch() @@ -435,12 +448,8 @@ def close(error = ''): stdscr.keypad(False) curses.echo() curses.endwin() - if error == '': - print("Goodbye!") sys.exit(error) - - globals() steelbox() close() \ No newline at end of file diff --git a/steelbox.sh b/steelbox.sh index 3ff1999..e966cfa 100755 --- a/steelbox.sh +++ b/steelbox.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -version="0.6" +version="1.0" echo Steelbox V$version