VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: IceWM restart -- SOLVED  (Read 2063 times)

macondo

  • Vectorite
  • ***
  • Posts: 252
IceWM restart -- SOLVED
« on: August 07, 2015, 01:45:46 pm »

The fast way to restart icewm does not work: Winkey+Delete+r
Instead the user has to go to the main menu and click on 'restart icewm'. Respectfully, what gives?
thanks!
« Last Edit: August 11, 2015, 03:49:27 pm by macondo »
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

roarde

  • Vectorian
  • ****
  • Posts: 735
  • it's enough
Re: IceWM restart
« Reply #1 on: August 07, 2015, 05:53:20 pm »

The "logout" dialog built in to icewm has a long history of not working for us. It has been replaced by /usr/share/icewm/shutdown-dialog, which you'll see mentioned near the top of ~/.icewm/keys. Keep in mind that your ~/.icewm/preferences probably aliases the Super/Win key to Ctrl-Alt.

If you find the problem with our setup and IceWM's original Logout widget, please let us know. Meantime, here's a way to add hotkeys and restart to what we have.

Code: [Select]
cp /usr/share/icons/Faenza/actions/24/view-restore.png /usr/share/icewm/icons/restart.pngor pick an icon of your liking.

It's easier to provide a new /usr/share/icewm/shutdown-dialog than to explain the changes
Code: [Select]
#!/bin/bash

export LEAVE_ICE='
<window title="Leave" icon-name="system-log-out">
 <vbox>
  <hbox>
    <button use-underline="true">
      <label>Sh_ut Down</label>
      <input file>/usr/share/icewm/icons/shutdown.png</input>
      <action>"sudo /sbin/shutdown -h now"</action>
    </button>
    <button use-underline="true">
      <label>Re_boot</label>
      <input file>/usr/share/icewm/icons/reboot.png</input>
      <action>"sudo /sbin/shutdown -r now"</action>
    </button>
    <button use-underline="true">
      <label>_Log Out</label>
      <input file>/usr/share/icewm/icons/logout.png</input>
      <action>killall spacefm; killall icewm</action>
    </button>
    <button use-underline="true">
      <label>_Restart</label>
      <input file>/usr/share/icewm/icons/restart.png</input>
      <action>"kill -s HUP $(pgrep -u `whoami` '\''icewm$'\'')
               kill $(ps -eo pid,args | grep LEAVE_ICE |
               grep -v grep| cut -c1-6)"</action>
    </button>
    <button use-underline="true">
      <label>_Cancel</label>
      <input file>/usr/share/icewm/icons/cancel.png</input>
      <action>"kill $(ps -eo pid,args | grep LEAVE_ICE |
               grep -v grep| cut -c1-6)"</action>
    </button>
  </hbox>
 </vbox>
</window>
'

gtkdialog -c --program=LEAVE_ICE

Remember to 'chmod +x'. This makes it "Alt-r" rather than "r", but it does work.
« Last Edit: August 07, 2015, 05:57:19 pm by roarde »
Logged
Robert
VL 7.2 Light B2

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #2 on: August 07, 2015, 07:17:53 pm »

OK roarde, thanks!
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4291
Re: IceWM restart
« Reply #3 on: August 11, 2015, 04:30:11 am »

Nice find, roarde. I was not aware of those undocumented features in gtkdialog.
Logged

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #4 on: August 11, 2015, 07:57:11 am »

The "logout" dialog built in to icewm has a long history of not working for us. It has been replaced by /usr/share/icewm/shutdown-dialog, which you'll see mentioned near the top of ~/.icewm/keys. Keep in mind that your ~/.icewm/preferences probably aliases the Super/Win key to Ctrl-Alt.

If you find the problem with our setup and IceWM's original Logout widget, please let us know. Meantime, here's a way to add hotkeys and restart to what we have.

Code: [Select]
cp /usr/share/icons/Faenza/actions/24/view-restore.png /usr/share/icewm/icons/restart.pngor pick an icon of your liking.

It's easier to provide a new /usr/share/icewm/shutdown-dialog than to explain the changes
Code: [Select]
#!/bin/bash

