Guest User

JAVAFIX.SH

a guest
Dec 22nd, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Fix X window manager name properties to work around java bugs with
  4. # non-reparenting window managers.  This is a different solution from
  5. # the wmname utility provided by suckless, as it is NetWM compatible,
  6. # while wmname sets the value of _NET_SUPPORTING_WM_CHECK to root win.
  7.  
  8. IRONIC_WM_NAME="LG3D"
  9. NET_WIN=$(xprop -root _NET_SUPPORTING_WM_CHECK | awk -F "# " '{print $2}')
  10. _JAVA_AWT_WM_NONREPARENTING=1
  11. export _JAVA_AWT_WM_NONREPARENTING
  12.  
  13. if [[ "$NET_WIN" == 0x* ]]; then
  14.     # xprop cannot reliably set UTF8_STRING, so we replace as string.
  15.     # fortunately, jdk is OK with this, but wm-spec says use UTF8_STRING.
  16.     xprop -id "$NET_WIN" -remove _NET_WM_NAME
  17.     xprop -id "$NET_WIN" -f _NET_WM_NAME 8s -set _NET_WM_NAME "$IRONIC_WM_NAME"
  18. else
  19.     # even if we're not net compatible, do java workaround
  20.     xprop -root -remove _NET_WM_NAME
  21.     xprop -root -f _NET_WM_NAME 8s -set _NET_WM_NAME "$IRONIC_WM_NAME"
  22. fi
  23.  
  24. wmname "$IRONIC_WM_NAME"
  25.  
  26. STS
Advertisement
Add Comment
Please, Sign In to add comment