Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Jan 2020, 00:20
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Replace nth occurrence of a string with the file's name
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Sun 17 May 2015, 06:23    Post subject:  Replace nth occurrence of a string with the file's name
Subject description: and apply it to a whole directory [Solved]
 

i think this is a job for grep, sed, or awk, and i've been reading up on those, but i also think it's time to appeal to the board. i'd like to take two directories of files named {0..2000..10} (0 to 2000 by 10--there's a bunch) and replace the first occurrence of -1 in every file in one with the file name and do the same for the second occurrences in the other directory. each file/script contains:
Code:

#!/bin/sh

wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,-1,-1,-1,-1


also, a version that's slightly more complicated,
...and replace with the file name minus the first n or last n characters.

thanks.

Last edited by Puppus Dogfellow on Sun 17 May 2015, 19:50; edited 1 time in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1968
Location: Japan

PostPosted: Sun 17 May 2015, 07:06    Post subject: Re: Replace nth occurrence of a string with the file's name
Subject description: and apply it to a whole directory
 

Puppus Dogfellow wrote:
replace the first occurrence of -1 in every file in one with the file name...
Code:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,-1,-1,-1,-1

Try
Code:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,${0##*/},-1,-1,-1
Code is the same for each of your 201 files.

Wouldn't it be much easier to create all files from scratch?
Code:
for X in {0..2000..10};do
TARGETDIR="/archive"
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x  "$TARGETDIR"/$X
done
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Sun 17 May 2015, 08:49    Post subject: Re: Replace nth occurrence of a string with the file's name
Subject description: and apply it to a whole directory
 

MochiMoppel wrote:
Puppus Dogfellow wrote:
replace the first occurrence of -1 in every file in one with the file name...
Code:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,-1,-1,-1,-1

Try
Code:
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,${0##*/},-1,-1,-1
Code is the same for each of your 201 files.

Wouldn't it be much easier to create all files from scratch?
Code:
for X in {0..2000..10};do
TARGETDIR="/archive"
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x  "$TARGETDIR"/$X
done


awesome Mochi, looks great. i'm too drunk at the moment (and for the foreseeable near-future plus i'm being dragged to something or other a little later) to actually try it (i think...far near future regardless and i do appreciate it), but it looks like you additionally have answered something i keep forgetting to ask about (how to set permissions in the script itself...).

so, yeah, i was pleased i was my way to automating each of the five or so steps i had previously used to make similar files and you come up with a script that appears to ...

(ipa and rye.) kampai and thanks. (basement's beginning to burrow into saturn ...better now.)

(gonna split before i embarrass myself.
Laughing

edit: my enthusiasm has sobered me.

must've done something wrong:
Code:
#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,{0..2000..10},-1,-1,-1


^file content

Code:
Sun May 17 09:10:32 # pwd
/archive
Sun May 17 09:10:41 # ls
{0..2000..10}  README-archive.txt
Sun May 17 09:10:44 #


^directory content
______________
not sure if i was supposed to have run it this way, but i made the code above a script and clicked it:

Code:
#!/bin/sh

for X in {0..2000..10};do
TARGETDIR="/archive"
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x  "$TARGETDIR"/$X
done   


where did i go wrong? was i supposed to have already had the 200 in /archive before running the script?

thanks again, Mochi.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1968
Location: Japan

PostPosted: Sun 17 May 2015, 09:24    Post subject:  

You can't be too drunk if you are still able to hit the "quote" button Laughing

I can't claim to be sober either (a bottle of sparkling Spanish cava came with my spaghetti), so I forgot to ask why you need hundreds of scripts. For above case you could create 1 script, tentatively named /root/my-applications/bin/myscript:
Code:
#!/bin/sh
X=${1:--1} # assign argument $1 to variable X, if S1 is empty, default to value -1
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$1,-1,-1,-1


The script takes one argument (the X value for wmctrl)
In order to run your script with e.g. name 100 instead of "myscript 100" create aliases, yes, shortcuts for your shortcuts.

Edit file /root/.bashrc and add
Code:
alias 100="/root/my-applications/bin/myscript 100"
alias 200="/root/my-applications/bin/myscript 200"
alias 300="/root/my-applications/bin/myscript 300"

I think you get the picture...

Kampai!
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1968
Location: Japan

PostPosted: Sun 17 May 2015, 10:00    Post subject: Re: Replace nth occurrence of a string with the file's name
Subject description: and apply it to a whole directory
 

Puppus Dogfellow wrote:
where did i go wrong?
No idea. Script runs fine here (TARGETDIR="/archive" should be placed before the loop ... sparkling cava syndrome. .. not serious). Somehow {0..2000..10} has become the value of $X, but where and how? You didn't put quotation marks around {0..2000..10}, did you? This would explain it.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Sun 17 May 2015, 19:28    Post subject: Re: Replace nth occurrence of a string with the file's name
Subject description: and apply it to a whole directory
 

MochiMoppel wrote:
Puppus Dogfellow wrote:
where did i go wrong?
No idea. Script runs fine here (TARGETDIR="/archive" should be placed before the loop ... sparkling cava syndrome. .. not serious). Somehow {0..2000..10} has become the value of $X, but where and how? You didn't put quotation marks around {0..2000..10}, did you? This would explain it.


only thing is the out of order first line--it was just a cut and paste from your post so no additions. one of my installations has no /archive directory, apparently, and the script (in the right order) failed, but once i added an actual directory to the line, it worked flawlessly--so, as a thank you, here are 2,247 or so scripts.
Laughing

MochiMoppel wrote:
I forgot to ask why you need hundreds of scripts


i've come to rely on a shortcut key (shift plus space) for gexec quite a bit lately and so i decided to use it to make it as quick and easy as possible (given what little i know about computers, that is) to resize and reposition windows with the keyboard. send along the x axis and y axis go from 0-2000 by tens, height and width go from 200 to 2000 by fives. basic launch code is

x# move along x axis to #
y# move along y axis to #
w# adjust width to #pixels
h# adjust height to #pixels

add an s to make the code work on a window to be clicked rather than the active one (examples: x440, y750s, w435, h1275s)

Smile

caveat: the only two launchers i've found to work with this type of script are pexec and gexec--all the others morph and send themselves for a walk.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Sun 17 May 2015, 22:33    Post subject: script that makes the same files as the download
Subject description: thanks again, Mochi
 

rather than download the 30 or so kb .gz or .xz, you can use the following. it will produce the same files in a folder in root (gexsp, for gexec size and place), but you'll need to do the renaming--thought i got around having to fiddle around with gfnrename (which actually works very well), but it didn't work out as planned.

EDIT: script works on precise 5.7.1 but not precise 5.5. to not risk it or have to rename, use the .xz folder instead. place scripts in/symlink them to /root/my-applications/bin, launch with gexec or pexec. (the script, at least for the moment, requires you to copy from eight folders rather than just one. the gz file contains separate folders for each category (width, height, positon on x axis, position on y axis, x2 for active window and click to select). all the files produced by the script have bare names for numbers. use the convention above or invent your own. change the range or increment by swapping out {from..to..increment}.


Code:



#!/bin/sh
mkdir -p /root/gexsp/hs
TARGETDIR="/root/gexsp/hs"
for X in {200..2000..5};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,-1,-1,-1,$X" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/ws
TARGETDIR="/root/gexsp/ws"
for X in {200..2000..5};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,-1,-1,$X,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/ys
TARGETDIR="/root/gexsp/ys"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,-1,$X,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/xs
TARGETDIR="/root/gexsp/xs"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/h
TARGETDIR="/root/gexsp/h"
for X in {200..2000..5};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,-1,-1,-1,$X" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/w
TARGETDIR="/root/gexsp/w"
for X in {200..2000..5};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,-1,-1,$X,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/y
TARGETDIR="/root/gexsp/y"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,-1,$X,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/x
TARGETDIR="/root/gexsp/x"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

Last edited by Puppus Dogfellow on Mon 18 May 2015, 17:16; edited 5 times in total
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1968
Location: Japan

PostPosted: Sun 17 May 2015, 23:24    Post subject:  

Shocked Holy @#$@! Produces 2248 scripts! And they aren't even working Laughing
What is wmctrl supposed to do with an expression like
wmctrl -r :SELECT: -e 0,-1,-1,-1,h235s ?
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Mon 18 May 2015, 00:12    Post subject:  

MochiMoppel wrote:
Shocked Holy @#$@! Produces 2248 scripts! And they aren't even working Laughing
What is wmctrl supposed to do with an expression like
wmctrl -r :SELECT: -e 0,-1,-1,-1,h235s ?


heh. well, the ones in the compressed folder all work. (and for me it only produced a handful of non-working scripts--most didn't get produced at all)

Laughing Embarassed

i got so carried away with the time your script saved me that i didn't bother to check the changes the last tweak to it--wreaked. (i made the folders more convenient, then the files themselves more convenient, but the last file adjustment was merely self-destructive (and unchecked) Razz )

oh well, guess i'll have to go back to the old way (not that i really need more files, though you never know when you'll want a 438 pixel wide window placed at 467,789... Laughing) of doing it by folder and then renaming through gnfnrneedstoberenamed or similar. at least i realized i no longer needed the grep swap line to go from select to active or vice versa (this place needs a shrug icon. if you can cry and be embarrassed, you should also be able to shrug. smirk and grimace, too.) now that i think about it, there's probably a way to add something to the script to rename the files, no? guess that's how i should've done this.


i'll fix above (done. at least as far as i can tell.) and all the originals (made the old fashioned way) really do work.
Very Happy

a note on that--it won't allow you to place a window past the borders of the screen, which is almost a safety measure as far as lost windows go, but it also obviates many of the x and y scripts since the borders come up pretty quickly unless your windows are icon-sized...

Last edited by Puppus Dogfellow on Mon 18 May 2015, 17:19; edited 2 times in total
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Mon 18 May 2015, 01:10    Post subject:  

Code:
#!/bin/sh
TARGETDIR="/archive"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


your original script in the correct order is failing on this machine for some reason. guess i need to check that machine since i've still yet to get the script working on this one regardless of form. on the other,

Quote:
#!/bin/sh
mkdir -p /root/x
#added the above
#swapped out for TARGETDIR="/archive" for
TARGETDIR="/root/x"
for X in {0..2000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


worked fine, as did subsequent versions that went deeper into the tree. only the bad idea of surrounding the braces with text should be crippling this thing, yet fixing that didn't fix it. what don't i see?

i have no idea why, but the following works on precise 571/572 but not 55:

Code:
#!/bin/sh


mkdir -p /root/wmkr/a/b
#added the above
#swapped out for TARGETDIR="/archive" for
TARGETDIR="/root/wmkr/a/b"
for X in {0..1000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,-1,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/wmkr/a/b/c
#added the above
#swapped out for TARGETDIR="/archive" for
TARGETDIR="/root/wmkr/a/b/c"
for X in {0..1000..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,-1,$X,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


the corrected (but not as fast Laughing ) code above reflects the idea that this is in fact working code.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1968
Location: Japan

PostPosted: Mon 18 May 2015, 03:15    Post subject:  

Puppus Dogfellow wrote:
i have no idea why, but the following works on precise 571/572 but not 55:
Precise 55 (and 56) use an outdated bash version (v.3.00). It would know how to loop through for X in {0..1000}, but does not yet know the increment parameter as in for X in {0..1000..10}. This explains your problems mentioned in your 2nd post. Please always mention your Puppy version. Spares me a lot of head scratching.

If you need to use such old Puppies you should replace
Code:
for X in {0..1000..10};do
with
Code:
for (( X=0; X<=1000; X=X+10 ));do

The latter C syntax works in Precise 56 and presumably in all current Puppies.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Mon 18 May 2015, 17:10    Post subject:  

MochiMoppel wrote:
Puppus Dogfellow wrote:
i have no idea why, but the following works on precise 571/572 but not 55:
Precise 55 (and 56) use an outdated bash version (v.3.00). It would know how to loop through for X in {0..1000}, but does not yet know the increment parameter as in for X in {0..1000..10}. This explains your problems mentioned in your 2nd post. Please always mention your Puppy version. Spares me a lot of head scratching.

If you need to use such old Puppies you should replace
Code:
for X in {0..1000..10};do
with
Code:
for (( X=0; X<=1000; X=X+10 ));do

The latter C syntax works in Precise 56 and presumably in all current Puppies.


think it'd be easier to update bash (which i actually mistakenly thought there was a good chance i had done while i was mirroring all/most of the versions rapidly appearing amidst the great bash scare of ...this year, was it? i usually default to inaction, but there was a period where i was installing things like crazy since i was just beginning to realize how bulletproof a "disconnected" frugal can be) than deal with a new syntax, but yeah, this 5.5 can't do echo {10..100..10} (correctly). the way it worked out, most of the testing just happened to be done on the machine that could except for that very first go--i wasn't up for much more testing--had i tried it on the capable machine it'd've failed and i'm not sure i'd have noticed the missing /archive folder--i don't think i've ever noticed either its existence or absence before. assuming i was able to respond to "what distro are you using?" or provided the admittedly important info beforehand, i'm not sure how many more follow up questions i'd've been upright for. Very Happy

____

here's a version to make active and click-to-form squares:


Code:
#!/bin/sh
mkdir -p /root/gexsp/sqs
TARGETDIR="/root/gexsp/sqs"
for X in {100..1200..10};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,-1,-1,$X,$X" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/sq
TARGETDIR="/root/gexsp/sq"
for X in {100..1200..10};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,-1,-1,$X,$X" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done



Mochi, what's the proper syntax for adding additional braced variables to the script? in other words, if i wanted to have the something like

Code:
0,{0..1800..200},{0..1350..150},-1,-1


actually work on the content of the file, leaving the name generation the way it is. speaking of names, what's the best command to add a given prefix and/or suffix to an entire directory of files?

here's gexsq.tar.gz. lauch convention is same--bare number is active square, add an s at the end to make it a click-to-square. squares from 100 to 1200 by 10s.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 1636
Location: nyc

PostPosted: Tue 19 May 2015, 01:50    Post subject: grid shortcuts for pexec and gexec
Subject description: or a regular terminal if you stick to the select versions
 

grid.tar.xz

naming convention's a little different for these. first part (with or without the s for select, the 1-16 part that comes before the dot) is rung down the y axis, 100 pixels per step (i.e first rung is y=0, second is y=100, etc). the second part is x-axis /100. so,

1.20 and 5s.16 are active window to 2000x,0y and selected window to 1600x,400y. 1.0 is upper left corner.

seems to me i could've started at 0 for the y value and the period is unnecessary for the select values, but it already more or less feels natural to me, though i've discovered that some windows, or, sometimes windows can in fact be pushed past the screen edge...

pack includes active and select versions of x2300,2500,2800,and 3000 and the 1._ series goes to 30 (the others go to 20 and the y# scripts from earlier cover down to 2000 (which'd be 21._).

here's the script that made it (sure did leave the need for a lot of renaming in its wake...) Very Happy :

Code:
#!/bin/sh
mkdir -p /root/gexsp/g1s
TARGETDIR="/root/gexsp/g1s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,0,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g1
TARGETDIR="/root/gexsp/g1"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,0,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g2s
TARGETDIR="/root/gexsp/g2s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,100,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g2
TARGETDIR="/root/gexsp/g2"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,100,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g3s
TARGETDIR="/root/gexsp/g3s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,200,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g3
TARGETDIR="/root/gexsp/g3"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,200,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g4s
TARGETDIR="/root/gexsp/g4s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,300,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g4
TARGETDIR="/root/gexsp/g4"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,300,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g5s
TARGETDIR="/root/gexsp/g5s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,400,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g5
TARGETDIR="/root/gexsp/g5"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,400,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g6s
TARGETDIR="/root/gexsp/g6s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,500,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g6
TARGETDIR="/root/gexsp/g6"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,500,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g7s
TARGETDIR="/root/gexsp/g7s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,600,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g7
TARGETDIR="/root/gexsp/g7"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,600,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g8s
TARGETDIR="/root/gexsp/g8s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,700,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g8
TARGETDIR="/root/gexsp/g8"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,700,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g9s
TARGETDIR="/root/gexsp/g9s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,800,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g9
TARGETDIR="/root/gexsp/g9"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,800,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g10s
TARGETDIR="/root/gexsp/g10s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,900,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g10
TARGETDIR="/root/gexsp/g10"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,900,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g11s
TARGETDIR="/root/gexsp/g11s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1000,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g11
TARGETDIR="/root/gexsp/g11"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1000,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g12s
TARGETDIR="/root/gexsp/g12s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1100,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g12
TARGETDIR="/root/gexsp/g12"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1100,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g13
TARGETDIR="/root/gexsp/g13"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1200,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g13s
TARGETDIR="/root/gexsp/g13s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1200,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g14s
TARGETDIR="/root/gexsp/g14s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1300,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g14
TARGETDIR="/root/gexsp/g14"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1300,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g15
TARGETDIR="/root/gexsp/g15"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1400,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done

mkdir -p /root/gexsp/g15s
TARGETDIR="/root/gexsp/g15s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1400,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done


mkdir -p /root/gexsp/g16
TARGETDIR="/root/gexsp/g16"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,$X,1500,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done
mkdir -p /root/gexsp/g16s
TARGETDIR="/root/gexsp/g16s"
for X in {0..2000..100};do
echo -n "#!/bin/bash
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz
wmctrl -r :SELECT: -e 0,$X,1500,-1,-1" > "$TARGETDIR"/$X
chmod a+x "$TARGETDIR"/$X
done



Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0911s ][ Queries: 12 (0.0062s) ][ GZIP on ]