Topic: [SOLVED]Help with upgrading Scrotwm

I'm using the version of Scrotwm that's in the Stable repos(which is 9.20), and I'm wanting to upgrade to something newer. But I'm not having any luck with it.

Would someone be kind enough to walk me through this process?

To be a little more detailed, this is what Terminal is showing after I cd to scrotwm/linux and the make:


gcc -Wall -ggdb -D_GNU_SOURCE -I. -DSWM_LIB=\"/usr/local/lib/libswmhack.so.0.0\"   -c -o scrotwm.o scrotwm.c
scrotwm.c:90:34: error: X11/extensions/XTest.h: No such file or directory
scrotwm.c: In function ‘send_to_ws’:
scrotwm.c:3061: warning: pointer targets in passing argument 1 of ‘snprintf’ differ in signedness
/usr/include/stdio.h:363: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
scrotwm.c: In function ‘pressbutton’:
scrotwm.c:3074: warning: implicit declaration of function ‘XTestFakeButtonEvent’
scrotwm.c: In function ‘uniconify’:
scrotwm.c:3176: warning: pointer targets in assignment differ in signedness
scrotwm.c: In function ‘search_do_resp’:
scrotwm.c:3218: warning: pointer targets in assignment differ in signedness
scrotwm.c: In function ‘window_get_pid’:
scrotwm.c:4991: warning: pointer targets in passing argument 1 of ‘strtonum’ differ in signedness
./util.h:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
scrotwm.c: In function ‘manage_window’:
scrotwm.c:5085: warning: pointer targets in passing argument 1 of ‘strtonum’ differ in signedness
./util.h:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
scrotwm.c:5126: warning: pointer targets in passing argument 1 of ‘snprintf’ differ in signedness
/usr/include/stdio.h:363: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
make: *** [scrotwm.o] Error 1

Last edited by h8uthemost (2011-10-21 07:23:12)

Re: [SOLVED]Help with upgrading Scrotwm

Looks like you need the x11proto-xext-dev package maybe?

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

I don't think so. I get this in Terminal when trying to install it:

x11proto-xext-dev is already the newest version.
x11proto-xext-dev set to manually installed.

Debian Stable is indeed great for its stability but it's a pain in the ass for its old packages. Think I might switch to Unstable so I don't have to mess with compiling every new package that I want.

By the way it's version 0.9.34 that I'm trying to upgrade to. If that makes a difference at all...

Last edited by h8uthemost (2011-10-21 00:55:36)

Re: [SOLVED]Help with upgrading Scrotwm

How about libxtst-dev. I hadn't updated my apt-file cache (doh!)

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

That seemed to have did it, safetycopy! scrotwm -version now shows that 9.34 is installed. smile

I can't thank you enough for this.

Re: [SOLVED]Help with upgrading Scrotwm

No problem mate smile Glad you got it sorted!

I should mention apt-file. Install it with:

sudo apt-get install apt-file

Then:

sudo apt-file update

...which will download the Contents-*.gz files from any repositories you have set up (was about 20Mb on my machine).

One that's down, you can do:

apt-file search XTest.h

...to find packages containing the file you're after. It should be somewhat obvious which package you need if multiple packages show as containing the file you're after.

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

Thanks safetycopy. That's a good tip and I'll try it out.

But back to this, it looks like I'm not on 9.34. When I Mod+Shift+V in scrotwm, 9.20 pops up on the scrotbar. This is what I get when I run sudo make install:

install -m 755 -d /usr/local/bin
install -m 755 -d /usr/local/lib
install -m 755 -d /usr/local/share/man/man1
install -m 755 scrotwm /usr/local/bin
install -m 755 libswmhack.so.0.0 /usr/local/lib
install -m 644 ../scrotwm.1 /usr/local/share/man/man1/scrotwm.1
install -m 644 ../scrotwm_es.1 /usr/local/share/man/man1/scrotwm_es.1
install -m 644 ../scrotwm_it.1 /usr/local/share/man/man1/scrotwm_it.1
install -m 644 ../scrotwm_pt.1 /usr/local/share/man/man1/scrotwm_pt.1
install -m 644 ../scrotwm_ru.1 /usr/local/share/man/man1/scrotwm_ru.1

