Rofication icon indicating copy to clipboard operation
Rofication copied to clipboard

Provide install guidance

Open windowsrefund opened this issue 1 year ago • 2 comments

How is this installed?

windowsrefund avatar Jun 03 '23 05:06 windowsrefund

I'm not sure, but if you want to try it out it ships with Regolith Desktop which has i3xrocks. Because of that it will also work with i3blocks (as stated in the read.me which I totally read before posting this) with some tweaking but I haven't tested that.

As far as compiling and installing I don't know, but I'd look at the aforementioned project for tips.

Scary-Guy avatar Dec 05 '23 15:12 Scary-Guy

Using Rofication with i3

Follow these steps to integrate Rofication into the i3 window manager:

Step 1: Install Py3status

Start by installing py3status, which will manage notifications in the status bar:

sudo apt install py3status

Step 2: Create a Custom Py3status Module

Create the file ~/.config/i3status/py3status/rofication.py with the following content:

# -*- coding: utf-8 -*-
"""
Module to display the number of notifications in the Rofication message queue.
"""
import subprocess
import re

class Py3status:

    def rofication(self):
        # Execute the rofication-status command to retrieve notifications
        try:
            output = subprocess.check_output(['rofication-status'], universal_newlines=True)
        except subprocess.CalledProcessError as e:
            return {
                'full_text': 'Error fetching notifications',
            }

        # Extract the number of notifications using a regular expression
        match = re.search(r'(\d+)\s*</span>', output)
        if match:
            notifications_count = match.group(1)
        else:
            notifications_count = '?'  # Default to '?' if no notifications are found

        return {
            'full_text': f'💡{notifications_count}',
        }

Step 3: Install Rofication

Next, install Rofication using apt:

sudo apt install i3xrocks-rofication regolith-rofication regolith-wm-rofication-ilia

Step 4: Configure Py3status

In your i3status configuration file (~/.config/i3status/config), add the Rofication module:

order += "rofication"

Step 5: Configure i3

Open your i3 config file (~/.config/i3/config) and add the following lines:

#------------------------------------------------------------------------------
# Setup notification system using Rofication
#------------------------------------------------------------------------------
# Start the Rofication daemon
exec --no-startup-id sh -c "rofication-daemon"
# Keybinding to launch the Rofication GUI
bindsym $mod+n exec rofication-gui

# Use Py3status for the status bar
bar {
    status_command py3status -c $HOME/.config/i3status/config
}

Step 6: Reload the i3 Configuration

Reload your i3 configuration to apply the changes. You can do this by running:

i3-msg reload

Step 7: Test the Setup

Finally, test if everything is working by sending a test notification:

notify-send "Test Message"

newptcai avatar Sep 25 '24 05:09 newptcai

Thank you

windowsrefund avatar Oct 05 '24 18:10 windowsrefund