Skip to content

Commit 53a3c56

Browse files
committed
only enable desktop generation by default on linux
1 parent 5e08be6 commit 53a3c56

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

qbpm.1.scd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ appropriate \--basedir, or more conveniently using the qbpm launch and qbpm choo
3838

3939
*new* [options] <profile> [<url>]
4040
Create a new qutebrowser profile named _profile_. If _url_ is present it will
41-
be used as the profile's home page. By default, a .desktop file will be
42-
created for the profile in $XDG_DATA_HOME/applications/qbpm/.
41+
be used as the profile's home page.
4342

4443
Options:
4544

@@ -50,12 +49,14 @@ appropriate \--basedir, or more conveniently using the qbpm launch and qbpm choo
5049
If --launch is set, run qutebrowser in the foreground.
5150

5251
*--no-desktop-file*
53-
Do not generate a .desktop file for the profile.
52+
Do not generate an XDG desktop entry for the profile. Always true on
53+
non-linux systems. See https://wiki.archlinux.org/title/Desktop_entries
54+
for information on desktop entries.
5455

5556
*--overwrite*
5657
By default qbpm will refuse to create a profile if one with the same name
57-
already exists. --overwrite disables this check and rewrites the existing
58-
profile's configuration files from scratch. Profile data is left untouched.
58+
already exists. --overwrite disables this check and replaces the existing
59+
profile's configuration files. Profile data is left untouched.
5960

6061
*launch* [options] <profile> [argument...]
6162
Start qutebrowser with --basedir set to the location of _profile_. All
@@ -106,7 +107,7 @@ appropriate \--basedir, or more conveniently using the qbpm launch and qbpm choo
106107
*new*.
107108

108109
*desktop* <profile>
109-
Generate a .desktop file for _profile_.
110+
Generate an XDG desktop entry for _profile_.
110111

111112
*edit* <profile>
112113
Open _profile_'s config.py in your default editor.

src/qbpm/desktop.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33
from typing import Optional
44

5-
from xdg_base_dirs import xdg_data_dirs, xdg_data_home
5+
from xdg_base_dirs import xdg_data_home
66

77
from . import Profile
88

@@ -21,7 +21,6 @@
2121
]
2222

2323

24-
# TODO disable when not on linux?
2524
# TODO expose application_dir through config
2625
def create_desktop_file(
2726
profile: Profile, application_dir: Optional[Path] = None

src/qbpm/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def desktop(
176176
context: Context,
177177
profile_name: str,
178178
) -> None:
179-
"""Create a desktop file for an existing profile."""
179+
"""Create an XDG desktop file for an existing profile."""
180180
profile = Profile(profile_name, **vars(context))
181181
exit_with(operations.desktop(profile))
182182

src/qbpm/profiles.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from functools import partial
22
from pathlib import Path
3+
from sys import platform
34
from typing import Optional
45

56
from . import Profile
@@ -68,15 +69,15 @@ def new_profile(
6869
profile: Profile,
6970
qb_config_dir: Optional[Path],
7071
home_page: Optional[str] = None,
71-
desktop_file: bool = True,
72+
desktop_file: Optional[bool] = None,
7273
overwrite: bool = False,
7374
) -> bool:
7475
qb_config_dir = resolve_qb_config_dir(qb_config_dir)
7576
if not qb_config_dir:
7677
return False
7778
if create_profile(profile, overwrite):
7879
create_config(profile, qb_config_dir, home_page, overwrite)
79-
if desktop_file:
80+
if desktop_file is True or (desktop_file is not False and platform == "linux"):
8081
create_desktop_file(profile)
8182
return True
8283
return False

0 commit comments

Comments
 (0)