last day (15 days later) » 

1:52 PM
Suggestion: refactor the Zenity list to get output in the format "top 1, right 2" instead of 1600x0 or so...
 
@ByteCommander to pass output to xdotool i will need to get rid of the "top" , "," and "right" strings
@ByteCommander Yeah, I'll probably add 2> /dev/null for zenity. But I cannot understand what is going on with the BadWindow error
 
Now it worked, strangely.
alphawolf@wolf-pack:~/sandbox$ ./serg.sh -g
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x4800007
  Serial number of failed request:  21
  Current serial number in output stream:  21
alphawolf@wolf-pack:~/sandbox$ ./serg.sh -g
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
X Error of failed request:  BadWindow (invalid Window parameter)
 
@ByteCommander what was the viewport that failed ?
 
Same windows, I have no idea.
All failed first, but work now. :P
(I think)
 
O_o
 
1:56 PM
But your script moves all windows to (0|0) coordinates of the target viewport instead of preserving the original positions.
That's especially ugly as this way the windows go behind the launcher bar and the top panel.
 
@ByteCommander yeah , it's a bit ugly. I can try to make them move away from launcher, but it's a lot of work to preserve positions. I'd need to parse output of wmctrl into associative array or something
 
Well, Python all the things etc....
 
testing now...
 
im uploading a webm
 
No worries... While waiting for the upload: please review my edits! :P
 
2:04 PM
already did. I like those, except I'd remove the long options with -- , the other letters get confused as errors by getopts.
@ByteCommander are you using Nvidia by any chance?
 
@Serg well, the whole point is to get the -- in....
reverting to old until I have that hammered out.
I never use short options: only long...
 
OK :3 well, i'll try to adapt the parse_args function for that
 
@Serg No, an old AMD Radeon card with default open-source driver.
$ inxi -G
Graphics:  Card: Advanced Micro Devices [AMD/ATI] RV535 [Radeon X1650 PRO]
           Display Server: X.Org 1.17.2 drivers: ati,radeon (unloaded: fbdev,vesa) Resolution: 1600x1200@75.00hz
           GLX Renderer: Gallium 0.4 on ATI RV530 GLX Version: 2.1 Mesa 11.0.2
 
@ByteCommander can you set -x before call to main and see where the error occurs ?
 
@Fabby Python has a module called argparse that does all the magic needed for such things... ;-)
 
2:11 PM
WHAT ?
DeterminedBareApe ?
 
@Serg What? where? And if I click Cancel in the Zenity dialog, it moves my windows to lower right viewport! :/
 
@ByteCommander OK, I need to address the cancel button - good catch. At the very end of the code, there is call to main "$@" , add set -x on the line before that
 
Like this? (last 4 lines)
}

set -x
main "$@"
 
@Serg OK, I'm giving up trying to put long opts in...
moving on to smth else...
 
Good idea. I'm moving to the kitchen to make some food... CUL8R.
 
2:17 PM
@ByteCommander yeah, like that
 
$ ./serg.sh -g
+ main -g
+ local FOLLOW
+ local NEWVP
+ local XMAX YMAX
++ get_active_viewport
++ xprop -root -notype _NET_DESKTOP_VIEWPORT
++ awk -F = '{sub(/,/," ");print $2}'
+ local 'OLDVP= 1600  1200'
+ parse_args -g
+ '[' 1 -eq 0 ']'
+ getopts v:ghf opt
+ case ${opt} in
++ gui_selection
++ tr x ' '
++ SCHEMA=org.compiz.core:/org/compiz/profiles/unity/plugins/core/
++ read swidth sdepth
+++ get_screen_geometry
+++ awk '/-geometry/{gsub(/+|x/," ");print $2,$3}'
+++ xwininfo -root
+++ gsettings get org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize
 
OK, fixed up zenity cancel option
@ByteCommander no error this time ?
I want one with error
 
moving from lower right to top left (having 2x2 viewports) without erros.
Sry, no idea how to reproduce, especially while I'm hungry. BBL.
 
ok
I've pushed the zenity change to git by the way
 
Hello.
 
2:27 PM
@grooveplex welcome back :) OK , does the error still occur ?
 
I'm not sure, because, with due respect, I removed your program from my laptop since I didn't know why I would use it as I use one workspace only and I think it would be good to take a break from my laptop...
 
Oh . . ok
@ByteCommander em , are you using mawk or gawk ?
 
Looks like gawk, right?
$ awk --version
GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.3, GNU MP 6.0.0)
Copyright (C) 1989, 1991-2014 Free Software Foundation.
I wanted to go to the kitchen... :/
 
OK . . . that might be a problem . . .
Then why are you still here ?
 
I don't know.
 
2:36 PM
Yup, that may be an issue
$ mawk '{print strtonum($0)}' <<< "0xa"
mawk: line 2: function strtonum never defined
 
3:19 PM
OK, script has been pushed to git again, with changes from using gawk as conversion tool to bc
 
3:31 PM
@ByteCommander @Fabby please test it out again ,when you have time guys, alright ? I'll be making the script spread out the window a bit, so that they're not all in front of the launcher,too, but later for that
 

last day (15 days later) »