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

Questions: when does openbox rc.xml.template got initialized and how to add a polybar entry #135

Open
eastpyne opened this issue Jul 13, 2024 · 2 comments

Comments

@eastpyne
Copy link

eastpyne commented Jul 13, 2024

I have a few questions that are not issues, but I am unsure where to ask them. Please let me know if this is not the appropriate place to open such queries. Appreciate your help in advance.

  1. I followed your example to add xterm as an app. How can I configure it to open maximized when the Docker container starts? I believe I need to add a statement to /opt/base/etc/openbox/main-window-selection.xml, but I am unsure which one. Could you please advise?

  2. I successfully added both polybar and xterm to the Docker container. How can I ensure both apps load at startup, so I have a taskbar and xterm running simultaneously? On a normal system, I would add exec polybar to /etc/xinitrc or ~/.xinitrc. What is the equivalent for the Docker setup?

@eastpyne
Copy link
Author

eastpyne commented Jul 15, 2024

Update to question 2:

I successfully added a service such as Polybar (learned and modified from the included openbox service). Here's how you can do it:

  1. Add Polybar to the Dockerfile:

    RUN add-pkg polybar  # This is equivalent to apk add --no-cache polybar
  2. Create Initialization Script:
    In rootfs/etc/cont-init.d/, add a file named 10-polybar.sh. This script will be executed by /init.sh, which is part of the jlesage/baseimage-gui.

    #!/bin/sh
    
    set -e  # Exit immediately if a command exits with a non-zero status.
    set -u  # Treat unset variables as an error.
    
    mkdir -p /var/run/polybar
    chown $USER_ID:$GROUP_ID /var/run/polybar
  3. Configure the Service:
    In rootfs/etc/service.d, create the following structure:

    rootfs/etc/service.d
    ├── gui
    │   └── polybar.dep
    ├── polybar
    │   ├── disabled
    │   ├── run
    │   └── xvnc.dep
    
    • The gui/polybar.dep file is necessary for Polybar to start.

    • In the run file:

      exec /usr/bin/polybar
    • In the disabled file:

      if is-bool-val-true "${BAR:-0}"; then
          echo "false"
      else
          echo "true"
      fi

By following these steps, you can add and configure Polybar as a service in your Docker environment.

@jlesage
Copy link
Owner

jlesage commented Jul 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants