[solved] pop-up notifications (dunst, lemonbar, i3)

Forum rules
We don't support installations in VirtualBox, VMWare, qemu or others. We ignore posts about WINE, PlayOnLinux, Steam and Skype. We don't support btrfs, lvm, UEFI, side-by-side installations with GPT or dualboot with anything newer than Windows XP.
Google your problem first. Check the Wiki. Read the existing threads. It's okay to "hijack" an existing thread, yes! If your problem is not yet covered, open a new thread. To get the quickest possible help, mention the exact release codename in your post (uname -a is a good idea, too). Due to the lack of crystal balls, attach the output of lspci -nnk if you encounter hardware problems.
User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Thu Apr 23, 2015 11:46 am

Thank you for the explanation Jules.

Rho, here you go my friend. The popup with lemonbar is from z3bra. Absolutely brilliant. You cand find his blog post about it here. Also the volume display. Uses xbindkeys (or I guess could us sxhkd)

Work hard; Complain less

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Thu Apr 23, 2015 12:35 pm

you're right, just been reading, his stuff is great. thanks again!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Mon Apr 27, 2015 10:54 am

been looking at Lemonbar and have a question. is it true that when you work in tiler-mode with everything fullscreen (i3), the appearance of the lemonbar will always shift the other windows down instead of being an overlay?
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Mon Apr 27, 2015 11:05 am

no. If you are using the popup mode it will display on top. Even in herbstluftwm, which does not handle pop up windows as float. Actually, even if I'm running fs mode and reset my status bar, it will show on top of my fs window.

Now, disclaimer, I have not used i3 in a very long time, so my 'no' is based on my world. Test it out. It should work fine.

Work hard; Complain less

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Mon Apr 27, 2015 12:47 pm

sorry if i wasnt clear: i have tested it out, and was surprised to find my windows simply resize to make room for the bar instead of it floating over it. i couldn't find anything specific with i3 and lemonbar that might go wrong on Google... all i'm thinking is maybe a different compile option or i'm missing some sort of library or something? if anybody using i3 could chime in here maybe we can figure it out...
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Mon Apr 27, 2015 12:55 pm

Can you share the code and a scrot? Do a webm too if possible

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: dunst (on Bork!)

Unread post by machinebacon » Mon Apr 27, 2015 2:23 pm

Maybe paste your i3conf here, rhosey? :)
..gnutella..

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: dunst (on Bork!)

Unread post by stark » Mon Apr 27, 2015 4:52 pm

I remember by default i3 always automatically tiles floating clients unless you add window rules for them, for example I remember when I used to use xfce4-notifyd, it tiled unless i had a similar snippet in the i3config:

Code: Select all

for_window [class="xfce4-notify"] floating enable
Find the class of a specific window / program with `xprop` and add rules to your i3 config. Sometimes you may need to use window names or titles instead of their window class ( apologies, I don't remember everything clearly as I haven't used i3 in months )

So for lemonbar, you may need to add this to your i3config:

Code: Select all

for_window [window_role="pop-up"] floating enable
for_window [title="bar"] floating enable
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: dunst (on Bork!)

Unread post by wuxmedia » Mon Apr 27, 2015 7:04 pm

^ that looks about right.
Get the identifier by running xprop (in a term) on the offending window, then make a rule maybe.
google hangouts chrome app is fucking terrible on i3. sort of ok once it's 'popped out' and part of the container.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Mon Apr 27, 2015 8:54 pm

okay, thanks for those tips guys, will look into that probably later tonight and will post the config.
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Mon Apr 27, 2015 10:16 pm

right, had a look, didn't manage to get it to work yet despite stark's tips.

here's some files.

Code: Select all

#!/bin/sh

# how long should the popup remain?
duration=3

# define geometry
barx=20
bary=20
barw=120
barh=20

# colors
bar_bg='pink'
bar_fg='#ffffff' # white is default

# font used
bar_font='-*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1'

# compute all this
baropt='-g ${barw}x${barh}+${barx}+${bary} -B${bar_bg} -f ${bar_font}'

#Create the popup and make it live for 3 seconds
(echo " $@"; sleep ${duration}) | lemonbar ${baropt}
(bar_bg changed from hexcode to just "pink" as an attempt to fix complaints about colours not working)
here's the current terminal output of that script

Code: Select all

[01:13:14]$ ./popup.sh mehhhh
Invalid geometry specified
Could not allocate the color ""
Could not load font "${bar_font}"
so it might have something to do with the geometry. however, after looking over the manpage many times i still don't see why it would be wrong.