Since there's no errors I figured everything installed ok. And when I do scrotwm -version in Terminal I get this:

Welcome to scrotwm V0.9.34 cvs tag: $scrotwm: scrotwm.c,v 1.356 2011/08/13 20:26:02 marco Exp $

So I'm not entirely sure what I did wrong here. Isn't scrotwm -version telling me I'm on 0.9.34? I've rebooted my computer too, but the version is showing 9.20 in the scrotbar,

Re: [SOLVED]Help with upgrading Scrotwm

I don't actually use scrotwm, but it doesn't look like you did anything wrong. Perhaps @gutterslob or one of our forum members with more experience with scrotwm can help with that.

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

Ok, I'll wait for help from one of them.

I did however --purge removed scrotwm. And then I tried to install scrotwm 9.34 from the method above(make then sudo make install), and when I then go into Synaptics it shows that scrotwm isn't installed. And there's not an entry for it in gdm either. So I guess it didn't install.

For one when one of the other members pop in, this is what Terminal shows when I run make for 9.34:

ln -sf ../scrotwm.c
gcc -Wall -ggdb -D_GNU_SOURCE -I. -DSWM_LIB=\"/usr/local/lib/libswmhack.so.0.0\"   -c -o scrotwm.o scrotwm.c
scrotwm.c: In function ‘send_to_ws’:
scrotwm.c:3061: warning: pointer targets in passing argument 1 of ‘snprintf’ differ in signedness
/usr/include/stdio.h:363: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
scrotwm.c: In function ‘uniconify’:
scrotwm.c:3176: warning: pointer targets in assignment differ in signedness
scrotwm.c: In function ‘search_do_resp’:
scrotwm.c:3218: warning: pointer targets in assignment differ in signedness
scrotwm.c: In function ‘window_get_pid’:
scrotwm.c:4991: warning: pointer targets in passing argument 1 of ‘strtonum’ differ in signedness
./util.h:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
scrotwm.c: In function ‘manage_window’:
scrotwm.c:5085: warning: pointer targets in passing argument 1 of ‘strtonum’ differ in signedness
./util.h:15: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
scrotwm.c:5126: warning: pointer targets in passing argument 1 of ‘snprintf’ differ in signedness
/usr/include/stdio.h:363: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
gcc -Wall -ggdb -D_GNU_SOURCE -I. -DSWM_LIB=\"/usr/local/lib/libswmhack.so.0.0\"   -c -o linux.o linux.c
gcc  -o scrotwm scrotwm.o linux.o -lX11 -lXrandr -lXtst
ln -sf ../lib/swm_hack.c
gcc -Wall -ggdb -D_GNU_SOURCE -I. -DSWM_LIB=\"/usr/local/lib/libswmhack.so.0.0\" -c -fpic -DPIC swm_hack.c -o swm_hack.so
swm_hack.c: In function ‘set_property’:
swm_hack.c:111: warning: pointer targets in passing argument 7 of ‘xcp’ differ in signedness
swm_hack.c:111: note: expected ‘unsigned char *’ but argument is of type ‘char *’
gcc -shared -fpic -o libswmhack.so.0.0 swm_hack.so -lX11 -lXrandr -lXtst

And then sudo make install gives me the output in my above post.

Anyways, thanks for your help safetycopy.

Re: [SOLVED]Help with upgrading Scrotwm

If you install something from source, it won't show up in Synaptic (unless you use checkinstall to make a .deb).

Edit: Are you using the git source?

Last edited by safetycopy (2011-10-21 01:52:49)

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

Sorry guys, just woke up. I'm also a tad groggy so excuse any typos....

@safetycopy
Thanks for helping out, mate. smile
Your suggestion to install libxtst-dev was the right one.

@h8slobthemost
Aah, okay. So you installed the old version via apt and the new version from source, and it still starts up the old version, right?
Personally, I install all my versions of ScrotWM from source these days. I didn't have your problem when I installed from source after installing the old version via apt either.... BUT ... I can sorta figure out how to solve it (hopefully)

