Author Topic: fluxbox restart mod keys in a script  (Read 1110 times)

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
fluxbox restart mod keys in a script
« on: September 23, 2017, 04:58:19 PM »
I am looking for a way to restart fluxbox every 90 seconds... I need to do this because of how I use this server on a big screen TV and access it via nomachine.. When I do this it causes fluxbox to lose it's mind and a restart from the menu works to restore order

I also have created a mod key sequence in ~/.fluxbox/keys file as

Code: [Select]
Mod1 F7 :Restart
and it works fine... I need to now run that key sequence every 90 seconds from a script.. Conky makes the most sense since it runs all the time anyway... doing something like

Code: [Select]
${execpi 90 Mod1 F7 :Restart}
Anyone done this?

@PackRat?

@Jedi?
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #1 on: September 23, 2017, 06:08:28 PM »
Conky won't run a key binding or an window manager internal command, you would have to set up an xdotool command to simulate the key sequence - more trouble than it's worth IMO.

If you want to run it in conky:

${execpi 90  pkill -x -USR1 fluxbox}

or set that command up as a cron job.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #2 on: September 23, 2017, 06:16:18 PM »
Quote
I use this server on a big screen TV and access it via nomachine.

You mean via ssh?

Looked it up - you mean this?

Quote
When I do this it causes fluxbox to lose it's mind and a restart from the menu works to restore order

Just one restart required?

May be best to code a script that restarts fluxbox after the remote access.

Why is a 90 second restart frequency required? Fluxbox loose it's mind every 90 seconds thereabouts?
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #3 on: September 23, 2017, 06:47:11 PM »
How does nomachine work? You apparently log into it, but is there something similar to dhcp going on where it provides a lease - like every 90 seconds maybe?

Is there some configuration on the host you can change?
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #4 on: September 23, 2017, 11:27:57 PM »
nomachine is just a headless server tool... All I do is access full gui from one machine to the other.. It is very light and easy to use .. the secondary server is a KODI and the V-Ger server so I access it frequently and just do not want a separate monitor KB and mouse

I see this same behavior from when changing hdmi ports on this machine (or any fluxbox machine) and all that it does is cause tint2 to switch to the top left and windows borders disappear.. a restart of fluxbox fixes it

As far as 90 seconds goes, that is just arbitrary... I really do not care how long it is, 90 seconds is good knowing that when I log into the server with nomachine I can get a cup of coffee and get back to a correct screen
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #5 on: September 23, 2017, 11:40:44 PM »
Quote
I use this server on a big screen TV and access it via nomachine.

You mean via ssh?

Looked it up - you mean this?

Quote
When I do this it causes fluxbox to lose it's mind and a restart from the menu works to restore order

Just one restart required?

May be best to code a script that restarts fluxbox after the remote access.

Why is a 90 second restart frequency required? Fluxbox loose it's mind every 90 seconds thereabouts?

pkill -x -USR1 fluxbox does not work from terminal so need something else..

Just one restart is needed, yes, until I access the machine again

nomachine is just access over tcpip and the machine itself (the KODI/V-Ger machine stays static always) so I can run a script at anytime .. the ideal setting would be a cron that recognized a nomachine access and restarting fluxbox .. but that seems like over kill when since conky runs all the time I can just set a execpi as a perfect tool with a timer
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #6 on: September 24, 2017, 12:01:17 AM »
Quote
pkill -x -USR1 fluxbox does not work from terminal so need something else..

That's apparently a Debian (Sid) security thing; works with conky, tint2, but not the window manager. Works on the wm in Void.

Try -

Code: [Select]
xdotool key alt+F7

and see if that works; it's working with my VSIDO fluxbox restart key binding - "Super + q"
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #7 on: September 24, 2017, 12:13:48 AM »
Code: [Select]
xdotool key alt+F7
is the winner....

I knew I could use xdotool, I just wanted to see if any new or existing fluxbox scripting could be used

Thanks RatMan I knew you would solve this
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #8 on: September 24, 2017, 12:33:16 AM »
Code: [Select]
${execpi 90 xdotool key alt+F7}
is the final bit of code..
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #9 on: September 24, 2017, 02:02:56 PM »
Quote
all that it does is cause tint2 to switch to the top left and windows borders disappear

Those are the only issues? You can otherwise use fluxbox as intended?

Thought about this some more, the closest I've come to an issue like this is when using tmux or emacs with fluxbox. Starting either, wouldn't crash the window manager, but fluxbox wouldn't respond correctly to any mouse or keyboard input - like it got reconfigured.

Turned out to be a key binding collision between fluxbox and either tmux or emacs. Made a couple changes to ~/.fluxbox/keys and tmux.conf and all was right with the world. Does nomachine have some default keybindings so you can administer the system from a console? If so, see if they conflict with your ~/.fluxbox/keys file.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #10 on: September 24, 2017, 05:23:50 PM »
I brought up nomachine because this issue happens frequently within it.. It also happens every time you change any video port.. Change from hdmi1 to hdmi2 or DVI  to hdmi1.. It can just as easily be an X11 issue but it only affects fluxbox..

I have seen and known about this for years but never really cared to solve it because how often do you change video ports on a live machine?

Thanks RatMan
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

DeepDayze

  • Posts: 21
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #11 on: September 27, 2017, 11:12:31 PM »
Maybe this is either a quirk in how Fluxbox interacts with nomachine?

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #12 on: September 27, 2017, 11:14:41 PM »
I can reproduce it 100% of the time without nomachine by simply unplugging the video from the PC and plugging it back in
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

PackRat

  • Posts: 1963
    • View Profile
Re: fluxbox restart mod keys in a script
« Reply #13 on: September 30, 2017, 01:10:01 PM »
@vastone -

Do you start fluxbox so that it keeps an event log?

in the $HOME/.fluxbox/startup:

Code: [Select]
# exec fluxbox
# or if you want to keep a log:
exec fluxbox -log "$HOME/.fluxbox/log"

Be interesting to see if something was generated for this. May be worth a bug report?
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: fluxbox restart mod keys in a script
« Reply #14 on: September 30, 2017, 02:51:10 PM »
I created the log and recreated the issue and nothing is generated in that log.. Good suggestion RatMan

I have long suspected this as being an X11 issue and really with the xdotool fix I am very satisfied with it
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO