Skip to content

Commit

Permalink
Changed the name from 'consave' to 'konsave'
Browse files Browse the repository at this point in the history
  • Loading branch information
Prayag2 committed Feb 28, 2021
1 parent e14d2ea commit bc9486a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Consave (Save Plasma Customization)
# konsave (Save Plasma Customization)
A CLI program that will let you save and apply your KDE Plasma customizations with just one command!
![SS_2021-02-27_22-44-17](https://user-images.githubusercontent.com/39525869/109394503-5fb3e580-794d-11eb-8637-70e87e2b0c26.png)

Expand All @@ -8,24 +8,24 @@ There are no dependencies! Just make sure your python version is above `3.8`.

## Installation
- Clone This repo
`git clone https://github.com/Prayag2/consave ~/Downloads/consave`
`git clone https://github.com/Prayag2/konsave ~/Downloads/konsave`
- Make it executable
`cd ~/Downloads/consave`
`cd ~/Downloads/konsave`
`sudo chmod +x ./install.sh`
- Install
`./install.sh`

## Usage
### Get Help
`consave -h`
`konsave -h`
### Save current configuration as a profile
`consave -s <profile name>`
`konsave -s <profile name>`
### List all profiles
`consave -l`
`konsave -l`
### Remove a profile
`consave -r <profile id>`
`konsave -r <profile id>`
### Apply a profile
`consave -a <profile id>`
`konsave -a <profile id>`
You may need to log out and log in to see all the changes.
## Contribution
You can contribute by reporting issues or fixing bugs!
Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~
|_| |_/_/\_\ Email: prayagjain2@gmail.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'Installing consave...'
echo 'Installing konsave...'

# Copy 'consave' to ~/.local/bin/
cp ./consave ~/.local/bin
chmod +x ~/.local/bin/consave
# Copy 'konsave' to ~/.local/bin/
cp ./konsave ~/.local/bin
chmod +x ~/.local/bin/konsave

# Done
echo 'Installed successfully! You can now delete this folder.'
echo "Try 'consave -h' for more info!"
echo "Try 'konsave -h' for more info!"
22 changes: 11 additions & 11 deletions consave → konsave
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ help_text = '''
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usage: consave [options]
Usage: konsave [options]
Options:
-h shows help text
Expand All @@ -37,7 +37,7 @@ Options:
argv = sys.argv[1:]
home = os.path.expanduser('~')
config_dir = home + '/.config/'
profiles_dir = home + '/.haxguru/consave/profiles/'
profiles_dir = home + '/.haxguru/konsave/profiles/'
list_of_profiles = ''
folder_names = ['gtk-2.0', 'gtk-3.0', 'Kvantum']
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']
Expand All @@ -56,17 +56,17 @@ def print_msg(message, include_help=True):
'''
Prints a message with help info
'''
print(f"Consave: {message.lower()}")
print(f"konsave: {message.lower()}")
if include_help:
print("Try 'consave -h' for more info!")
print("Try 'konsave -h' for more info!")


def list_profiles():
'''
Lists all the created profiles
'''
if os.path.exists(profiles_dir) and len(list_of_profiles) != 0:
print("Consave profiles:")
print("Konsave profiles:")
print(f"ID\tNAME")
for i, item in enumerate(list_of_profiles):
print(f"{i+1}\t{item}")
Expand All @@ -77,7 +77,7 @@ def list_profiles():

def save_profile(name):
'''
Saves necessary config files in ~/.haxguru/consave/profiles/<name>
Saves necessary config files in ~/.haxguru/konsave/profiles/<name>
'''
if name in list_of_profiles:
print_msg('Profile already exists')
Expand Down Expand Up @@ -144,11 +144,11 @@ def remove_profile(id):

## VALID OPTIONS AND THEIR FUNCTIONS ##
data = {
'-h': {'usage': 'consave -h', 'func': print, 'args': {'required': True, 'given_by_user': False, 'arg': help_text}},
'-s': {'usage': 'consave -s <profile name>','func': save_profile, 'args': {'required': True, 'given_by_user': True}},
'-l': {'usage': 'consave -l','func': list_profiles, 'args': {'required': False}},
'-r': {'usage': 'consave -r <profile id>','func': remove_profile, 'args': {'required': True, 'given_by_user': True}},
'-a': {'usage': 'consave -a <profile id>','func': apply_profile, 'args': {'required': True, 'given_by_user': True}}
'-h': {'usage': 'konsave -h', 'func': print, 'args': {'required': True, 'given_by_user': False, 'arg': help_text}},
'-s': {'usage': 'konsave -s <profile name>','func': save_profile, 'args': {'required': True, 'given_by_user': True}},
'-l': {'usage': 'konsave -l','func': list_profiles, 'args': {'required': False}},
'-r': {'usage': 'konsave -r <profile id>','func': remove_profile, 'args': {'required': True, 'given_by_user': True}},
'-a': {'usage': 'konsave -a <profile id>','func': apply_profile, 'args': {'required': True, 'given_by_user': True}}
}


Expand Down

0 comments on commit bc9486a

Please sign in to comment.