1. First backup your ~/.scrotwm.conf as a precaution.

* next step is required if you start scrotwm from /usr/share/xsessions/Scrotwm.desktop (for GDM). If you start ScrotWM via xinitrc (startx) then skip to step 3...

2. Make a backup of your /usr/share/xsessions/Scrotwm.desktop, since it contains the path to the script you use to start Scrotwm.

3, Quit ScrotWM (Mod+Shift+Q) or whatever WM you're on right now. If you exit GDM, then press Ctrl+Alt+F1 to bring you to a TTY. From there, purge the old version of scrotwm:

sudo apt-get purge scrotwm

4. Now cd into the ScrotWM 0.9.34 snapshot folder you extracted earlier and then cd into the /linux folder and run "make" and "sudo make install"  (actually you probably don't have to run make if it's the same folder you installed from earlier) to install the source again.

*next step required if you needed to perform step 2 earlier. Skip to 6 if not needed....

5. Either from the same TTY or in another WM, go to /usr/share/xsessions/ and put back the Scrotwm.desktop file you backed up earlier.

6. Check if your old ~/.scrotwm.conf is still in your home folder. If it got deleted in the purge, then just put back the one you backed up earlier.

7. Check inside your pants for your scrotum (it's a required dependency). If you're a chick, tough luck.

8. Start scrotwm and check the version (in the bar). Also, check the man page (man scrotwm) and see if there's stuff related to "layout" and "EWMH". If it's there, then you have the new man pages installed at least. Edit1: Also check my other post #14 below

9. Report back here.

Edit2:
Regarding the use of checkinstall: It's been hit and miss for me, depending on snapshot. I never bothered to investigate, but I assumed it had something to do with us Linux users needing to run make from inside the /linux folder of the source.

Edit3:
Sorry, I was probably typing this post as you were typing your last one. Regarding your make output, there's no error at the end so it seems to be fine.

Last edited by gutterslob (2011-10-21 03:26:08)

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

big_smile @ number 7!

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: [SOLVED]Help with upgrading Scrotwm

safetycopy wrote:

big_smile @ number 7!

Thats genious lol

Last edited by psyco430404 (2011-10-21 02:33:56)

"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Re: [SOLVED]Help with upgrading Scrotwm

Oh,

@h8
If you're still unsure which version you have,
Add this line to the "#Bar Settings" in your ~/.scrotwm.conf

bar_at_bottom      = 1

iirc, the version in from the Debian repos (0.9.20, I think) doesn't support this yet, so if you restart ScrotWM after applying that change and the bar still remains on top  (or it crashes), then you still have the old version for some inexplicable reason (which would be strange as f*ck since you purged it already)....

Last edited by gutterslob (2011-10-21 03:32:12)

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

h8uthemost wrote:

Thanks safetycopy. That's a good tip and I'll try it out.

But back to this, it looks like I'm not on 9.34. When I Mod+Shift+V in scrotwm, 9.20 pops up on the scrotbar. This is what I get when I run sudo make install:

install -m 755 -d /usr/local/bin
install -m 755 -d /usr/local/lib
install -m 755 -d /usr/local/share/man/man1
install -m 755 scrotwm /usr/local/bin
install -m 755 libswmhack.so.0.0 /usr/local/lib
install -m 644 ../scrotwm.1 /usr/local/share/man/man1/scrotwm.1
install -m 644 ../scrotwm_es.1 /usr/local/share/man/man1/scrotwm_es.1
install -m 644 ../scrotwm_it.1 /usr/local/share/man/man1/scrotwm_it.1
install -m 644 ../scrotwm_pt.1 /usr/local/share/man/man1/scrotwm_pt.1
install -m 644 ../scrotwm_ru.1 /usr/local/share/man/man1/scrotwm_ru.1

Since there's no errors I figured everything installed ok. And when I do scrotwm -version in Terminal I get this:

Welcome to scrotwm V0.9.34 cvs tag: $scrotwm: scrotwm.c,v 1.356 2011/08/13 20:26:02 marco Exp $

So I'm not entirely sure what I did wrong here. Isn't scrotwm -version telling me I'm on 0.9.34? I've rebooted my computer too, but the version is showing 9.20 in the scrotbar,

I think that is a PATH issue - installing from source installed scrotwm to /usr/local/bin, but installing from from the repos with apt installs into /usr/bin. Once you purge the version from the repos you should er ok, but you might want to have your start up script in /usr/share/xsessions points to the version in /usr/local/bin.

"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Re: [SOLVED]Help with upgrading Scrotwm

^PackRat
That was the case with versions 0.9.31 and earlier. But for some reason, it doesn't seem to start ScrotWM 0.9.34 after I purge the old one installed via apt, even though I've checked all related PATHS. Dunno if it's an issue specific to my box or what hmm

That's why I assumed @h8 had the same issue.

Last edited by gutterslob (2011-10-21 03:31:26)

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

Thanks for all the help guys.

I already --purged scrotwm earlier and deleted my scrot.conf from my home directory(so I have no scrotwm installed on my machine). I should now just start on Step 4?

Last edited by h8uthemost (2011-10-21 04:04:53)

Re: [SOLVED]Help with upgrading Scrotwm

^Good timing. I'm just about to head out for work.

Yeah, starting at step 4 should be good, though I suggest you make sure you have a ~/.scrotwm.conf first. The old one you had with the old version should work fine with 0.9.34 (hope you backed it up). Reason for this is because I'm not entirely sure the source snapshot puts a global config in /etc, at least I don't see any indication of it doing so from your post #7. Even if it did, it defaults to ProFont as the bar_font, which you might not have installed, so just use your old config.

Oh, one more thing. Just make sure no dependencies got purged by accident. If "scrotwm*" was the only thing removed, then you should be good.

Gotta go. I'll check back in when I find the time.

Cheers.

Edit1: In case you don't have a backed up ~/.scrotwm.conf, use this: http://crunchbanglinux.org/pastebin/1254
I posted that for someone else a few days ago. It's a backup I keep for when I feel the need to revert back to the older version in the Debian repos, but it should work with 0.9.34. Just make sure to change the bar_font to something you have. You can adjust colors to your liking and add functions (check the new man page) after you've confirmed it works.

Edit2: Almost forgot, that config in [Edit1] launches the urxvt client (urxvtc) as your terminal. If you don't have the urxvt daemon (urxvtd) loaded at start, then change anything in that config that says "urxvtc" to plain "urxvt" or your other favourite term-emulator. If you don't then Mod+Shift+Enter won't start anything.

Last edited by gutterslob (2011-10-21 04:55:24)

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

Well I followed the steps above, and when I go to log into scrotwm I get this error:

Xsession: unable to launch "/usr/bin/scrotwm" X session --- "/usr/bin/scrotwm" not found; falling back to default session

What a pain this is... I personally think 0.9.34 never installed properly.

EDIT: Nevermind, I finally got it! I chaged the Exec= part in my Scrotwm.desktop from usr/bin to usr/local/bin, and now Scrotwm started up normally. And when I hit Mod+Shift+V the bar now shows 9.34.

Phewww...that surely was a hassle. A huge thanks goes to each and every one of you that lent a hand. But a special thanks to gutterslob.

Last edited by h8uthemost (2011-10-21 05:03:16)

Re: [SOLVED]Help with upgrading Scrotwm

Is /usr/local/bin in your PATH; I always have to add it after a clean install. I actually have a couple lines in my .bashrc for the PATH and the pkg-source (?) file that compiling from source requires. Has saved me many headaches (which has lead to less whiskey, so there is a bit of a down side big_smile)

I'd share those lines, but I'm out of town for a couple weeks and stuck using my rickety work computer - downgraded to Win XP to conform to company policy.

"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Re: [SOLVED]Help with upgrading Scrotwm

Aah, so in the end it was just a simple path issue as PackRat said. Apologies for overlooking the fact that you had "Exec = /path/to/scrotwmexecutable" in your .desktop file (most of us don't use GDM). I figured your Exec line would pe tehpath to your startup script.

Slightly unrelated (but kinda relevant), I now realize why I had troubles installing newer versions on top of the apt installed version now; seems I totally forgot that I symlinked the scrotwm executable directly to a script, and I had overlooked changing the paths in that one.

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

Yeah PackRat was definitely on about this one. I was in a rush last night so I kinda just skimmed past that post. And if knew Terminal lingo a bit better then I would have came across that myself. Oh well, live and learn.

And PackRat unfortunately I don't quite understand your post. I have no idea if my usr/bin/local is in my PATH, or even how to add it. Maybe when you get back on your own computer you can show me exactly what you mean?

And about the startup script, did you guys notice in 9.34 there's now an 'autorun' section in the scrot.conf? You can add whatever you want to that, to have an app autostart on whatever workspace. I added a clipboard manager and it worked perfectly. So hopefully a separate startup script is no longer needed.

But then, I guess I would have to add ten different instances for nitrogen so my wallpaper will show up on all ten workspaces(actually I'll only have to add three since I only use max about three workspaces). The clipboard manager pops up on whatever workspace when I hit the hotkey combo, so I'm hoping something like my wallpaper will also appear on all workspaces(doubt it though).

Re: [SOLVED]Help with upgrading Scrotwm

h8uthemost wrote:

And PackRat unfortunately I don't quite understand your post. I have no idea if my usr/bin/local is in my PATH, or even how to add it. Maybe when you get back on your own computer you can show me exactly what you mean?

Do this in terminal to see what's in your PATH

echo $PATH

As long as /usr/local/bin should be listed, you should be able to install from source and have the newer version start if you "exec scrotwm", even if you did install the older version via apt prior to that. New version won't show in Synaptic, though. Not quite sure on the man pages, though.

Oh, to add something to yor PATH, do;

PATH=$PATH:/blah/blah/blah



And about the startup script, did you guys notice in 9.34 there's now an 'autorun' section in the scrot.conf? You can add whatever you want to that, to have an app autostart on whatever workspace. I added a clipboard manager and it worked perfectly. So hopefully a separate startup script is no longer needed.

Yss, I mentioned that in the "Getting Started with ScrotWM" thread. It's just that I figured you still had your xsession pointed to the script you used to start 0.9.20 and totally forgot to ask you what path you have in it.




But then, I guess I would have to add ten different instances for nitrogen so my wallpaper will show up on all ten workspaces(actually I'll only have to add three since I only use max about three workspaces). The clipboard manager pops up on whatever workspace when I hit the hotkey combo, so I'm hoping something like my wallpaper will also appear on all workspaces(doubt it though).

Not quite sure here, since I don't use nitrogen or a separate clipboard manager. I think the Autorun feature is just limited to launching apps in specific workspaces on startup and doesn't really control where you place apps launched via keybindings or dmenu, though I'm not 100% certain. I don't really play with many of the new features like Autorun or Layouts, tbh.

Last edited by gutterslob (2011-10-21 14:19:15)

Point & Squirt

Re: [SOLVED]Help with upgrading Scrotwm

Ok, thanks for all the useful info, gutterslob.

/usr/local/bin is in my PATH. So I shouldn't have had the problem that I had, right? That's if I'm understanding your explanation correctly, gutter. Which it's quite possible that I'm not. It wouldn't be the first time I misunderstood something.

Re: [SOLVED]Help with upgrading Scrotwm

^The reason you had the problem was because you had "Exec=/usr/bin/scrotwm" in your xsessions, which was the executable for the old 0.9.20 version. It would have worked (as in, it would have launched the new 0.9.34 you installed from source) if it was just the executable "Exec=scrotwm" (since /usr/local/bin/ is usually in your PATH) or the full path to the new executable "Exec=/usr/local/bin/scrotwm"

Like I stated, it's partly my fault as I assumed you would have had something like "Exec=/path/to/your/scrotwm-start-script.sh", in which you would have had the scrotwm executable. Again it was my assumption based on what others with GDM have done on this thread (Gazhole on page 1). I don't use GDM, so I'm sometimes unsure on what you guys keep in your /xsessions.

Last edited by gutterslob (2011-10-21 15:50:02)

Point & Squirt