Commit graph

717 commits

Author SHA1 Message Date
Mike Dalessio
5bec191d2e
Follow Type=Link standard desktop entries with drun (#1168)
* [DRun] Introduce data structure changes for Link desktop entries

From the [freedesktop spec][1]:

> This specification defines 3 types of desktop entries:
> Application (type 1), Link (type 2) and Directory (type 3). To allow
> the addition of new types in the future, implementations should
> ignore desktop entries with an unknown type.

This commit adds an enum to capture these types, and adds `type` to
DRunModeEntry.

  [1]: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

part of #1166

* [DRun] Sanity check Link entries and capture the URL

Note that we're introducing some logic that will differ depending on
the Desktop entry type (Application or Link). The logic is:

- if entry is Application type,
  - then Exec is required
  - and the value is saved in .exec
  - and drun_mode_result calls exec_cmd_entry
- if entry is Link type,
  - then URL is required (but is not saved in the DRunModeEntry)
  - and drun_mode_result calls new function launch_link_entry

part of #1166

* [DRun] Launch desktop links via xdg-open

Note that this introduces a new dependency on xdg-open, which may not
be installed. In that case, rofi will display an error dialog
with something like:

  "Failed to execute child process xdg-open (No such file or directory)"

which hopefully is explanatory enough for folks.

part of #1166

* Make drun options comments consistent and add a bit of whitespace

* [DRun] new config option drun-url-launcher for opening links

In previous commit, this was a hard-coded string.

part of #1166
2020-08-26 21:10:04 +02:00
nick87720z
57ee69367d
micro-refactoring: widget.c (#1148)
* widget.c: microrefactoring

* widget.c: join enable/disable functions
2020-07-11 14:48:58 +02:00
nick87720z
fb2ba8ada3
Millimeter support for distance (#1144) 2020-06-09 22:19:43 +02:00
Dave Davenport
1342b733af [Script] Add 'info' row option, that gets passed to ROFI_INFO environment. 2020-05-24 19:10:49 +02:00
Jason Kim
a4c5a92199
Support rasi config character type options (#1131)
* style: remove extra space

* feat: handle xrm_Char in config parser

Handle the `xrm_Char` case in the (rasi theme) config file parser.  This
should properly handle configuration like

```
matching-negate-char: "\0";
```

and

```
matching-negate-char: "-";
```

* refactor: don't handle mem in xrm_Char case

`mem` shouldn't ever be set when `XrmOption` is `type` `xrm_Char`.
Therefore, there is no need to check it and free it.  Remove that logic.

* refactor: further condense logic

* style: s/Everythin/Everything/

* style: s/parsing an section/parsing a section/

...and missing period.

* feat(lexer): add CHAR token

Add a `CHAR` token that takes things of the form `'<char>'` or some
specific backslash escape sequences like `'\''` and `'\0'`.  For now,
save it as a `T_STRING`.

* refactor: define char property type

* feat(parser): add cval and T_CHAR

* refactor: use char property for xrm_Char

Instead of using strings for property elements of type char, use
characters, which were recently added to the grammar.
2020-05-17 14:50:38 +02:00
Dave Davenport
f2b6cf6b3c [Widget] Propaget set_state to children. 2020-05-13 16:25:12 +02:00
Dave Davenport
2ccc65ff52 Add some ui benchmark code 2020-05-12 10:40:50 +02:00
Dave Davenport
151547a99e
[Themes] add calc() support to distance in theme format. (#1105)
* Initial test to allow math in distances.

Support + and -
Needs spaces around + and -.

* [THEME] Fix printing theme with math in distance.

* [Theme] use calc() syntax.

* [Theme] Add * and /  to calc().

* [Theme] Fix the precedense ordering in parsing. Also avoid making copies.

* [Theme] Don't print unneeded ().

* [Theme] Add modulo to calc.
2020-04-24 19:54:08 +02:00
Dave Davenport
3e64e4422d [DMenu] Implement -keep-right
Fixes: #1089
2020-04-16 23:31:43 +02:00
Dave Davenport
f63da72ea6 [Dmenu] Fix possible crash.
Don't pass empty string.

Issue: #1083
2020-04-06 23:31:45 +02:00
Dave Davenport
7dcc3f450c Add option to make entry non-selectable in dmenu/script.
Fixes: #1024
2020-02-02 14:21:29 +01:00
Dave Davenport
b169289996 Indent all the code. 2020-02-02 13:56:37 +01:00
Jeff
83c2e467d5
Add support for additional field on script entries meta (#1052)
* Add test for hidden meta data in script mode

The purpose of this is to provide support for "hidden" fields on a
script item that work for search but don't get displayed.  This is
mostly to provide something similar to the optional display (but still
matchable) fields in drun like "categories" or "keywords".  This also
enables the choice to display unicode icons but still allow for
searching for the keywords without needing to print them.

* Ignore the output file from test runs

* Add support for the "meta" field on script entries

This fields provides a matchable but unprinted string for entries in a
script mode list match.  This means you can use one thing but provide
multiple options that can match that item without polluting the list
view or make confusing output.

* Add new test to test suite file
2020-02-01 13:49:11 +01:00
Dave Davenport
a35a898816 [DRun] Add desktop cache
Add a desktop cache file. Usable for system with slow filesystems.

* -drun-use-desktop-cache
* -drun-reload-desktop-cache

Fixes: #1040
2020-01-26 12:47:04 +01:00
Dave Davenport
b44b5e8d16 Add -upgrade-config option.
* Print warning when old-style configuration is used.
* Add -upgrade-config option.
2020-01-02 12:00:44 +01:00
Dave Davenport
b03edc5cf3 Update copyright dates. 2020-01-01 12:23:12 +01:00
Dave Davenport
f3bb043df0 [Textbox] Add placeholder.
Fixes: #1020
2019-12-26 14:24:10 +01:00
Dave Davenport
c1378e4c60 [View] Add two widgets num-rows/num-filtered-rows
Issue: #1026
2019-11-07 11:49:45 +01:00
Dave Davenport
aeecf34c27 [Window] Add thumbnail of windows as option. 2019-10-17 21:19:19 +02:00
Dave Davenport
8590a7ccf2 [CI] Fixing some more doxygen warnings. 2019-09-30 10:57:23 +02:00
Dave Davenport
0a0556c765 [CI] Update missing documentation. 2019-09-30 10:35:12 +02:00
Dave Davenport
8d9e403659 Update copyright. 2019-09-27 11:58:32 +02:00
Dave Davenport
7c613f6a4c
Issue893: Add support for @media in the theme format. (#1015)
* [Lexer] Add support for @media.

Issue: #893

* [Theme] @media limit to px.

* [Theme@Media] add *{} support.

* [Theme@Media] Add support for monitor-id media.

* [Theme@Media] Code cleanup.

* [Theme@Media] Add min/max-aspect-ratio.

* [Theme@Media] Remove some debug output

Fixes: #893
2019-09-20 15:05:36 +02:00
Dave Davenport
85279323e6 Set window title based on mode name.
For dmenu allow customize with `-window-title`.

Fixes: #969
2019-08-10 12:02:49 +02:00
Dave Davenport
f896146217 [DRUN] Add option to only show desktop files in certain categories
closes: #817
2019-08-09 19:33:23 +02:00
Dave Davenport
618d1396ee
Issue949 (#999)
* [Issue 949] Add initial split of listview row into widget tree.

Allowing better themeing.

* Remove unneeded code from textbox. allow dis. icons.

* Fix typo.

* Fix wrong widget offset in textbox.

* Fix mouse handling

* [ListView] Add 'fixed-columns' boolean option.

* [Listview] Fix inversion of option.

* [ListView] remove commented old code.

* [Textbox] Handle null pointer on desired width.

* [Listview] Fix crasher with fixed_columns and more max elements requested items.

* Add hack to get backwards compatibility for new listview structure.

* Fix the scrollbar test.

* Fix tests for theme update..
2019-08-08 20:02:20 +02:00
Kenneth Ho
be21fbae5d add pythonic rows selection to -a and -u (#985) 2019-07-02 21:27:46 +02:00
Dave Davenport
c4ce4df5e8 Fix more links from DaveDavenport -> davatorium 2019-05-14 11:52:21 +02:00
Dave Davenport
eb0e132bcc
[Timings] Move into new debug system. (#961)
* [Timings] Move into new debug system.

* [Timings] Remove newlines.
2019-05-11 20:57:18 +02:00
Dave Davenport
52c5592a6f [ListView|Textbox] Add user-settable ellipsize mode.
Fixes: #917
2019-05-04 11:04:54 +02:00
Dave Davenport
29c83b3623 [DmenuScript] Add missing header file. 2019-04-03 12:18:50 +02:00
Dave Davenport
6fffe427c4 Change sidebar in theme to mode-switcher.
Fixes: #930
2019-03-19 22:45:10 +01:00
Dave Davenport
52204a527c Add option to change location of cache dir.
-cache-dir

Fixes: #769
2019-02-08 20:43:53 +01:00
Dave Davenport
40da1b25e2 [Theme3.0] Change reference to use the CSS like var() syntax.
Supports defaults var(name, default); var(name);
Where default can be another property.
(https://www.w3schools.com/css/css3_variables.asp)

This deprecates the @name syntax.

Fixes: #876
2019-01-29 17:56:45 +01:00
Yoav
238648b5b2 Add history ignore (#846) 2018-12-31 00:35:00 +01:00
Dave Davenport
6b96ae123b Add an option to change the matching negation character.
Fixes: #877
2018-12-14 16:58:26 +01:00
Dave Davenport
76ceac1f20 [DRUN] Add drun-display-format. 2018-10-17 23:02:50 +02:00
Dave Davenport
e8edc42f9d [Helper] Quick and dirty string replacer with optional keys block.
First (quick and dirty) version of a more advanced key replacer where
sets of text are only outputted if the contained key matches.
2018-10-16 21:01:45 +02:00
Lukas Alexandre
6830e5d117 Fixing typos in docs and error messages, "numger" -> "number" (#867) 2018-10-14 16:57:52 +02:00
Dave Davenport
859a9c79d6 Indent the code. 2018-08-08 15:55:13 +02:00
Dave Davenport
4538303be6 [DRUN] Add option to show actions in drun.
Fixes: #836
2018-07-28 11:12:11 +02:00
Dave Davenport
e4d823774c Export icon fetcher header, remove nxd from icon-fetcher header. 2018-07-14 18:05:34 +02:00
Dave Davenport
bdb6abef4a
Sorting cleanup (#816)
* Add `-sorting-method` option remove weird -sort-levenshtein.

* Fix test for updated cmdline options.

* Update manpage
2018-06-13 11:57:23 +02:00
Dave Davenport
d2576e9f1f More source code documentation updates 2018-06-12 12:31:34 +02:00
Dave Davenport
32b45c2d10 Fix documentation
* theme
* view
* textbox
2018-06-12 12:16:33 +02:00
Dave Davenport
b8592f8b99 Documentation updates.
* theme,
* view,
* textbox
* helper
2018-06-12 12:00:00 +02:00
Dave Davenport
c856c1a8ab [Widget::Icon] Fix doxygen documentation in header file. 2018-06-12 11:28:31 +02:00
Dave Davenport
75811fd5a5 [IconFetcher] Add some doxygen documentation 2018-06-12 11:10:46 +02:00
Dave Davenport
53ccfd37ce Fix documentation error in icon widget header file. 2018-06-12 10:24:18 +02:00
Dave Davenport
0633bc9dad Remove (unused) widget ref counting. 2018-06-12 10:08:29 +02:00