Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A quick rewrite of the README, hope this can help #1

Merged
merged 7 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# Notifications Monitor

Monitorize your notifications and get a temporary list of the notifications.
Monitor your notifications and get a temporary list of the notifications.

![demonstration](./misc/demonstration.png)

## Dependencies
- Node.js (to run the program; by default, the package will be installed using
npm or yarn)
- dbus-next : https://github.com/dbusjs/node-dbus-next
The dbus library for node. If you're using yarn or npm, it will be added during
the installation of this package.

## Installation

You can install this using this commands:
You can install this using these commands:

```sh
git clone https://github.com/AlphaTechnolog/notifications-monitor.git notifications-monitor
git clone https://github.com/AlphaTechnolog/notification-monitor.git notifications-monitor
cd notifications-monitor
./bin/install.sh
```

> Give sudo password if is necesary
> You might need to provide the root password for installation

## Usage

Expand All @@ -24,11 +31,11 @@ First in a terminal start the daemon with the `notifmonitord` launcher (it's aut
notifmonitord &
```

> If VERBOSE config variable is true, it can't be executed in background :v
> If the VERBOSE config variable is true, the daemon can't be executed in the background :v

> VERBOSE by default is false, to change it, modify the file `notifications-monitor/src/daemon/index.js` and then reinstall
> VERBOSE is false by default. To change it, modify the file `notifications-monitor/src/daemon/index.js` and then reinstall

In a second terminal, you can get the details of the notifications using the `remote-notifmonitor` launcher, that are autoinstalled too:
In a second terminal, you can get the details of the notifications using the `remote-notifmonitor` launcher, that is autoinstalled too:

### Get help

Expand All @@ -46,4 +53,4 @@ remote-notifmonitor get-notifications

```sh
remote-notifmonitor check-toread
```
```
83 changes: 55 additions & 28 deletions bin/install.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,58 @@
#!/bin/bash

echo "Using sudo for some actions, please give the password"\

if test -d /opt/notifications-monitor; then
echo "Already exists another installation of notifications-monitor in /opt/notifications-monitor, removing to reinstall..."
sudo rm -rf /opt/notifications-monitor
fi

if test -f /usr/bin/remote-notifmonitor; then
echo "Removing launcher remote-notifmonitor"
sudo rm /usr/bin/remote-notifmonitor
fi

if test -f /usr/bin/notifmonitord; then
echo "Removing launcher notifmonitord"
sudo rm /usr/bin/notifmonitord
ROOTUID="0"

if [ "$(id -u)" -eq "$ROOTUID" ] ; then
if test -d /opt/notifications-monitor; then
echo "Already exists another installation of notifications-monitor in /opt/notifications-monitor, removing to reinstall..."
rm -rf /opt/notifications-monitor
fi

if test -f /usr/bin/remote-notifmonitor; then
echo "Removing launcher remote-notifmonitor"
rm /usr/bin/remote-notifmonitor
fi

if test -f /usr/bin/notifmonitord; then
echo "Removing launcher notifmonitord"
rm /usr/bin/notifmonitord
fi

cd $(dirname $0)/../

echo "Copying source code"
mkdir -p /opt/notifications-monitor
cp -r ./* /opt/notifications-monitor

echo "Installing dependancies ..."
cd /opt/notifications-monitor
if command -v yarn; then
yarn install
elif command -v npm; then
npm install
else
echo "The source code was copied to /opt, but we can't use your node package manager."
echo "Please install the package manually."
echo "The lauchers will be created anyway, but might not be functionnal until you install the dependencies"
fi


echo "Creating launchers"
cp -r /opt/notifications-monitor/bin/launchers/* /usr/bin
chmod +x /usr/bin/{notifmonitord,remote-notifmonitor}

echo "Giving permissions to your user"
chown -R $(whoami):$(whoami) /opt/notifications-monitor

else # No root access, tries again
echo "This script needs root access to proceed to the installation."
if command -v sudo; then
echo "Running with sudo, please enter your password :"
sudo "${BASH_SOURCE}"
elif command -v doas; then
echo "Running with doas, please enter your password :"
doas "${BASH_SOURCE}"
else
echo "Please run the script with a sudo-like utility or with root."
fi
fi

cd $(dirname $0)/../

echo "Copying source code"
sudo mkdir -p /opt/notifications-monitor
sudo cp -r ./* /opt/notifications-monitor

echo "Creating launchers"
sudo cp -r /opt/notifications-monitor/bin/launchers/* /usr/bin
sudo chmod +x /usr/bin/{notifmonitord,remote-notifmonitor}

echo "Giving permissions to your user"
sudo chown -R $(whoami):$(whoami) /opt/notifications-monitor
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"client": "node ./src/client/index.js"
},
"dependencies": {
"dbus-next": "^0.10.2"
"dbus-next": "^0.10.2",
"debug" : "*"
}
}