Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add custom locations? #61

Closed
tripplehelix opened this issue May 8, 2022 · 14 comments
Closed

Can't add custom locations? #61

tripplehelix opened this issue May 8, 2022 · 14 comments
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@tripplehelix
Copy link

tripplehelix commented May 8, 2022

Describe the bug
See information below

Expected behavior
Backup files without issues

System information

  • OS or Linux distribution: Debian Sid
  • How did you install Konsave? PIP
  • What version of Konsave are you using? 2.1.2 Did you try updating? yes

Additional context

I keep getting:

Konsave: Exporting "zsh"...
Konsave: Source path doesn't exist
Please check the log at /home/tom/konsave_log.txt for more details.

which refers to this error:

Traceback (most recent call last):
  File "/home/tom/.local/lib/python3.10/site-packages/konsave/funcs.py", line 40, in inner_func
    function = func(*args, **kwargs)
  File "/home/tom/.local/lib/python3.10/site-packages/konsave/funcs.py", line 100, in copy
    assert os.path.exists(source), "Source path doesn't exist"
AssertionError: Source path doesn't exist

This is my config:


save:

    [...]

    zsh:
        location: "$HOME"
        entries:
            - .zshrc

I have also tried pointing the location using the full location and get the same error. What is happening and how do I fix it?

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

The location you have entered does not exist. Please check if .zshrc really exists in your home directory. It is working for me.

@tripplehelix
Copy link
Author

tripplehelix commented May 8, 2022

It definitely is... this is also spewing the same error for 3 other locations that all exist.

image

Should it be "$HOME/tom" ? But then why wouldn't /home/tom/ work?

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Should it be "$HOME/tom" ?

No. $HOME is a placeholder that points to the current user's home directory so it's actually just /home/tom/. But you can also try putting /home/tom/ directly there, though if you then export your profile and share it to somebody, your .zshrc file won't be copied to their home directory (it will try to find /home/tom/ in their PC which obviously won't exist as long as the usernames are not same).

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Can you please share the whole config file?

@tripplehelix
Copy link
Author

---
# This is the configuration file for konsave.
# This file is pre-configured for KDE Plasma users.
# This will backup all the important files for your Plasma customizations.
# Please make sure it follows the correct format for proper working of Konsave.
# The format should be:
# ---
# save:
#     name:
#         location: "path/to/parent/directory"
#         entries: 
#         # these are files which will be backed up. 
#         # They should be present in the specified location.
#             - file1
#             - file2
# export:
#     # This includes files which will be exported with your profile.
#     # They will not be saved but only be exported and imported.
#     # These may include files like complete icon packs and themes..
#     name:
#         location: "path/to/parent/directory"
#         entries: 
#             - file1
#             - file2
# ...
# You can use these placeholders in the "location" of each item:
# $HOME: the home directory
# $CONFIG_DIR: refers to "$HOME/.config/"
# $SHARE_DIR: refers to "$HOME/.local/share"
# $BIN_DIR: refers to "$HOME/.local/bin"
# ${ENDS_WITH="text"}: for folders with different names on different computers whose names end with the same thing.
# The best example for this is the "*.default-release" folder of firefox.
# ${BEGINS_WITH="text"}: for folders with different names on different computers whose names start with the same thing.

save:
    configs:
        location: "$CONFIG_DIR"
        entries:
            - gtk-2.0
            - gtk-3.0
            - gtk-4.0
            - Kvantum
            - latte
            - 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
            - khotkeysrc
            - yakuakerc

    app_layouts:
        location: "$HOME/.local/share/kxmlgui5"
        entries:
            - dolphin
            - konsole

    # Here are a few examples of how you can add more stuff to back up.
    # Uncomment these lines if you want.
    # firefox:
    #     location: "$HOME/.mozilla/firefox/${ENDS_WITH='.default-release'}"
    #     entries:
    #         - chrome # for firefox customizations

    # code oss:
    #     location: "$CONFIG_DIR/Code - OSS/User/"
    #     entries:
    #         - settings.json

    zsh:
        location: "$HOME"
        entries:
            - .zshrc

    oh-my-zsh-theme:
        location: "$HOME/.oh-my-zsh/custom/themes"
        entries:
            - tom.zsh-theme

    oh-my-zsh-plugin:
        location: "$HOME/.oh-my-zsh/custom/plugins"
        entries:
            - zsh-autocomplete  
            - zsh-autosuggestions  
            - zsh-syntax-highlighting

    scripts:
        location: "$BIN_DIR"
        entries: 
            - gay
            - lfs
            - stonks
            - ufetch
            - dict
            - mountnas
            - update
            
# The following files will only be used for exporting and importing.
export:
    share_folder:
        location: "$SHARE_DIR"
        entries:
            - plasma
            - kwin
            - konsole
            - fonts
            - color-schemes
            - aurorae
            - icons
            - wallpapers

    home_folder:
        location: "$HOME/"
        entries:
            - .fonts
            - .themes
            - .icons
    
        
    # You can add more files to export like this
    # name:
    #     location: "path/to/parent/directory"
    #     entries:
    #         - file1
    #         - file2
    #         - folder1
    #         - folder2
...

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Do you get this error with the default config file?

@tripplehelix
Copy link
Author

tripplehelix commented May 8, 2022

No everything default works fine, for some reason additions to

    configs:
        location: "$CONFIG_DIR"

Also don't show up in the archive... am I doing something wrong?

I run the command via
konsave -e tomkde

my profile 'tomkde' is located here
~/.config/konsave/profiles/tomkde/conf.yaml

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Did you save the profile before exporting? You have to do konsave -s <profile-name> before you can export it to an archive.

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

No everything default works fine, for some reason additions to

   configs:
       location: "$CONFIG_DIR"

Also don't show up in the archive... am I doing something wrong?

These additions are hidden files. Make sure that you have enabled "show hidden files" in your file manager.

@tripplehelix
Copy link
Author

tripplehelix commented May 8, 2022

Did you save the profile before exporting? You have to do konsave -s <profile-name> before you can export it to an archive.

That was the issue! Thanks, that fixed it.

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Glad it worked :)

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

But I'll open this issue again. Because I just noticed that the user should be aware of the fact that the profile needs to be saved first. I'll add a message in the help text and make it so that it will throw an error if the profile doesn't exist :)

@Prayag2 Prayag2 reopened this May 8, 2022
@Prayag2 Prayag2 added the bug Something isn't working label May 8, 2022
@Prayag2 Prayag2 added this to the v2.1.3 milestone May 8, 2022
@tripplehelix
Copy link
Author

The profile existed, I had just edited the file ~/.config/konsave/profiles/tomkde/conf.yaml instead of just editing ~/.config/konsave/conf.yaml then resaving.

@Prayag2
Copy link
Owner

Prayag2 commented May 8, 2022

Oh

@Prayag2 Prayag2 self-assigned this May 11, 2022
@Prayag2 Prayag2 added documentation Improvements or additions to documentation and removed bug Something isn't working labels Oct 18, 2022
@Prayag2 Prayag2 closed this as completed Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants