From 7cf048eb7c49d884479c904bf898bcd97cf8b809 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 21 Sep 2024 05:03:42 +0300 Subject: [PATCH] More robust IntelliJ launcher --- doc/index.html | 294 ---------------------------------- install | 4 + tools/open with IntelliJ IDEA | 60 +++++-- 3 files changed, 52 insertions(+), 306 deletions(-) delete mode 100644 doc/index.html diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index f51a06a..0000000 --- a/doc/index.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - -Emacs Org Mode support for java - - - - - - - -
-

Emacs Org Mode support for java

-
-

Table of Contents

- -
- -
-

1 General

-
- -
- -
-

1.1 Source code

-
- -
-
-
-
-

2 Current status

-
-
    -
  • work in progress
  • - -
  • Partially implemented functionality: -
      -
    • Parse Org documents into object model
    • -
    • Generate markdown documents from object model
    • -
  • -
-
-
-
-
-

Author: Svjatoslav Agejenko

-

Created: 2021-07-25 Sun 20:53

-

Validate

-
- - diff --git a/install b/install index 66a9d48..5f14df2 100755 --- a/install +++ b/install @@ -1,10 +1,14 @@ #!/bin/bash +# Build the jar mvn clean mvn package +# Install the jar in /opt/j-org-support sudo mkdir /opt/j-org-support sudo rm /opt/j-org-support/j-org-support.jar sudo cp target/*-jar-with-dependencies.jar /opt/j-org-support/j-org-support.jar + +# Install the launcher script sudo cp org2md /opt/j-org-support/ sudo ln -s /opt/j-org-support/org2md /usr/bin/ diff --git a/tools/open with IntelliJ IDEA b/tools/open with IntelliJ IDEA index de9bae5..304bf94 100755 --- a/tools/open with IntelliJ IDEA +++ b/tools/open with IntelliJ IDEA @@ -1,18 +1,54 @@ #!/bin/bash -# -# This is a helper bash script that starts IntelliJ with the current project. -# Script is written is such a way that you can simply click on it in file -# navigator to run it. -# -# -# Script assumes: -# -# + GNU operating system -# + IntelliJ is installed and commandline launcher "idea" is enabled. -# +# This script launches IntelliJ IDEA with the current project +# directory. The script is designed to be run by double-clicking it in +# the GNOME Nautilus file manager. + +# First, we change the current working directory to the directory of +# the script. + +# "${0%/*}" gives us the path of the script itself, without the +# script's filename. + +# This command basically tells the system "change the current +# directory to the directory containing this script". cd "${0%/*}" + +# Then, we move up one directory level. +# The ".." tells the system to go to the parent directory of the current directory. +# This is done because we assume that the project directory is one level up from the script. cd .. -setsid idea . &>/dev/null +# Now, we use the 'setsid' command to start a new session and run +# IntelliJ IDEA in the background. 'setsid' is a UNIX command that +# runs a program in a new session. + +# The command 'idea .' opens IntelliJ IDEA with the current directory +# as the project directory. The '&' at the end is a UNIX command that +# runs the process in the background. The '> /dev/null' part tells +# the system to redirect all output (both stdout and stderr, denoted +# by '&') that would normally go to the terminal to go to /dev/null +# instead, which is a special file that discards all data written to +# it. + +setsid idea . &>/dev/null & + +# The 'disown' command is a shell built-in that removes a shell job +# from the shell's active list. Therefore, the shell will not send a +# SIGHUP to this particular job when the shell session is terminated. + +# '-h' option specifies that if the shell receives a SIGHUP, it also +# doesn't send a SIGHUP to the job. + +# '$!' is a shell special parameter that expands to the process ID of +# the most recent background job. +disown -h $! + + +sleep 2 + +# Finally, we use the 'exit' command to terminate the shell script. +# This command tells the system to close the terminal window after +# IntelliJ IDEA has been opened. +exit -- 2.20.1