Skip to content

Commit

Permalink
Rename all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Apr 18, 2016
1 parent 011cbc9 commit 2548f43
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,39 +119,39 @@ catch (IniLikeException e) { //Parsing error - file is not desktop file or has e

## Examples

### [Desktop util](examples/desktoputil/source/app.d)
### [Desktop util](examples/util/source/app.d)

Utility that can parse, execute and rewrites .desktop files.

This will start vlc with the first parameter set to $HOME/Music:

dub run :desktoputil -- exec /usr/share/applications/vlc.desktop $HOME/Music
dub run :util -- exec /usr/share/applications/vlc.desktop $HOME/Music

This should start command line application in terminal emulator (will be detected automatically):

dub run :desktoputil -- exec /usr/share/applications/python2.7.desktop
dub run :util -- exec /usr/share/applications/python2.7.desktop

Additional application actions are supported too:

dub run :desktoputil -- exec /usr/share/applications/steam.desktop --action=Settings
dub run :util -- exec /usr/share/applications/steam.desktop --action=Settings

Open link with preferred application:

dub run :desktoputil -- link /usr/share/desktop-base/debian-homepage.desktop
dub run :util -- link /usr/share/desktop-base/debian-homepage.desktop

Starts .desktop file defined executable or opens link:

dub run :desktoputil -- start /path/to/file.desktop
dub run :util -- start /path/to/file.desktop

Parse and write .desktop file to new location (to testing purposes):

dub run :desktoputil -- write /usr/share/applications/vlc.desktop $HOME/Desktop/vlc.desktop
dub run :util -- write /usr/share/applications/vlc.desktop $HOME/Desktop/vlc.desktop

Read basic information about desktop file:

dub run :desktoputil -- read /usr/share/applications/kde4/kate.desktop
dub run :util -- read /usr/share/applications/kde4/kate.desktop

### [Desktop test](examples/desktoptest/source/app.d)
### [Desktop test](examples/test/source/app.d)

Parses all .desktop files in system's applications paths (usually /usr/local/share/applicatons and /usr/share/applications) and on the user's Desktop.
Writes errors (if any) to stderr.
Expand All @@ -172,9 +172,9 @@ Example using cmd on Windows (KDE installed):
set KDE_SHARE="%SYSTEMDRIVE%\ProgramData\KDE\share"
dub run :test -- %KDE_SHARE%\applications %KDE_SHARE%\templates %KDE_SHARE%\desktop-directories %KDE_SHARE%\autostart

### [Shoot desktop file](examples/shootdesktop/source/app.d)
### [Shoot desktop file](examples/shoot/source/app.d)

Uses the alternative way of starting desktop file. Instead of constructing DesktopFile object it just starts the application or opens link after read enough information from file.

dub run :shootdesktop -- $HOME/Desktop/vlc.desktop
dub run :shootdesktop -- /usr/share/applications/python2.7.desktop
dub run :shoot -- $HOME/Desktop/vlc.desktop
dub run :shoot -- /usr/share/applications/python2.7.desktop
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"targetPath" : "lib",
"targetType" : "library",

"subPackages" : ["./examples/test", "./examples/desktoputil", "./examples/shootdesktop"]
"subPackages" : ["./examples/test", "./examples/util", "./examples/shoot"]
}
File renamed without changes.
5 changes: 2 additions & 3 deletions examples/desktoputil/dub.json → examples/shoot/dub.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "desktoputil",
"name": "shoot",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, freeslave",
"authors": ["freeslave"],
"dependencies": {
"desktopfile" : "*"
},
"targetPath" : "bin",
"targetType" : "executable",
"targetName" : "desktoputil",
"targetType" : "executable"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions examples/shootdesktop/dub.json → examples/util/dub.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "shootdesktop",
"name": "util",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, freeslave",
"authors": ["freeslave"],
"dependencies": {
"desktopfile" : "*"
},
"targetPath" : "bin",
"targetType" : "executable",
"targetName" : "shootdesktop",
"targetType" : "executable"
}
File renamed without changes.
File renamed without changes.

0 comments on commit 2548f43

Please sign in to comment.