-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
116 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
README.md | ||
README.md | ||
env | ||
Konsave.egg-info | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## IMPORT ## | ||
import os, argparse | ||
from konsave.funcs import * | ||
|
||
|
||
## MAIN ## | ||
def main(): | ||
|
||
## PARSER SETTINGS ## | ||
parser = argparse.ArgumentParser( | ||
prog = 'Konsave', | ||
epilog = "Please report bugs at https://www.github.com/prayag2/konsave" | ||
) | ||
|
||
## ADDING ARGS ## | ||
parser.add_argument('-l', '--list', required = False, action = 'store_true', help='Lists created profiles') | ||
parser.add_argument('-s', '--save', required = False, type = str, help='Save current config as a profile', metavar = '<name>') | ||
parser.add_argument('-r', '--remove', required = False, type = int, help='Remove the specified profile', metavar = '<id>') | ||
parser.add_argument('-a', '--apply', required = False, type = int, help='Apply the specified profile', metavar = '<id>') | ||
parser.add_argument('-e', '--export-profile', required = False, type = int, help='Export a profile and share with your friends!', metavar = '<id>') | ||
parser.add_argument('-i', '--import-profile', required = False, type = str, help='Import a konsave file', metavar = '<path>') | ||
|
||
## PARSING ARGS ## | ||
args = parser.parse_args() | ||
|
||
## CHECKING FOR ARGUMENTS ## | ||
if args.list: | ||
check_error(list_profiles, list_of_profiles, length_of_lop) | ||
elif args.save != None: | ||
check_error(save_profile, args.save, list_of_profiles) | ||
elif args.remove != None: | ||
check_error(remove_profile, args.remove, list_of_profiles, length_of_lop) | ||
elif args.apply != None: | ||
check_error(apply_profile, args.apply, list_of_profiles, length_of_lop) | ||
elif args.export_profile != None: | ||
check_error(export, args.export_profile, list_of_profiles, length_of_lop) | ||
elif args.import_profile != None: | ||
check_error(import_profile, args.import_profile) | ||
else: | ||
parser.print_help() | ||
|
||
|
||
|
||
## CALLING MAIN ## | ||
if __name__ == '__main__': | ||
main() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## IMPORT ## | ||
import os | ||
|
||
|
||
## GLOBAL VARS ## | ||
HOME = os.path.expandvars('$HOME') | ||
CONFIG_DIR = os.path.join(HOME, '.config') | ||
KONSAVE_DIR = os.path.join(CONFIG_DIR, 'konsave') | ||
PROFILES_DIR = os.path.join(KONSAVE_DIR, 'profiles') | ||
|
||
folder_names = ['gtk-2.0', 'gtk-3.0', 'gtk-4.0', 'Kvantum', 'latte'] | ||
file_names = ['dolphinrc', 'konsolerc', 'kcminputrc', 'kdeglobals', 'kglobalshortcutsrc', 'klipperrc', 'krunnerrc', 'kscreenlockerrc', 'ksmserverrc', 'kwinrc', 'kwinrulesrc', 'plasma-org.kde.plasma.desktop-appletsrc', 'plasmarc', 'plasmashellrc', 'gtkrc', 'gtkrc-2.0', 'lattedockrc', 'breezerc', 'oxygenrc', 'lightlyrc', 'ksplashrc'] | ||
export_extension = '.knsv' | ||
|
||
if not os.path.exists(PROFILES_DIR): | ||
os.mkdirs(PROFILES_DIR) | ||
|
||
list_of_profiles = os.listdir(PROFILES_DIR) | ||
length_of_lop = len(list_of_profiles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from setuptools import setup, find_packages | ||
|
||
def read_desc(): | ||
with open('README.md', 'r') as desc: | ||
return desc.read() | ||
|
||
setup ( | ||
name="Konsave", | ||
version="1.0.3", | ||
author="Prayag Jain", | ||
author_email="prayagjain2@gmail.com", | ||
description = "A program that lets you save your Plasma configuration in an instant!", | ||
long_description=read_desc(), | ||
long_description_content_type="text/markdown", | ||
url="https://www.github.com/prayag2/konsave/", | ||
packages=find_packages(), | ||
classifiers = [ | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Operating System :: POSIX", | ||
"Environment :: Console", | ||
"Intended Audience :: End Users/Desktop", | ||
'Programming Language :: Python' | ||
], | ||
entry_points={ | ||
'console_scripts': [ | ||
"konsave = konsave.__main__:main" | ||
] | ||
} | ||
) |