I thought being enough accurate as my request is probably very simple for you.
I use i3 with I3bar with i3blocks. I would like to be able to have a floating window popup appearing when I click on a particular i3block, I would like this window to be stuck to the i3bar at the top with particular dimensions AND, I would like to be able to click on buttons on it that will perform some actions.
For example, I would like this popup to have lots of colors and when I click on one of it I want to perform a mqtt publication to change the color of one of my iot bulbs.
I know how to do floating windows with i3, but, after lots of researches, I don't think I can do clickable floating window with i3wm program.
I tried hard with dmenu, but it can not display more than 2 different colors in the dmenu bar as I would like to be able to click on a color zone (square, rectangle).
I looked at zenity, looks great, yad looks to do very good things, probably enough, I will figure out.
This would be very easy to write even just with X11, or you could use a toolkit like GTK
Is it that easy or overkill for the simple popup I want to do?
Hi teckk, I tried your code but got some errors, could you make it working well please, there is no import for MyWindow for example. If you do, I will give a try.
Is rofi better than dmenu?
Is dmenu-ee better in all ways of dmenu? Will I be able to do what I want with dmenu-ee?
Thanks for your time!
]]>You Need to be more specific with your demands.
]]>Very simple window/button example with tkinter.
#! /usr/bin/python
from tkinter import *
def donothing():
filewin = Toplevel(root)
button = Button(filewin, text="Do nothing button")
button.pack()
root = MyWindow()
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=donothing)
filemenu.add_command(label="Open", command=donothing)
filemenu.add_command(label="Save", command=donothing)
filemenu.add_command(label="Save as...", command=donothing)
filemenu.add_command(label="Close", command=donothing)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=root.quit)
menubar.add_cascade(label="File", menu=filemenu)
editmenu = Menu(menubar, tearoff=0)
editmenu.add_command(label="Undo", command=donothing)
editmenu.add_separator()
editmenu.add_command(label="Cut", command=donothing)
editmenu.add_command(label="Copy", command=donothing)
editmenu.add_command(label="Paste", command=donothing)
editmenu.add_command(label="Delete", command=donothing)
editmenu.add_command(label="Select All", command=donothing)
menubar.add_cascade(label="Edit", menu=editmenu)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="Help Index", command=donothing)
helpmenu.add_command(label="About...", command=donothing)
menubar.add_cascade(label="Help", menu=helpmenu)
root.config(menu=menubar)
root.mainloop()
This would be very easy to write even just with X11, or you could use a toolkit like GTK.
If you want to hijack an existing tool, you could try something like this with tint2, though that example is now probably useless as the config options have changed quite a bit in seven years.
If you are okay with the "buttons" being text menu items, you could use nearly any one of countless menu programs including zenity, or jgmenu.
]]>