export LEAVE_ICE='
<window title="Leave" icon-name="system-log-out">
 <vbox>
  <hbox>
    <button use-underline="true">
      <label>Sh_ut Down</label>
      <input file>/usr/share/icewm/icons/shutdown.png</input>
      <action>"sudo /sbin/shutdown -h now"</action>
    </button>
    <button use-underline="true">
      <label>Re_boot</label>
      <input file>/usr/share/icewm/icons/reboot.png</input>
      <action>"sudo /sbin/shutdown -r now"</action>
    </button>
    <button use-underline="true">
      <label>_Log Out</label>
      <input file>/usr/share/icewm/icons/logout.png</input>
      <action>killall spacefm; killall icewm</action>
    </button>
    <button use-underline="true">
      <label>_Restart</label>
      <input file>/usr/share/icewm/icons/restart.png</input>
      <action>"kill -s HUP $(pgrep -u `whoami` '\''icewm$'\'')
               kill $(ps -eo pid,args | grep LEAVE_ICE |
               grep -v grep| cut -c1-6)"</action>
    </button>
    <button use-underline="true">
      <label>_Cancel</label>
      <input file>/usr/share/icewm/icons/cancel.png</input>
      <action>"kill $(ps -eo pid,args | grep LEAVE_ICE |
               grep -v grep| cut -c1-6)"</action>
    </button>
  </hbox>
 </vbox>
</window>
'

gtkdialog -c --program=LEAVE_ICE

Remember to 'chmod +x'. This makes it "Alt-r" rather than "r", but it does work.
Hi roarde, i pasted this in the /usr/share/icewm/shutdown-dialog saved/exit, then from the terminal:
Code: [Select]
$ sudo chmod +x

but it gives me an error,
Code: [Select]
chmod: missing operand after '+x'

 what am i doing wrong? Excuse my ignorance :)
« Last Edit: August 11, 2015, 08:02:28 am by macondo »
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

retired1af

  • Administrator
  • Vectorian
  • *****
  • Posts: 1446
Re: IceWM restart
« Reply #5 on: August 11, 2015, 08:23:01 am »

You're missing the file name of the file you wish to make executable.
Logged
ASUS K73 Intel i3 Dual Core 2.3GHz

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #6 on: August 11, 2015, 08:39:20 am »

You're missing the file name of the file you wish to make executable.

thanks pal, the german disease is creeping in. I did:
Code: [Select]
$ sudo chmod +x /usr/share/icewm/shutdown-dialog

Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #7 on: August 11, 2015, 08:46:27 am »

roarde: I did:

Code: [Select]
winkey + delete + r
winkey + delete + alt+r
Ctrl+Alt+ r
Ctrl+Alt+ Alt+r

Nothing!

WTF, am i reading this all wrong? am ready to kill my mother-in-law...
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

roarde

  • Vectorian
  • ****
  • Posts: 735
  • it's enough
Re: IceWM restart
« Reply #8 on: August 11, 2015, 01:30:53 pm »

From ~/.icewm/keys:
key "Alt+Ctrl+Del"      /usr/share/icewm/shutdown-dialog
The "alt+r" to restart is one of the choices presented by shutdown-dialog, as edited. If you want a more direct key combination to do IceWM restart, the command to use in .icewm/keys is
sh -c 'kill -s HUP $(pgrep -u `whoami` '\''icewm$'\'')'
But the number of available hotkeys is dwindling. Remembering that "Alt+Ctrl" is aliased to "Super" in .icewm/preferences, "Super+r" is already connected to "gmrun" for the original config; no idea what you have now, or what you might be used to.

Using "sh -c" is needed, because there's nothing reading the "keys" file that can do the needed command substitution inside $( . . . ).

The way you have given yourself permissions for everything in sudo is such a very, very, very bad idea. Beyond the possibility of a mistaken keystroke making permanent changes you don't want, there's the security aspect. Anyone who manages to work their way into your session (happens) has complete control over your system. But that's all entirely your business. Until they add your machine to the list of ones they now own and use it to multiply the attacks they're presenting against me or the services I'm trying to use.

Please undo that.
Logged
Robert
VL 7.2 Light B2

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #9 on: August 11, 2015, 02:55:37 pm »

Quote
Please undo that.
Sorry, it's UNdone now.

So, what's the answer to the bug? how do i restart icewm with the keys?
Thanks
« Last Edit: August 11, 2015, 04:00:36 pm by macondo »
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8

macondo

  • Vectorite
  • ***
  • Posts: 252
Re: IceWM restart
« Reply #10 on: August 11, 2015, 03:26:40 pm »

Hi roarde, sometimes i'm dense.
This is what i tried and i think it's working in my .icewm/keys:
Code: [Select]
key "F10" sh -c 'kill -s HUP $(pgrep -u `whoami` '\''icewm$'\'')'
Thanks for being so patient :)

PD: Yep, it's working!
roarde: YOU THE MAN !!!
« Last Edit: August 11, 2015, 03:34:41 pm by macondo »
Logged
VL 7.1 Light - icewm - jwm - ratpoison
“Just because you're paranoid doesn't mean they aren't after you.” ― Joseph Heller, Catch-22
Oscar Peterson - Bossa Nova - https://www.youtube.com/watch?v=cSX_7ejc5u8