You are not logged in.
Hi.
How i make to copy just only line in text file with cat?
For example:
[:0.0]
file=/home/Arch/./.wallpaper.png
mode=0
bgcolor=# 0 0 0
I want copy just "/home/Arch/./.wallpaper.png" part.
Actually i want create a shortcut for last wallpaper set from Nitroget, then i put this in SLim background.
Recently i use hsetroot for wallpaper (~/.wallpaper.png) and i create a shortcut in /usr/share/slim/theme/MYTHEME whith ln -s ~/.wallpaper.png /usr/share/slim/theme/MYTHEME/background.png.
I want make a same with Nitrogen.
I now this looks like crazy, but...
Sorry my English.
Last edited by kramerxiita (2008-06-04 16:50:48)
Offline
Have you tried restore option
Mr Green
Offline
Yes, don't work for create shortcut for image.
Offline
Just adding something. My idea is when a change wallpaper, SLim backgroung change too.
When a use hsetroot this happen.
Thanks
Offline
"sed -n 2p file.txt". Where 2 is the line number that you want from file.txt.
Last edited by kishd (2008-06-03 19:43:03)
---for there is nothing either good or bad, but only thinking makes it so....
Hamlet, W Shakespeare
Offline
How can you make SliM change the background ? You link the theme background to another file ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
How can you make SliM change the background ? You link the theme background to another file ?
Yes. In theme directory i put background.png shortcut for my wallpaper. So, when a change wallpaper, slim background change too.
Example:
ln -s mywallpaper.png /usr/share/slim/themes/default/background.png
So, Slim background always is my wallpaper.
Offline
Don't really know too much about linux commands. Perhaps using cat -n which places line numbers in each line and pipe the result to grep eg. cat -n file.txt | grep 2 | to sed etc to get rid of the line number.
try this and don't work.
Thanks anyway.
Offline
moljac024 wrote:How can you make SliM change the background ? You link the theme background to another file ?
Yes. In theme directory i put background.png shortcut for my wallpaper. So, when a change wallpaper, slim background change too.
Example:
ln -s mywallpaper.png /usr/share/slim/themes/default/background.png
So, Slim background always is my wallpaper.
So the wallpaper has to be a *.png ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
kramerxiita wrote:moljac024 wrote:How can you make SliM change the background ? You link the theme background to another file ?
Yes. In theme directory i put background.png shortcut for my wallpaper. So, when a change wallpaper, slim background change too.
Example:
ln -s mywallpaper.png /usr/share/slim/themes/default/background.png
So, Slim background always is my wallpaper.
So the wallpaper has to be a *.png ?
No, jpg is possible. But when you create a symbolic link, remember put the extension too. If change png to jpg, change a symbolic link extension.
But, remember if slim theme directory have background.png and background.jpg, Slim always choice .png. So, put only one this.
Offline
cat file | awk -F= '$1 ~ /^file$/ {print $2}'
here's a oneliner to make the link:
F=$( cat test | awk -F= '$1 ~ /^file$/ {print $2}' ) ln -s $( basename $F ) $F
Last edited by klixon (2008-06-03 23:52:03)
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
cat file | awk -F= '$1 ~ /^file$/ {print $2}'
here's a oneliner to make the link:
F=$( cat test | awk -F= '$1 ~ /^file$/ {print $2}' ) ln -s $( basename $F ) $F
First thanks a lot for reply.
But, i don't understand. When a put a patch for files...
It could give me an example?
Thanks
Offline
just replace "file" with the actual filename, or replace "cat file" with the program that gives the output.
I saved the few lines you give in a file called "file" to test if it works. Cat just prints it, the awk-statement does the actual work.
It splits the lines into field using "=" as field seperator (-F= ) and checks if the first field is "file" ($1 ~ /^file$/), if so it prints the second field...
Last edited by klixon (2008-06-04 05:29:55)
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
So, command will be like this?
F=$( cat ~/.config/nitrogen/bg-saved.cfg | awk -F= '$1 ~ /^file$/ {print $2}' ) ln -s $( basename $F ) shortcut.png
A try this and don't work.
Offline
Stupid me for reading wrong
ln -s $( awk -F= '$1 ~ /^file$/ {print $2}' ~/.config/nitrogen/bg-saved.cfg ) /usr/share/slim/theme/MYTHEME/background.png
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
\o/
This work perfect.
Thanks very very much, klixon.
Offline
My pleasure. Glad it worked.
Can you mark the thread [solved]?
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Make this.
Just another question.
This command don't accept large names.
Example:
Work: myimage.png
Don't work: my image.png
There a fix for this?
Offline
The problem is with ln -s command, does not recognize space like terminal. For example:
In terminal: My\ Image.png
With avk command: My image.png
But i don't know as fix this, and make avk insert space or \ and shortcut work with name and spaces.
Offline
I understand the problem, but i'm too tired to think of something just now
Lemme sleep on in and hopefully i'll be able to cook something up tomorrow
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
The problem is with ln -s command, does not recognize space like terminal. For example:
In terminal: My\ Image.png
With avk command: My image.pngBut i don't know as fix this, and make avk insert space or \ and shortcut work with name and spaces.
I think enclosing the command expansion in quotes would work.
You can spell it My\ Image.png or "My Image.png"
Offline
kramerxiita wrote:The problem is with ln -s command, does not recognize space like terminal. For example:
In terminal: My\ Image.png
With avk command: My image.pngBut i don't know as fix this, and make avk insert space or \ and shortcut work with name and spaces.
I think enclosing the command expansion in quotes would work.
You can spell it My\ Image.png or "My Image.png"
And how make this?
Offline
Maybe klixon know how make.
Sorry for up this topic, but a still try this work.
Offline
target=$( awk -F= '$1 ~ /^file$/ {print $2}' ~/.config/nitrogen/bg-saved.cfg ); ln -s "${target}" /usr/share/slim/theme/MYTHEME/background.png
This seems to work...
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Perfect now.
Thank you very very much, klixon.
Sorry for boring you.
Offline