/desktop

Extends Java && Golang with Desktop related functionality. This library allows you to get user specific directories functions (Home, Documents, Downloads) and Sys Tray Icon classes or power events.

Primary LanguageJavaGNU Lesser General Public License v3.0LGPL-3.0

Desktop

Java && Go Desktop functions. Have you tried to find user default Download folder using java? It is very complicated. If so, you would find this library very helpful.

Using this library you can use Java or Go language to write a desktop applications and services, without a restriction to be console only or limited Swing/AWT application.

Script nature of Java or Go now not limited by system programming working with sockets and system files. But extened to desktop features like working with user desktop objects. Now you can write a http server which have status systray icon and can download a file into Download folder without hacking.

Go check Java Docs or Go Docs

Features

  • Cross platform user specific folders: Download folder, Home folder, Documents folder, etc ...
  • Cross platform SysTray Icon
  • Cross platform Open Browser URL
  • Cross platform Browser Pop SysTray Window
  • Cross platform Power Events (control reboot, logout, suspend)
  • Register URL handlers (open an application from a browser)
  • Sound and Volume control

Example Desktop Folders

Java:

package com.github.axet.desktop;

public class DesktopTest {
    public static void main(String[] args) {
        System.out.println("Home: " + Desktop.getHomeFolder());
        System.out.println("Documents: " + Desktop.getDocumentsFolder());
        System.out.println("AppFolder: " + Desktop.getAppDataFolder());
        System.out.println("Desktop: " + Desktop.getDesktopFolder());
        System.out.println("Downloads: " + Desktop.getDownloadsFolder());
    }
}

Go:

package main

import (
  "github.com/axet/desktop/go"
)

func main() {
  fmt.Println("Home:", desktop.GetHomeFolder())
  fmt.Println("Documents:" desktop.GetDocumentsFolder())
  fmt.Println("AppFolder:" desktop.GetAppDataFolder())
  fmt.Println("Desktop:" desktop.GetDesktopFolder())
  fmt.Println("Downloads:" desktop.GetDownloadsFolder())
}