Jump to content

Photo

[Solved] how to remove desktop folder/icon in my home folder


Best Answer ylee, 08 July 2017 - 05:18 PM

in bodhi 4 - is there a way - i deleted it and it comes back.  i just see no need to have it there.  never used it from there before .  that is with the pics, download, documents etc. folders.  right hand side of the window.if not possible that is fine - looked into views etc.  and tried to find a place oto maybe uncheck it from showing.  no luck

 
Linux having it's roots in Unix is essentially command line based. GUIs DE's and the like were added latter. But regardless in traditional Unix philosophy most things are handled by a configuration file. In this case take a look at the file ~/.config/user-dirs.dirs.
 
 

It's basically a system folder. Doubt you can remove it.

 
Seeing is believing:
 

mkdir ~/.local/desktop
mv ~/Desktop/* ~/.local/desktop/
rmdir ~/Desktop
sed -i 's/Desktop/.local\/desktop/g' ~/.config/user-dirs.dirs

 
Now log out and log back in. Open a terminal and list (ls) the contents of your home Folder and you will note Desktop is gone. Well hidden in ~/.local/desktop.
 
To make it not display in the left panel of PcManFm, in PcManFm's menu click Edit->Preferences and then click Layout in the Preferences window. Uncheck Desktop under Show in Places. If you use some other file manager look thru Preferences or Options or consult the user documentation for the program.

Now you can go on as if the Desktop folder doesn't exist.

 

NOTE: There are multiple ways to achieve this end result, what is given here I have decided is the simplist and safest. I leave a Desktop folder hidden under ~/.local because some apps may use the $XDG_DESKTOP_DIR variable and it needs to be defined for that reason. 

Go to the full post


  • Please log in to reply
20 replies to this topic

#1 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 06 July 2017 - 06:33 PM

in bodhi 4 - is there a way - i deleted it and it comes back.  i just see no need to have it there.  never used it from there before .  that is with the pics, download, documents etc. folders.  right hand side of the window.if not possible that is fine - looked into views etc.  and tried to find a place oto maybe uncheck it from showing.  no luck





A big thank you to everyone who contributes to Bodhi Linux


#2 Randy

Randy

    Bodhi-Care

  • Members
  • 646 posts
  • LocationFort Wayne, IN USA

Posted 07 July 2017 - 01:28 PM

It's basically a system folder. Doubt you can remove it.


Randy Fry



Linux Addict!

#3 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 07 July 2017 - 01:47 PM

Ok - i did do it in 3.  so i had to asked looked all over.  Thanks Randy!  I'll live with it - i just do not see a need for it or use it from that area. 

 

:-)))



#4 Randy

Randy

    Bodhi-Care

  • Members
  • 646 posts
  • LocationFort Wayne, IN USA

Posted 07 July 2017 - 10:22 PM

There still might be a hack to get rid of it, but it would take some google-ing!


Randy Fry



Linux Addict!

#5 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 07 July 2017 - 10:36 PM

Naw that's cool! don't waste your time.  I am fine.



#6 birdmun

birdmun

    Member

  • Members
  • 394 posts
  • LocationWabash, IN

Posted 08 July 2017 - 12:31 AM

I am sure there is a way to rid yourself of that folder. As I recall, the earlier versions of bodhi didn't have nearly as many folders to start with as we have now. Somewhere there is a default profile or some such that says the user should have "this".



#7 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 12:33 AM

i looked - but nothing.  may have to check it tomorrow when i get some time again.  Thanks birdmun.



#8 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 12:41 AM

in edit>preferences>layout desktop is unchecked but it appears and i figured that is the only place to set what appears.  no problem - if it cannot be done then it cannot be done.

 

:-)



#9 ylee

ylee

    King of the Software Page

  • Moderators
  • 1580 posts
  • LocationSouth Carolina, USA

Posted 08 July 2017 - 05:18 PM   Best Answer

in bodhi 4 - is there a way - i deleted it and it comes back.  i just see no need to have it there.  never used it from there before .  that is with the pics, download, documents etc. folders.  right hand side of the window.if not possible that is fine - looked into views etc.  and tried to find a place oto maybe uncheck it from showing.  no luck

 
Linux having it's roots in Unix is essentially command line based. GUIs DE's and the like were added latter. But regardless in traditional Unix philosophy most things are handled by a configuration file. In this case take a look at the file ~/.config/user-dirs.dirs.
 
 

It's basically a system folder. Doubt you can remove it.

 
Seeing is believing:
 

mkdir ~/.local/desktop
mv ~/Desktop/* ~/.local/desktop/
rmdir ~/Desktop
sed -i 's/Desktop/.local\/desktop/g' ~/.config/user-dirs.dirs

 
Now log out and log back in. Open a terminal and list (ls) the contents of your home Folder and you will note Desktop is gone. Well hidden in ~/.local/desktop.
 
To make it not display in the left panel of PcManFm, in PcManFm's menu click Edit->Preferences and then click Layout in the Preferences window. Uncheck Desktop under Show in Places. If you use some other file manager look thru Preferences or Options or consult the user documentation for the program.

Now you can go on as if the Desktop folder doesn't exist.

 

NOTE: There are multiple ways to achieve this end result, what is given here I have decided is the simplist and safest. I leave a Desktop folder hidden under ~/.local because some apps may use the $XDG_DESKTOP_DIR variable and it needs to be defined for that reason. 


"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#10 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 05:31 PM

ok - i will try this a bit later.  man you guys know so much!!!!  had a long morning outside and just came in to shower and cool doen and have glass of wine from the vineyard and plan tomorrow.  have to train a dog and then harvest and take care of other stuff after all of the rains. I know too much info.  i am just taking care of notes as such and will do this later.

 

again no biggie is i can't but i just see no meed for having it there. doubly redundant.  Thank you YLEE!



#11 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 07:06 PM

 
zen@zen:~$ mkdir ~/.local/desktop
zen@zen:~$ mv ~/Desktop/* ~/.local/desktop/
mv: cannot stat '/home/zen/Desktop/*': No such file or directory
zen@zen:~$
 
 
got this now what?


#12 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 07:08 PM

ok i pasted the other lines and logged out and logged back in and no desktop in my home folder.  so it works.  Thanks Ylee.

 

weird that you get the no such file or directory.  but it works.

 

i can pick through a few of the partial commands but the rest i am lost  ---- but it works.  Thank you!



#13 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 08:48 PM

ok did it to my wife's laptop and she never got the 'no such file or directory' that is strange both thinkpads of mine had that.  she has a dell inspiron.  will try the old tp now.

 

ok nothing went wrong with the old tp re: said message.  SO - Ylee - did anything go wrong on the first 2 laptops that exhibited the message i included above?  even though the desktop icon IS removed.  did it go where it was supposed to go?  why the error?  thanks again.  just curious.



#14 ylee

ylee

    King of the Software Page

  • Moderators
  • 1580 posts
  • LocationSouth Carolina, USA

Posted 08 July 2017 - 11:03 PM

The error message is harmless, it indicates you have deleted everything in your Desktop folder sometime in the past. If the Desktop folder is gone from your home directory it worked as it should. No worries  B)


"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#15 ylee

ylee

    King of the Software Page

  • Moderators
  • 1580 posts
  • LocationSouth Carolina, USA

Posted 08 July 2017 - 11:06 PM

...

 

i can pick through a few of the partial commands but the rest i am lost  ---- but it works.  Thank you!

 

I could have gave you directions to do all the above without using the command line. Open PcManFm and ....

 

But it would have been more text to type and a larger chance you might do it wrong. CLI is far simpler here for me to explain. It may be a worthwhile exercise for you to try to understand the commands above but it is hardly necessary.


"No technology can ever be too arcane or complicated for the black t-shirt crowd."


#16 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 08 July 2017 - 11:22 PM

Thanks.   No i was just trying to start to try to understand a bit of what these commands are doing and what they refer to.

 

mkdir - remember from ms dos days...

 

trying see about what looks like paths.  and the ~ thingie that refers to user?/home?  (not root i guess.)  see i really am quite stupid about this.

 

i also know just copy and paste and run the stuff but if i can start to even see a bit I am farther along than i was before.

 

Hope this makes sense!

 

Thank you!

 

Oh - i may have tried to delete the folders on my 2 TP's but not the other 2 - so that is probably why - like you said - i get the weird message.

 

:-)

 

Thanks my friend! I appreciate it.



#17 birdmun

birdmun

    Member

  • Members
  • 394 posts
  • LocationWabash, IN

Posted 09 July 2017 - 02:15 AM

You guessed correctly on the ~ it is shorthand in the CLI for /home/yourusername in your case it is shorthand for /home/zen. If you cd /usr and then cd ~ you will return home. As it goes, you can simply type cd and hit enter and return home as well. But, that is a whole different can of worms. :P There is a guy named Joe Collins on youtube that has a whole batch of beginner-esque videos including making use of the CLI.

 

mkdir and rmdir you already understand. mv is more of a Cut and Paste. It can also be used as a rename. Sometimes I use mv to just rename a config file or folder so that when the updated file is created or swapped in, I have the old version in case something is broken in the new version. It would look like mv my.conf my.conf.old. That way no worries. Worst case I have to boot a livecd and swap the files to get my system working again.

 

I confess that sed is a command I have seen a number of times and yet have no clue what it really does. I know it has a second cousin thrice removed called awk. I am similarly clueless. :P In either case man sed could be your friend if you didn't have access to the internet.



#18 graywizardlinux

graywizardlinux

    Bodhi Supporter

  • Members
  • 1066 posts

Posted 09 July 2017 - 10:54 AM

Thanks so much - i will check the guy out - maybe later today if i can find some down time or tomorrow after i get some stuff done outside.  Home alone for a few days so catch up work outside but also inside prepping harvest stuff and chillin in the heat too.

 

Thanks birdmun!



#19 bob rashkin

bob rashkin

    Member

  • Members
  • 455 posts
  • Location26.13N, 97.63W

Posted 09 July 2017 - 11:01 AM

https://ss64.com/bash/sed.html


Bob Rashkin

#20 ylee

ylee

    King of the Software Page

  • Moderators
  • 1580 posts
  • LocationSouth Carolina, USA

Posted 09 July 2017 - 11:07 AM

...
I confess that sed is a command I have seen a number of times and yet have no clue what it really does. I know it has a second cousin thrice removed called awk. I am similarly clueless. :P In either case man sed could be your friend if you didn't have access to the internet.

 
Wikipedia is a great source of information on many Linux/Unix commands, from the sed article:
 

sed (stream editor) is a Unix utility that parses and transforms text, using a simple, compact programming language.

 
My usage of sed here
 

sed -i 's/Desktop/.local\/desktop/g' ~/.config/user-dirs.dirs

is an in place editing of the file ~/.config/user-dirs.dirs. Much like the wikipedia example:
  

sed -i 's/abc/def/' fileName

The sed command I use above substitutes the string .local/desktop wherever it finds  Desktop. I have to put the \ character in front of the / character in .local/desktop giving .local\/desktop to keep sed from getting confused since the / character has special meaning to sed. Hence the original user-dirs.dirs file:
 

 

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

is transformed to:
 

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/.local/desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

 

Since sed supports regular expressions advanced uses of it can be rather hard to understand. Fortunately the command i needed was rather simple.


"No technology can ever be too arcane or complicated for the black t-shirt crowd."





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users