├── .github
└── workflows
│ └── greet.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── NaughtyLust-for-the-badge.md
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── application
└── open-with-vscode.py
├── arrange
├── arrange-by-file-extensions.py
├── arrange-by-file-types.py
└── arrange-by-names.py
├── copy
├── copy-URIs.py
├── copy-paths.py
└── copy-text-content.py
├── customization
├── set-as-lockscreen.py
└── set-terminal-color-scheme.py
├── demo.png
├── git
├── upload-to-gist-private.py
└── upload-to-gist-public.py
├── install.sh
├── naughtylust.png
├── rename
├── rename-dash-to-space.py
├── rename-dash-to-underscore.py
├── rename-space-to-dash.py
├── rename-space-to-underscore.py
├── rename-underscore-to-dash.py
└── rename-underscore-to-space.py
└── renovate.json
/.github/workflows/greet.yml:
--------------------------------------------------------------------------------
1 | name: "Greet With A Joke"
2 | on: [issues,pull_request]
3 |
4 | jobs:
5 | test:
6 | name: setup environment
7 | runs-on: ubuntu-latest
8 | steps:
9 | - name: checkout
10 | uses: actions/checkout@v2
11 | - name: mast joke mara
12 | uses: deep5050/MastjokeMara@main
13 | with:
14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # NaughtyLust Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
6 |
7 | ## 1.0.0
8 |
9 | - engage
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | nationality, personal appearance, race, religion, or sexual identity and
10 | orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at d.pal5050@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at [https://contributor-covenant.org/version/1/4][version]
72 |
73 | [homepage]: https://contributor-covenant.org
74 | [version]: https://contributor-covenant.org/version/1/4/
75 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guidelines
2 |
3 | Pull requests are the easiest way to contribute changes to git repos at Github.
4 | They are the preferred contribution method, as they offer a nice way for
5 | commenting and amending the proposed changes.
6 |
7 | * You need a local "fork" of the GitHub repo.
8 | * Use a branch for your changes. That separates the changes in the pull request from your other changes and makes it easy to edit/amend commits in the pull request. When you're ready:
9 | - Make sure your fork is up to date.
10 | - Create and checkout the branch on your fork.
11 | - Edit changes and commit them locally.
12 | - Push them to your GitHub fork.
13 | - Visit GitHub and you should see a proposal to create a pull request.
14 |
15 | * If you later need to add new commits to the pull request, you can simply commit the changes to the local branch and then use `git push` to automatically update the pull request.
16 |
17 | * If you need to change something in the existing pull request, you can use `git push -f` to overwrite the original commits. That is easy and safe when using a feature branch.
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Dipankar Pal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/NaughtyLust-for-the-badge.md:
--------------------------------------------------------------------------------
1 | # Autobadge
2 | This is an auto-generated file
3 |
4 | ## License Badges
5 |
6 | | Syntax | Badge |
7 | | :--- | :----: |
8 | | `
` |
|
9 | ## Social Badges
10 |
11 | | Syntax | Badge |
12 | | :--- | :----: |
13 | | `
` |
|
14 | | `
` |
|
15 | | `
` |
|
16 | | `
` |
|
17 | ## Size Badges
18 |
19 | | Syntax | Badge |
20 | | :--- | :----: |
21 | | `
` |
|
22 | ## Issues Badges
23 |
24 | | Syntax | Badge |
25 | | :--- | :----: |
26 | | `
` |
|
27 | | `
` |
|
28 | | `
` |
|
29 | | `
` |
|
30 | ## Analysis Badges
31 |
32 | | Syntax | Badge |
33 | | :--- | :----: |
34 | | `
` |
|
35 | | `
` |
|
36 | ## Activity Badges
37 |
38 | | Syntax | Badge |
39 | | :--- | :----: |
40 | | `
` |
|
41 | | `
` |
|
42 | | `
` |
|
43 | | `
` |
|
44 | ## Version Badges
45 |
46 | | Syntax | Badge |
47 | | :--- | :----: |
48 | | `
` |
|
49 | ## CI/CD Badges
50 |
51 | ## Other Badges
52 |
53 | | Syntax | Badge |
54 | | :--- | :----: |
55 | | `
` |
|
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | * **What kind of change does this PR introduce? (Bug fix, feature, docs update, etc.)?**
2 |
3 |
4 | * **What is the current state prior to this change?**
5 |
6 |
7 |
8 | * **Additional clarity on why this change is necessary:**
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
NaughtyLust
4 |
5 |
6 |
7 |
8 |
Some very helpful nautilus scripts made with ❥
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ## Install
23 |
24 | 1. Download the latest release or clone this repo.
25 | 2. Run the install.sh script
26 | 3. Done!
27 |
28 | ## Features
29 |
30 | 1. Exception Handled
31 | 2. Notification Enabled
32 | 3. Easy Installation
33 |
34 | ## [TODO](https://github.com/deep5050/NaughtyLust/projects/1#column-10731729)
35 |
36 | ## Scripts Categories
37 | ### Application
38 | 1. **open-with-vscode** : Open directories/files in VScode :)
39 |
40 | ### Arrange
41 | 1. **arrange-by-file-extensions**: Aggregate files based on their extensions in separate directories
42 | 2. **arrange-by-file-types**: Aggregate files based on their types in separate directories
43 | 3. **arrange-by-names**: Aggregate files based on their first characters in separate directories
44 |
45 | ### Copy
46 | 1. **copy-paths**: Copy file(s)/Dirs absolute path(s) to the clipboard
47 | 2. **copy-URIs**: Copy files(s)/Dirs URI path(s) to the clipboard
48 | 3. **copy-text-content**: Copy content of a text file to the clipboard
49 |
50 | ### Customization
51 | 1. **set-as-lockscreen**: Set an image as lockscreen (GNOME)
52 | 2. **set-terminal-color-scheme**: Generate color pallettes from an image and set as terminal color scheme
53 |
54 | ### Git
55 | 1. **upload-to-gist-private**: Upload text/code file(s) to your GitHub Gist as private
56 | 2. **upload-to-gist-public**: Upload text/code file(s) to Gist as public
57 |
58 | > NOTE: You have to manually edit these files to set your github username and password/access_token
59 |
60 | ### Rename
61 | **Rename file(s) or dir(s) in bulk**
62 |
63 | 1. **dash-to-space**: Change every *dashes* to *(space)*
64 | 2. **dash-to-underscore**: Change every *dashes* to *_(underscores)*
65 | 3. **space-to-dash**: Change every *spaces* to *-(dash)*
66 | 4. **space-to-underscore**: Change every *spaces* to *_(underscores)*
67 | 5. **underscore-to-dash**: Change every *_(underscores)* to *-(dash)*
68 | 6. **underscore-to-space**: Change every *_(underscores)* to *(space)*
69 |
70 |
71 | ## Screenshot
72 | 
73 |
74 | ## Prerequisites
75 | In order to run the scripts you should have installed **python3** under `/usr/bin/`
76 |
77 |
78 | ## Installing
79 | Run the `install.sh` script to get it installed it on your system
80 |
81 | ## Contributing
82 |
83 | All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/deep5050) :clap: or by making a [Paypal](https://paypal.me/deep5050) donation :)
84 |
85 |
86 | ## Versioning
87 | See the [changelog](CHANGELOG.md) file
88 |
89 |
90 | ## Maintainer
91 | [Dipankar pal](@deep5050)
92 |
93 |
94 | ## License
95 | >MIT Dipankar Pal 2020
96 |
97 | See the [LICENSE](LICENSE) file for more details.
98 |
99 | [see it on Pling](https://www.pling.com/p/1419682/)
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/application/open-with-vscode.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | def notify(msg,level):
8 | try:
9 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
10 | subprocess.Popen(command,shell=True)
11 | except:
12 | pass
13 |
14 |
15 | def run_command(command):
16 | ret = 0
17 | try:
18 | out = subprocess.Popen(command, shell=True,
19 | stdout=subprocess.PIPE,
20 | stderr=subprocess.PIPE)
21 | stdout, stderr = out.communicate()
22 |
23 | if stdout:
24 | ret = 0 # when no output checking is not necessary
25 | elif stderr:
26 | ret = 1
27 | except:
28 | return -1
29 | return ret
30 |
31 |
32 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
33 | # open the first path
34 | # If some files are selected alongwith at least one directory
35 | # the directory will be selected
36 | command = f'code "{path}"'
37 |
38 | res = run_command(command)
39 | if res == 0:
40 | notify('Opening in VScode','normal')
41 | break
42 | else:
43 | notify('Something went WRONG! could not open in VScode','critical')
44 | break
--------------------------------------------------------------------------------
/arrange/arrange-by-file-extensions.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 | err = 0
32 |
33 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
34 | if os.path.isdir(path) or os.path.islink(path):
35 | continue
36 |
37 | file_name = os.path.basename(path)
38 | name,file_ext = os.path.splitext(file_name)
39 |
40 | try:
41 | ext = file_ext.split('.')[1]
42 | except:
43 | continue
44 |
45 | if ext and ext is not "":
46 | target_dir = ext.upper()
47 |
48 | command1 = f'mkdir -p {target_dir}'
49 | command2 = f' mv "./{file_name}" "./{target_dir}/{file_name}"'
50 |
51 | run_command(command1)
52 | res = run_command(command2)
53 | if res == 0:
54 | pass
55 | else:
56 | err = err + 1
57 |
58 | if err==0:
59 | notify('Files have been arranged by extensions','normal')
60 | else:
61 | notify('Some files could not be arranged','critical')
62 |
--------------------------------------------------------------------------------
/arrange/arrange-by-file-types.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | types = {"ogm": "video", "doc": "text", "class": "code", "js": "code", "swift": "code", "cc": "code", "tga": "image", "ape": "audio", "woff2": "font", "cab": "archive", "whl": "archive", "mpe": "video", "rmvb": "video", "srt": "video", "pdf": "text", "xz": "archive", "exe": "exec", "m4a": "audio", "crx": "exec", "vob": "video", "tif": "image", "gz": "archive", "roq": "video", "m4v": "video", "gif": "image", "rb": "code", "3g2": "video", "m4": "code", "ar": "archive", "vb": "code", "sid": "audio", "ai": "image", "wma": "audio", "pea": "archive", "bmp": "image", "py": "code", "mp4": "video", "m4p": "video", "ods": "sheet", "jpeg": "image", "command": "exec", "azw4": "book", "otf": "font", "ebook": "text", "rtf": "text", "ttf": "font", "mobi": "book", "ra": "audio", "flv": "video", "ogv": "video", "mpg": "video", "xls": "sheet", "jpg": "image", "mkv": "video", "nsv": "video", "mp3": "audio", "kmz": "image", "java": "code", "lua": "code", "m2v": "video", "deb": "archive", "rst": "text", "csv": "sheet", "pls": "audio", "pak": "archive", "egg": "archive", "tlz": "archive", "c": "code", "cbz": "book", "xcodeproj": "code", "iso": "archive", "xm": "audio", "azw": "book", "webm": "video", "3ds": "image", "azw6": "book", "azw3": "book", "php": "code", "kml": "image", "woff": "font", "log": "text", "zipx": "archive", "3gp": "video", "po": "code", "mpa": "audio", "mng": "video", "wps": "text", "wpd": "text", "a": "archive", "s7z": "archive", "ics": "sheet", "tex": "text", "go": "code", "ps": "image", "org": "text",
7 | "sh": "exec", "msg": "text", "xml": "code", "cpio": "archive", "epub": "book", "docx": "text", "lha": "archive", "flac": "audio", "odp": "slide", "wmv": "video", "vcxproj": "code", "mar": "archive", "eot": "font", "less": "web", "asf": "video", "apk": "archive", "css": "web", "mp2": "video", "odt": "text", "patch": "code", "wav": "audio", "msi": "exec", "rs": "code", "gsm": "audio", "ogg": "video", "cbr": "book", "azw1": "book", "m": "code", "dds": "image", "h": "code", "dmg": "archive", "mid": "audio", "psd": "image", "dwg": "image", "aac": "audio", "s3m": "audio", "cs": "code", "cpp": "code", "au": "audio", "aiff": "audio", "diff": "code", "avi": "video", "bat": "exec", "html": "code", "pages": "text", "bin": "exec", "txt": "text", "rpm": "archive", "m3u": "audio", "max": "image", "vcf": "sheet", "svg": "image", "ppt": "slide", "clj": "code", "png": "image", "svi": "video", "tiff": "image", "tgz": "archive", "mxf": "video", "7z": "archive", "drc": "video", "yuv": "video", "mov": "video", "tbz2": "archive", "bz2": "archive", "gpx": "image", "shar": "archive", "xcf": "image", "dxf": "image", "jar": "archive", "qt": "video", "tar": "archive", "xpi": "archive", "zip": "archive", "thm": "image", "cxx": "code", "3dm": "image", "rar": "archive", "md": "text", "scss": "web", "mpv": "video", "webp": "image", "war": "archive", "pl": "code", "xlsx": "sheet", "mpeg": "video", "aaf": "video", "avchd": "video", "mod": "audio", "rm": "video", "it": "audio", "wasm": "web", "el": "code", "eps": "image"}
8 |
9 |
10 | def run_command(command):
11 | ret = 0
12 | try:
13 | out = subprocess.Popen(command, shell=True,
14 | stdout=subprocess.PIPE,
15 | stderr=subprocess.PIPE)
16 | print(command)
17 | stdout, stderr = out.communicate()
18 |
19 | if stdout:
20 | ret = 0 # when no output checking is not necessary
21 | elif stderr:
22 | ret = 1
23 | except:
24 | return -1
25 | return ret
26 |
27 |
28 | def notify(msg, level):
29 | try:
30 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
31 | subprocess.Popen(command, shell=True)
32 | except:
33 | pass
34 |
35 |
36 | err = 0
37 |
38 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
39 | if os.path.isdir(path) or os.path.islink(path):
40 | continue
41 |
42 | file_name = os.path.basename(path)
43 | name, file_ext = os.path.splitext(file_name)
44 |
45 | try:
46 | ext = file_ext.split('.')[1]
47 | # print(ext)
48 | except:
49 | continue
50 |
51 | if ext and ext is not "":
52 | try:
53 | target_dir = types.get(ext.lower()).upper()
54 | # print(target_dir)
55 | except:
56 | target_dir = "OTHER"
57 | continue # remove this line to categorize as OTHER
58 |
59 | command1 = f'mkdir -p {target_dir}'
60 | command2 = f' mv "./{file_name}" "./{target_dir}/{file_name}"'
61 |
62 | run_command(command1)
63 | res = run_command(command2)
64 | if res == 0:
65 | pass
66 | else:
67 | err = err + 1
68 |
69 | if err == 0:
70 | notify('Files have been arranged by types', 'normal')
71 |
72 | else:
73 | notify('Some files could not be arranged', 'critical')
--------------------------------------------------------------------------------
/arrange/arrange-by-names.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | def run_command(command):
8 | ret = 0
9 | try:
10 | out = subprocess.Popen(command, shell=True,
11 | stdout=subprocess.PIPE,
12 | stderr=subprocess.PIPE)
13 | print(command)
14 | stdout, stderr = out.communicate()
15 |
16 | if stdout:
17 | ret = 0 # when no output checking is not necessary
18 | elif stderr:
19 | ret = 1
20 | except:
21 | return -1
22 | return ret
23 |
24 |
25 | def notify(msg, level):
26 | try:
27 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
28 | subprocess.Popen(command, shell=True)
29 | except:
30 | pass
31 |
32 |
33 | err = 0
34 | special_characters = ['@', '!', '#', '&', '%', '=',
35 | '-', '_', '.', ' ', '+', '*', '(', ')', '{', '}']
36 |
37 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
38 | if os.path.isdir(path) or os.path.islink(path):
39 | continue
40 |
41 | file_name = os.path.basename(path)
42 | file_name = file_name.strip()
43 |
44 | if any(char in file_name[0] for char in special_characters):
45 | target_dir = '@!#'
46 | else:
47 | target_dir = file_name[0].upper()
48 |
49 | command1 = f'mkdir -p {target_dir}'
50 | command2 = f' mv "./{file_name}" "./{target_dir}/{file_name}"'
51 |
52 | run_command(command1)
53 | res = run_command(command2)
54 | if res == 0:
55 | pass
56 | else:
57 | err = err + 1
58 |
59 | if err == 0:
60 | notify('Files have been arranged by names','normal')
61 |
62 | else:
63 | notify('Some files could not be arranged','critical')
--------------------------------------------------------------------------------
/copy/copy-URIs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | def notify(msg,level):
8 | try:
9 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
10 | subprocess.Popen(command,shell=True)
11 | except:
12 | pass
13 |
14 |
15 |
16 | try:
17 | import pyperclip
18 | except ImportError as e:
19 | notify('Sorry, pyperclip is not installed, run pip3 install pyperclip','critical')
20 | exit(1)
21 |
22 |
23 | URIs = os.getenv('NAUTILUS_SCRIPT_SELECTED_URIS', '')
24 | URIs = URIs.strip()
25 |
26 | if URIs is not "":
27 | try:
28 | pyperclip.copy(URIs)
29 | notify('URIs have been added to clipboard','normal')
30 | except:
31 | notify('Something went WRONG! could not save to clipboard','critical')
--------------------------------------------------------------------------------
/copy/copy-paths.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | def notify(msg,level):
8 | try:
9 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
10 | subprocess.Popen(command,shell=True)
11 | except:
12 | pass
13 |
14 |
15 |
16 | try:
17 | import pyperclip
18 | except ImportError as e:
19 | notify('Sorry, pyperclip is not installed, run pip3 install pyperclip','critical')
20 | exit(1)
21 |
22 |
23 | path = os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '')
24 |
25 | path = path.strip()
26 | if path is not "":
27 | try:
28 | pyperclip.copy(path)
29 | notify('Paths have been saved to clipboard','normal')
30 | except:
31 | notify('Something went WRONG! could not add paths to clipboard','critical')
32 |
--------------------------------------------------------------------------------
/copy/copy-text-content.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | def notify(msg,level):
8 | try:
9 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
10 | subprocess.Popen(command,shell=True)
11 | except:
12 | pass
13 |
14 |
15 | try:
16 | import pyperclip
17 | except ImportError as e:
18 | notify('Sorry, pyperclip is not installed, run pip3 install pyperclip','critical')
19 | exit(1)
20 |
21 | text_ext = types = {"ogm":"video","class":"code","js":"code","swift":"code","cc":"code","tga":"image","ape":"audio","woff2":"font","cab":"archive","whl":"archive","mpe":"video","rmvb":"video","srt":"video","xz":"archive","exe":"exec","m4a":"audio","crx":"exec","vob":"video","tif":"image","gz":"archive","roq":"video","m4v":"video","gif":"image","rb":"code","3g2":"video","m4":"code","ar":"archive","vb":"code","sid":"audio","ai":"image","wma":"audio","pea":"archive","bmp":"image","py":"code","mp4":"video","m4p":"video","ods":"sheet","jpeg":"image","command":"exec","azw4":"book","otf":"font","ttf":"font","mobi":"book","ra":"audio","flv":"video","ogv":"video","mpg":"video","xls":"sheet","jpg":"image","mkv":"video","nsv":"video","mp3":"audio","kmz":"image","java":"code","lua":"code","m2v":"video","deb":"archive","csv":"sheet","pls":"audio","pak":"archive","egg":"archive","tlz":"archive","c":"code","cbz":"book","xcodeproj":"code","iso":"archive","xm":"audio","azw":"book","webm":"video","3ds":"image","azw6":"book","azw3":"book","php":"code","kml":"image","woff":"font","log":"text","zipx":"archive","3gp":"video","po":"code","mpa":"audio","mng":"video","a":"archive","s7z":"archive","ics":"sheet","tex":"text","go":"code","ps":"image","org":"text","sh":"exec","msg":"text","xml":"code","cpio":"archive","epub":"book","lha":"archive","flac":"audio","odp":"slide","wmv":"video","vcxproj":"code","mar":"archive","eot":"font","less":"web","asf":"video","apk":"archive","css":"web","mp2":"video","patch":"code","wav":"audio","msi":"exec","rs":"code","gsm":"audio","ogg":"video","cbr":"book","azw1":"book","m":"code","dds":"image","h":"code","dmg":"archive","mid":"audio","psd":"image","dwg":"image","aac":"audio","s3m":"audio","cs":"code","cpp":"code","au":"audio","aiff":"audio","diff":"code","avi":"video","bat":"exec","html":"code","bin":"exec","txt":"text","rpm":"archive","m3u":"audio","max":"image","vcf":"sheet","svg":"image","ppt":"slide","clj":"code","png":"image","svi":"video","tiff":"image","tgz":"archive","mxf":"video","7z":"archive","drc":"video","yuv":"video","mov":"video","tbz2":"archive","bz2":"archive","gpx":"image","shar":"archive","xcf":"image","dxf":"image","jar":"archive","qt":"video","tar":"archive","xpi":"archive","zip":"archive","thm":"image","cxx":"code","3dm":"image","rar":"archive","md":"text","scss":"web","mpv":"video","webp":"image","war":"archive","pl":"code","xlsx":"sheet","mpeg":"video","aaf":"video","avchd":"video","mod":"audio","rm":"video","it":"audio","wasm":"web","el":"code","eps":"image"}
22 |
23 |
24 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
25 |
26 | if os.path.isdir(path) or os.path.islink(path):
27 | continue
28 | file_name = os.path.basename(path)
29 | name,file_ext = os.path.splitext(file_name)
30 |
31 | try:
32 | ext = file_ext.split('.')[1]
33 | except:
34 | # could not decide this one, continue
35 | continue
36 |
37 | if ext and ext is not "":
38 | try:
39 | check_ext = types.get(ext.lower())
40 | except:
41 | continue
42 |
43 | if check_ext == 'text' or check_ext=='code':
44 | # read the content, save to clipboard and quit
45 | try:
46 | f = open(path,'r')
47 | content = f.readlines()
48 | f.close()
49 | s = ""
50 | s = s.join(content)
51 | # print(s)
52 | pyperclip.copy(s.strip())
53 | notify('Content saved to clipboard','normal')
54 | break
55 | except:
56 | notify('Something went WRONG! could not save content to clipboard','critical')
57 | break
--------------------------------------------------------------------------------
/customization/set-as-lockscreen.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 |
7 | image_formats = ['jpg', 'jpeg', 'png']
8 |
9 | def run_command(command):
10 | try:
11 | out = subprocess.Popen(command, shell=True,
12 | stdout=subprocess.PIPE,
13 | stderr=subprocess.PIPE)
14 |
15 | stdout, stderr = out.communicate()
16 |
17 | if (stdout):
18 | return 0
19 | if(stderr):
20 | return 1
21 | except:
22 | return -1
23 |
24 |
25 | def notify(msg,level):
26 | try:
27 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
28 | subprocess.Popen(command,shell=True)
29 | except:
30 | pass
31 |
32 |
33 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
34 | if os.path.isfile(path):
35 | file_name = os.path.basename(path)
36 | file_name = file_name.strip()
37 | if any(ext in file_name for ext in image_formats):
38 | command = f'gsettings set org.gnome.desktop.screensaver picture-uri "file://{path}"'
39 | res = run_command(command)
40 | if res == 0:
41 | notify('Lockscreen Image has been changed','normal')
42 | break
43 | else:
44 | notify('Could not set lockscreen image','critical')
45 |
--------------------------------------------------------------------------------
/customization/set-terminal-color-scheme.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | image_formats = ['jpg', 'jpeg', 'png']
7 |
8 | def run_command(command):
9 | try:
10 | out = subprocess.Popen(command, shell=True,
11 | stdout=subprocess.PIPE,
12 | stderr=subprocess.PIPE)
13 |
14 | stdout, stderr = out.communicate()
15 |
16 | if (stdout):
17 | return 0
18 | if(stderr):
19 | return 1
20 | except:
21 | return -1
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 |
32 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
33 | if os.path.isfile(path) and any(ext in path for ext in image_formats):
34 | command = f'wal -i {path} -n'
35 | res = run_command(command)
36 | if res == 0:
37 | notify('Terminal color scheme has been changed','normal')
38 | break
39 | else:
40 | notify('Could not set terminal color scheme, is pywal installed? Run pip3 install pywal','critical')
--------------------------------------------------------------------------------
/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deep5050/NaughtyLust/13da62be7c33a0d3fc60569555ea18f3304ccc24/demo.png
--------------------------------------------------------------------------------
/git/upload-to-gist-private.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import sys
5 | import json
6 | import subprocess
7 |
8 |
9 | def notify(msg, level):
10 | try:
11 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
12 | subprocess.Popen(command, shell=True)
13 | except:
14 | pass
15 |
16 |
17 | try:
18 | import requests
19 | import pyperclip
20 | except ImportError as e:
21 | notify('Sorry, make sure requests and pyperclip is installed', 'critical')
22 | exit(1)
23 |
24 |
25 |
26 | ################################## Enter you user credentials Here ######################
27 | user_name = 'USERNAME'
28 | password_or_access_token = 'PASSWORD/TOKEN'
29 | #########################################################################################
30 |
31 |
32 | def upload_gist(to_upload):
33 | global user_name
34 | global password_or_access_token
35 |
36 | try:
37 | r = requests.post('https://api.github.com/gists',json.dumps(
38 | {"description": "NaughtyLust upload","public": False,'files':to_upload})
39 | ,auth=requests.auth.HTTPBasicAuth(user_name, password_or_access_token))
40 |
41 | response = r.json()
42 |
43 | try:
44 | if response['html_url']:
45 | url = response['html_url']
46 | try:
47 | pyperclip.copy(url.strip())
48 | notify(f'URL copied to clipboard','normal')
49 | exit(0)
50 | except:
51 | notify(f'Uploaded to {url} successfully','normal')
52 | exit(0)
53 | except:
54 | pass
55 |
56 | try:
57 | if response['message']:
58 | msg = response['message']
59 |
60 | if msg == "Bad credentials":
61 | notify('Enter correct username or password/token','critical')
62 | exit(1)
63 |
64 | if msg == 'Must specify two-factor authentication OTP code.':
65 | notify('Use Your personal access token instead of password','critical')
66 | exit(1)
67 | except:
68 | pass
69 |
70 | except:
71 | notify('Sorry something went WRONG!','critical')
72 | exit(1)
73 |
74 |
75 |
76 |
77 |
78 | types = {"ogm":"video","class":"code","js":"code","swift":"code","cc":"code","tga":"image","ape":"audio","woff2":"font","cab":"archive","whl":"archive","mpe":"video","rmvb":"video","srt":"video","xz":"archive","exe":"exec","m4a":"audio","crx":"exec","vob":"video","tif":"image","gz":"archive","roq":"video","m4v":"video","gif":"image","rb":"code","3g2":"video","m4":"code","ar":"archive","vb":"code","sid":"audio","ai":"image","wma":"audio","pea":"archive","bmp":"image","py":"code","mp4":"video","m4p":"video","ods":"sheet","jpeg":"image","command":"exec","azw4":"book","otf":"font","ttf":"font","mobi":"book","ra":"audio","flv":"video","ogv":"video","mpg":"video","xls":"sheet","jpg":"image","mkv":"video","nsv":"video","mp3":"audio","kmz":"image","java":"code","lua":"code","m2v":"video","deb":"archive","csv":"sheet","pls":"audio","pak":"archive","egg":"archive","tlz":"archive","c":"code","cbz":"book","xcodeproj":"code","iso":"archive","xm":"audio","azw":"book","webm":"video","3ds":"image","azw6":"book","azw3":"book","php":"code","kml":"image","woff":"font","log":"text","zipx":"archive","3gp":"video","po":"code","mpa":"audio","mng":"video","a":"archive","s7z":"archive","ics":"sheet","tex":"text","go":"code","ps":"image","org":"text","sh":"code","msg":"text","xml":"code","cpio":"archive","epub":"book","lha":"archive","flac":"audio","odp":"slide","wmv":"video","vcxproj":"code","mar":"archive","eot":"font","less":"web","asf":"video","apk":"archive","css":"web","mp2":"video","patch":"code","wav":"audio","msi":"exec","rs":"code","gsm":"audio","ogg":"video","cbr":"book","azw1":"book","m":"code","dds":"image","h":"code","dmg":"archive","mid":"audio","psd":"image","dwg":"image","aac":"audio","s3m":"audio","cs":"code","cpp":"code","au":"audio","aiff":"audio","diff":"code","avi":"video","bat":"code","html":"code","bin":"exec","txt":"text","rpm":"archive","m3u":"audio","max":"image","vcf":"sheet","svg":"image","ppt":"slide","clj":"code","png":"image","svi":"video","tiff":"image","tgz":"archive","mxf":"video","7z":"archive","drc":"video","yuv":"video","mov":"video","tbz2":"archive","bz2":"archive","gpx":"image","shar":"archive","xcf":"image","dxf":"image","jar":"archive","qt":"video","tar":"archive","xpi":"archive","zip":"archive","thm":"image","cxx":"code","3dm":"image","rar":"archive","md":"text","scss":"web","mpv":"video","webp":"image","war":"archive","pl":"code","xlsx":"sheet","mpeg":"video","aaf":"video","avchd":"video","mod":"audio","rm":"video","it":"audio","wasm":"web","el":"code","eps":"image"}
79 |
80 | contents_to_upload = {}
81 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
82 | print(path)
83 | if os.path.isdir(path) or os.path.islink(path):
84 | continue
85 | file_name = os.path.basename(path)
86 | name,file_ext = os.path.splitext(file_name)
87 |
88 | try:
89 | ext = file_ext.split('.')[1]
90 | except:
91 | # could not decide this one, continue
92 | continue
93 |
94 | if ext and ext is not "":
95 | try:
96 | check_ext = types.get(ext.lower())
97 | except:
98 | continue
99 |
100 | if check_ext == 'text' or check_ext=='code':
101 | # read the content, save to clipboard and quit
102 | try:
103 | f = open(path,'r')
104 | content = f.read()
105 | f.close()
106 | contents_to_upload[file_name] = {"content": content}
107 | except:
108 | notify('Something went WRONG!','critical')
109 | exit(1)
110 |
111 |
112 | upload_gist(contents_to_upload)
--------------------------------------------------------------------------------
/git/upload-to-gist-public.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import sys
5 | import json
6 | import subprocess
7 |
8 |
9 | def notify(msg, level):
10 | try:
11 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
12 | subprocess.Popen(command, shell=True)
13 | except:
14 | pass
15 |
16 |
17 | try:
18 | import requests
19 | import pyperclip
20 | except ImportError as e:
21 | notify('Sorry, make sure requests and pyperclip is installed', 'critical')
22 | exit(1)
23 |
24 |
25 |
26 | ################################## Enter you user credentials Here ######################
27 | user_name = 'USERNAME'
28 | password_or_access_token = 'PASSWORD/TOKEN'
29 | #########################################################################################
30 |
31 |
32 |
33 |
34 | def upload_gist(to_upload):
35 | global user_name
36 | global password_or_access_token
37 |
38 | try:
39 | r = requests.post('https://api.github.com/gists',json.dumps(
40 | {"description": "NaughtyLust upload","public": True,'files':to_upload})
41 | ,auth=requests.auth.HTTPBasicAuth(user_name, password_or_access_token))
42 |
43 | response = r.json()
44 |
45 | try:
46 | if response['html_url']:
47 | url = response['html_url']
48 | try:
49 | pyperclip.copy(url.strip())
50 | notify(f'URL copied to clipboard','normal')
51 | exit(0)
52 | except:
53 | notify(f'Uploaded to {url} successfully','normal')
54 | exit(0)
55 | except:
56 | pass
57 |
58 | try:
59 | if response['message']:
60 | msg = response['message']
61 |
62 | if msg == "Bad credentials":
63 | notify('Enter correct username or password/token','critical')
64 | exit(1)
65 |
66 | if msg == 'Must specify two-factor authentication OTP code.':
67 | notify('Use Your personal access token instead of password','critical')
68 | exit(1)
69 | except:
70 | pass
71 |
72 | except:
73 | notify('Sorry something went WRONG!','critical')
74 | exit(1)
75 |
76 |
77 |
78 |
79 |
80 | types = {"ogm":"video","class":"code","js":"code","swift":"code","cc":"code","tga":"image","ape":"audio","woff2":"font","cab":"archive","whl":"archive","mpe":"video","rmvb":"video","srt":"video","xz":"archive","exe":"exec","m4a":"audio","crx":"exec","vob":"video","tif":"image","gz":"archive","roq":"video","m4v":"video","gif":"image","rb":"code","3g2":"video","m4":"code","ar":"archive","vb":"code","sid":"audio","ai":"image","wma":"audio","pea":"archive","bmp":"image","py":"code","mp4":"video","m4p":"video","ods":"sheet","jpeg":"image","command":"exec","azw4":"book","otf":"font","ttf":"font","mobi":"book","ra":"audio","flv":"video","ogv":"video","mpg":"video","xls":"sheet","jpg":"image","mkv":"video","nsv":"video","mp3":"audio","kmz":"image","java":"code","lua":"code","m2v":"video","deb":"archive","csv":"sheet","pls":"audio","pak":"archive","egg":"archive","tlz":"archive","c":"code","cbz":"book","xcodeproj":"code","iso":"archive","xm":"audio","azw":"book","webm":"video","3ds":"image","azw6":"book","azw3":"book","php":"code","kml":"image","woff":"font","log":"text","zipx":"archive","3gp":"video","po":"code","mpa":"audio","mng":"video","a":"archive","s7z":"archive","ics":"sheet","tex":"text","go":"code","ps":"image","org":"text","sh":"code","msg":"text","xml":"code","cpio":"archive","epub":"book","lha":"archive","flac":"audio","odp":"slide","wmv":"video","vcxproj":"code","mar":"archive","eot":"font","less":"web","asf":"video","apk":"archive","css":"web","mp2":"video","patch":"code","wav":"audio","msi":"exec","rs":"code","gsm":"audio","ogg":"video","cbr":"book","azw1":"book","m":"code","dds":"image","h":"code","dmg":"archive","mid":"audio","psd":"image","dwg":"image","aac":"audio","s3m":"audio","cs":"code","cpp":"code","au":"audio","aiff":"audio","diff":"code","avi":"video","bat":"code","html":"code","bin":"exec","txt":"text","rpm":"archive","m3u":"audio","max":"image","vcf":"sheet","svg":"image","ppt":"slide","clj":"code","png":"image","svi":"video","tiff":"image","tgz":"archive","mxf":"video","7z":"archive","drc":"video","yuv":"video","mov":"video","tbz2":"archive","bz2":"archive","gpx":"image","shar":"archive","xcf":"image","dxf":"image","jar":"archive","qt":"video","tar":"archive","xpi":"archive","zip":"archive","thm":"image","cxx":"code","3dm":"image","rar":"archive","md":"text","scss":"web","mpv":"video","webp":"image","war":"archive","pl":"code","xlsx":"sheet","mpeg":"video","aaf":"video","avchd":"video","mod":"audio","rm":"video","it":"audio","wasm":"web","el":"code","eps":"image"}
81 |
82 | contents_to_upload = {}
83 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS', '').splitlines():
84 | print(path)
85 | if os.path.isdir(path) or os.path.islink(path):
86 | continue
87 | file_name = os.path.basename(path)
88 | name,file_ext = os.path.splitext(file_name)
89 |
90 | try:
91 | ext = file_ext.split('.')[1]
92 | except:
93 | # could not decide this one, continue
94 | continue
95 |
96 | if ext and ext is not "":
97 | try:
98 | check_ext = types.get(ext.lower())
99 | except:
100 | continue
101 |
102 | if check_ext == 'text' or check_ext=='code':
103 | # read the content, save to clipboard and quit
104 | try:
105 | f = open(path,'r')
106 | content = f.read()
107 | f.close()
108 | contents_to_upload[file_name] = {"content": content}
109 | except:
110 | notify('Something went WRONG!','critical')
111 | exit(1)
112 |
113 |
114 | upload_gist(contents_to_upload)
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "Installing dependencies ..............."
4 |
5 | echo "Installing requests ......."
6 | pip3 install requests
7 |
8 | echo "Intsalling Pyperclip ......"
9 | pip3 install pyperclip
10 |
11 | echo "Installing Pywal ......"
12 | pip3 install pywal
13 |
14 |
15 | echo "Creating directories ........"
16 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/application
17 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/arrange
18 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/copy
19 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/customization
20 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/rename
21 | mkdir -p ~/.local/share/nautilus/scripts/NaughtyLust/git
22 |
23 | echo "Copying files ............"
24 | yes | cp -rf $PWD/application/* ~/.local/share/nautilus/scripts/NaughtyLust/application/
25 | yes | cp -rf $PWD/arrange/* ~/.local/share/nautilus/scripts/NaughtyLust/arrange/
26 | yes | cp -rf $PWD/copy/* ~/.local/share/nautilus/scripts/NaughtyLust/copy/
27 | yes | cp -rf $PWD/customization/* ~/.local/share/nautilus/scripts/NaughtyLust/customization/
28 | yes | cp -rf $PWD/rename/* ~/.local/share/nautilus/scripts/NaughtyLust/rename/
29 | yes | cp -rf $PWD/git/* ~/.local/share/nautilus/scripts/NaughtyLust/git/
30 | echo "Adding execute permission ........."
31 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/application/*.py
32 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/arrange/*.py
33 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/copy/*.py
34 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/customization/*.py
35 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/rename/*.py
36 | chmod +x ~/.local/share/nautilus/scripts/NaughtyLust/git/*.py
37 |
38 | echo "NaughtyLust has been Installed successfully :)"
--------------------------------------------------------------------------------
/naughtylust.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/deep5050/NaughtyLust/13da62be7c33a0d3fc60569555ea18f3304ccc24/naughtylust.png
--------------------------------------------------------------------------------
/rename/rename-dash-to-space.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 | err = 0
32 |
33 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
34 | new_path = path.strip()
35 | new_path = new_path.replace('-',' ')
36 | command = f' mv "{path}" "{new_path}"'
37 | res = run_command(command)
38 | print(res)
39 | if res == 0:
40 | pass
41 | else:
42 | err = err + 1
43 |
44 | if err == 0:
45 | notify('All files renamed','normal')
46 | else:
47 | notify('Some renaming failed','critical')
--------------------------------------------------------------------------------
/rename/rename-dash-to-underscore.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 | err = 0
32 |
33 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
34 | new_path = path.strip()
35 | new_path = new_path.replace('-','_')
36 | command = f' mv "{path}" "{new_path}"'
37 |
38 | res = run_command(command)
39 | if res == 0:
40 | pass
41 | else:
42 | err = err + 1
43 |
44 | if err == 0:
45 | notify('All files renamed','normal')
46 | else:
47 | notify('Some renaming failed','critical')
--------------------------------------------------------------------------------
/rename/rename-space-to-dash.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 |
32 | err = 0
33 |
34 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
35 | new_path = path.strip()
36 | new_path = new_path.replace(' ','-')
37 |
38 | command = f' mv "{path}" "{new_path}"'
39 | res = run_command(command)
40 | if res == 0:
41 | pass
42 | else:
43 | err = err + 1
44 |
45 | if err == 0:
46 | notify('All files renamed','normal')
47 | else:
48 | notify('Some renaming failed','critical')
--------------------------------------------------------------------------------
/rename/rename-space-to-underscore.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 |
32 | err = 0
33 |
34 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
35 | new_path = path.strip()
36 | new_path = new_path.replace(' ','_')
37 |
38 | command = f' mv "{path}" "{new_path}"'
39 | res = run_command(command)
40 | if res == 0:
41 | pass
42 | else:
43 | err = err + 1
44 |
45 | if err == 0:
46 | notify('All files renamed','normal')
47 | else:
48 | notify('Some renaming failed','critical')
49 |
--------------------------------------------------------------------------------
/rename/rename-underscore-to-dash.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 |
32 | err = 0
33 |
34 |
35 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
36 | new_path = path.strip()
37 | new_path = new_path.replace('_','-')
38 |
39 | command = f' mv "{path}" "{new_path}"'
40 | res = run_command(command)
41 | if res == 0:
42 | pass
43 | else:
44 | err = err + 1
45 |
46 | if err == 0:
47 | notify('All files renamed','normal')
48 | else:
49 | notify('Some renaming failed','critical')
50 |
--------------------------------------------------------------------------------
/rename/rename-underscore-to-space.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3
2 |
3 | import os
4 | import subprocess
5 |
6 | def run_command(command):
7 | ret = 0
8 | try:
9 | out = subprocess.Popen(command, shell=True,
10 | stdout=subprocess.PIPE,
11 | stderr=subprocess.PIPE)
12 | print(command)
13 | stdout, stderr = out.communicate()
14 |
15 | if stdout:
16 | ret = 0 # when no output checking is not necessary
17 | elif stderr:
18 | ret = 1
19 | except:
20 | return -1
21 | return ret
22 |
23 |
24 | def notify(msg,level):
25 | try:
26 | command = f'notify-send -u {level} -t 2000 "NaughtyLust" "{msg}"'
27 | subprocess.Popen(command,shell=True)
28 | except:
29 | pass
30 |
31 |
32 | err = 0
33 |
34 | for path in os.getenv('NAUTILUS_SCRIPT_SELECTED_FILE_PATHS','').splitlines():
35 | new_path = path.strip()
36 | new_path = new_path.replace('_',' ')
37 |
38 | command = f' mv "{path}" "{new_path}"'
39 | res = run_command(command)
40 | if res == 0:
41 | pass
42 | else:
43 | err = err + 1
44 |
45 | if err == 0:
46 | notify('All files renamed','normal')
47 | else:
48 | notify('Some renaming failed','critical')
49 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------