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

Create shortcuts in subdirectory #3019

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bottles/backend/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class Paths:
base = f"{xdg_data_home}/bottles"

# User applications path
applications = f"{xdg_data_home}/applications/"
applications = f"{xdg_data_home}/applications"
applications_bottles = f"{applications}/bottles/"

temp = f"{base}/temp"
runtimes = f"{base}/runtimes"
Expand Down
2 changes: 1 addition & 1 deletion bottles/backend/managers/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ def delete_bottle(self, config: BottleConfig) -> bool:
return False

logging.info(f"Removing applications installed with the bottle…")
for inst in glob(f"{Paths.applications}/{config.Name}--*"):
for inst in glob(f"{Paths.applications}/{config.Name}--*") + glob(f"{Paths.applications_bottles}/{config.Name}--*"):
os.remove(inst)

logging.info(f"Removing library entries associated with this bottle…")
Expand Down
6 changes: 4 additions & 2 deletions bottles/backend/utils/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def create_desktop_entry(config, program: dict, skip_icon: bool = False, custom_
use_xdp: bool = False) -> bool:
if not os.path.exists(Paths.applications) and not use_xdp:
return False
else:
os.makedirs(Paths.applications_bottles, exist_ok=True)

cmd_legacy = "bottles"
cmd_cli = "bottles-cli"
Expand All @@ -223,13 +225,13 @@ def create_desktop_entry(config, program: dict, skip_icon: bool = False, custom_
if not use_xdp:
file_name_template = "%s/%s--%s--%s.desktop"
existing_files = glob(file_name_template % (
Paths.applications,
Paths.applications_bottles,
config.Name,
program.get("name"),
"*"
))
desktop_file = file_name_template % (
Paths.applications,
Paths.applications_bottles,
config.Name,
program.get("name"),
datetime.now().timestamp()
Expand Down
1 change: 1 addition & 0 deletions com.usebottles.bottles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ finish-args:
- --socket=pulseaudio
- --device=all
- --filesystem=xdg-download
- --filesystem=xdg-data/applications/bottles:create
- --system-talk-name=org.freedesktop.UDisks2
- --env=LD_LIBRARY_PATH=/app/lib:/app/lib32
- --env=PATH=/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin/:/usr/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin/
Expand Down
Loading