for other reference, here's my i3config

Code: Select all

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4
set $ws1 ⚪
set $ws2 ⚪⚪
set $ws3 ⚪⚪⚪
set $ws4 ⚪⚪⚪⚪
set $ws5 ⚪⚪⚪⚪⚪

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:Gelly 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# lemonbar
#for_window [window_role="pop-up"] floating enable
for_window [class="bar"] floating enable

# Remove titlebars
#for_window [class="^.*"] border pixel 3

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec rxvt-unicode

# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
bindsym $mod+space exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+q layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# laptopkeys
bindsym XF86AudioLowerVolume exec --no-startup-id /home/rhowaldt/.i3/scripts/volume -
bindsym XF86AudioRaiseVolume exec --no-startup-id /home/rhowaldt/.i3/scripts/volume +
bindsym XF86AudioMute exec $(amixer get Master | grep off > /dev/null && amixer -q set Master unmute) || amixer -q set Master mute
bindsym XF86MonBrightnessDown  exec  xbacklight -dec 10
bindsym XF86MonBrightnessUp  exec  xbacklight -inc 10
bindsym Print                  exec  scrot

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
	status_command 		~/.i3/i3status_custom
	tray_output			none
	font				pango:Jura Light 8   
}
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Tue Apr 28, 2015 1:40 am

The script needs some massaging. But we like massages, don't we? Try this

Code: Select all

#!/bin/bash

## time
duration=3

## geometry
barx=20
bary=20
barw=120
barh=20

## colours
bar_bg='#FFFF99CC'
bar_fg='#FFFFFFFF'

## font
font='-*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1'

baropt='-g '${barw}'x'${barh}'+'${barx}'+'${bary}' -B '${bar_bg}' -F '${bar_fg}' -f '${font}' '

(echo " $@"; sleep ${duration}) | bar ${baropt}
Now, let's test. Name it as you wish, place in your $PATH. For example

Code: Select all

popnotify "take that fucker"

Work hard; Complain less

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: dunst (on Bork!)

Unread post by stark » Tue Apr 28, 2015 8:36 am

@rho That rule must use "title" and not "class" ( lemonbar has no window class id according to xprop ). It's a hack and a very annoying one as if you open anything has the word bar in it's title ( say a file named "bar.sh" in geany or a webpage in a browser that has the word "bar" in the tab name ) then it will make geany or the specific program floating. See http://i3wm.org/docs/userguide.html#command_criteria

So change this:

Code: Select all

for_window [class="bar"] floating enable
To this:

Code: Select all

for_window [title="bar"] floating enable
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Tue Apr 28, 2015 8:49 am

thanks for the help guys. it now doesnt complain about the geometry anymore and is pink indeed, but still shifts my windows down when i try to use it, despite changing "class" to "title" (i tried that before btw, but didnt work. in my copy-paste it still showed the latest state of my experiment, with "class" there because i was just trying shit out to see if it would work)... not really sure where this is going wrong.

edit: also tried changing the i3 mode to stacking and tabbed, same result. when i set the opened windows to float, it does work.
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: dunst (on Bork!)

Unread post by stark » Tue Apr 28, 2015 9:03 am

Weird indeed. That should've worked, it can be a bug ;) I'll look further into this.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Tue Apr 28, 2015 10:58 am

looks like its time to use [insert wm here] *cough* maybe herbstluftwm or monsterwm?

Work hard; Complain less

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Tue Apr 28, 2015 11:06 am

Oh! Add the -d option. But still consider the above options. If anything for comparison.

Code: Select all

baropt='-g '${barw}'x'${barh}'+'${barx}'+'${bary}' -d -B '${bar_bg}' -F '${bar_fg}' -f '${font}' '

Work hard; Complain less

User avatar
stark
MILF
Posts: 521
Joined: Sat Sep 27, 2014 6:38 pm
Location: Arpanet
Contact:

Re: dunst (on Bork!)

Unread post by stark » Tue Apr 28, 2015 5:04 pm

^ Oh forgot about "-d", that might work.
If you can do it go ahead and do it, if you can't do it then don't even criticize it. - gingerdesu

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: dunst (on Bork!)

Unread post by rhowaldt » Tue Apr 28, 2015 11:31 pm

OMG -b did the trick! and i tried some more, it seems it works without the i3config floating enable stuff... so we just learned i3 is not EWMH compliant, or something :)

thanks so much guys!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: dunst (on Bork!)

Unread post by dkeg » Wed Apr 29, 2015 12:24 am

excellent!

Work hard; Complain less

Post Reply