joewing / jwm

Joe's Window Manager
http://joewing.net/projects/jwm
MIT License
517 stars 84 forks source link

Towards JDE ... jwm + desktop environment #389

Open technosaurus opened 7 years ago

technosaurus commented 7 years ago

Desktop Icons

Currently jwm can do pseudo desktop icons using trays and tray buttons, but they​ have formatting issues due to text widths vs icon widths since the icon cannot just be centered in the tray button and the varying text sizes would make the "icons" appear to have different offsets... not to mention lack of a "none" background color for tray/buttons.

I propose a new desk_icon as member of the Desktop tag (or global to be on all desktops) that has attributes for x and y offsets, icon widths/heights and various text attributes. These would be non-movable to prevent confusion since jwm currently has no way to modify it's config files or communicate with config generators.

Tray Applets

The current tray buttons can have all of the aspects of an applet with the exception of changing the icon.

I propose a new "autorefresh" attribute for icons to update the icon if it changes. I have used inotify for this on linux, bsd would use kqueue; however I think there are a few wrapper libs that can handle multiple platforms.

To account for changing tooltips I propose the option to read the tooltip text from a file on demand.

Notifications

With the autorefresh icons in place, notifications can be accomplished using tooltips

extra possibilities

ghost commented 7 years ago

@technosaurus I completely agree with this! The issue I like most is the ability to make tray buttons into indicators. The problem I see with that is that we would need a way to run external code to choose the icon... for example, if I make a volume indicator, how would I notify the icon to update when volume is changed? Likewise with a battery, or network indicator.

I also really like the idea of having some sort of way to use JWM's existing dialog functions (perhaps the menu functions/trays can be extended into the windows to be able to make XML based JWM dialogs... which would be really cool!)

Maybe @technosaurus will make a JWM filemanager which also handles e-mail :smile:

technosaurus commented 7 years ago

@Israel- I have already created a gtk based program called Simple Icon Tray that does this by running a tiny daemon process in the background to update the icon and tooltip. SIT uses gtkstatusicon which the idiot gtk3 devs removed in a random minor release, so its currently gtk2, but I have been meaning to port it to x11 or xcb if i could figure out what x11 hints are needed to get them to go in the dock (i could use jwm's swallow feature, but prefer something more portable) I already have the rest of the code written for my xcb image viewer and an early inotify based version of SIT, ... maybe @joewing can clue me in to what hints are needed.... I may even be able to extend it to handle desktop icons using transparent windows without title bars. Recently goingnuts ported my xcb image viewer to Xlib, so that could help.

ghost commented 7 years ago

@technosaurus I have used sit/sdesk, I actually packaged it for Ubuntu in a PPA, though I have not updated it in a while, mainly because the Icon had to be a file, rather than using the gtk_icon_theme_load_icon() I have since made a bash script using yad, as it provides dialogs as well as a status Icon. I even wrote a small program to indicate battery status back when libupower-glib/upower.h worked (pre systemd engulfing everything.... I feel your nice library changing everything to break pain)

I suppose a JWM specific way to create indicators would be very helpful. perhaps some inclusion in a traybutton.

<Traybutton ..... >
<Indicator>script-to-update-icon-and-menu</Indicator>
<Button><!-- whatever--></Button>
</Traybutton
technosaurus commented 7 years ago

for the icons, I was thinking autorefresh="true" with the default being false. the true value adds an inotify (or kqueue) watch to that icon and a change would trigger a reload+redraw of the icon ... except now jwm caches images, and I'm​ not sure how that would affect this. A similar thing could be done for tooltips if the string started with "file:/"

ghost commented 7 years ago

I have been adding some features to my settings manager recently thought about your idea for Desktop Icons. I think @technosaurus the best route would be to use the existing structure of the TrayButton but make it something like DesktopButton but add in something like you were saying x="int" y="int" So the configuration would be something like

<Desktops width="4" height="1" >
<!-- ALL DESKTOPS -->
  <Background type="image">/path/to/img.png</Background>
  <DesktopButton icon="browser" x="40" y="40" border="false">
    <Button mask="1">exec:xlinks2 -g</Button>
    <Button mask="23">root:p</Button>
  </DesktopButton>
  <Desktop name="home">
<!-- THIS desktop -->
    <DesktopButton icon="accessories-calculator" x="140" y="140" border="false">
      <Button mask="1">exec:xcalc</Button>
      <Button mask="23">root:p</Button>
    </DesktopButton>
    <Background type="image">/path/to/img-home.png</Background>
  </Desktop>
</Desktops>

I know this is pretty much what you were saying in the first place, my input is to visualize it and to bring in the possibility of reusing TrayButton code where possible

ghost commented 6 years ago

Yeah this would be nice.