Si të përdorni Thunar si parazgjedhje në Ubuntu

kodi ubuntu

Sistemi operativ Ubuntu përfshin menaxherin e skedarëve Nautilus si parazgjedhje. Megjithëse disa njerëz preferojnë programe të tjera kur menaxhojnë mjedisin e tyreDo të ishte e vështirë të përfshihen disa prej tyre për të akomoduar të gjitha shijet, veçanërisht pasi që shumë varen nga disa lloje të tryezave.

Prandaj, në këtë udhëzues do të shpjegojmë si ta vendosni shfletuesin Thunar si aplikacionin e paracaktuar në sistemin tuaj Ubuntu. Do të keni disa metoda që ju të zgjidhni atë që i përshtatet më së miri shijes tuaj.

Megjithëse mënyra e rekomanduar nga njerëzit e Canonical është metoda manuale, ne ju lëmë edhe dy të tjerë në mënyrë që të mund të vendosni për atë që është më komode për ju.

Aktivizimi i Thunar manualisht

Konfigurimi i paracaktuar i sistemit Ubuntu mbishkruhet me atë të veçantë të secilit përdorues, i cili ndodhet në direktori shtëpi secili. Ne do të hyjmë në itinerarin . / .lokale / ndajnë / aplikacione (dhe mos harroni se i referohet direktorisë shtëpi dhe jo në direktori usr) Dhe ne do të krijojmë një skedar të quajtur thunar.desktop me informacionin e mëposhtëm:

[Desktop Entry]
Name=Open Folder
TryExec=thunar
Exec=thunar %U
NoDisplay=true
Terminal=false
Icon=folder-open
StartupNotify=true
Type=Application
MimeType=x-directory/gnome-default-handler;x-directory/normal;inode/directory;application/x-gnome-saved-search;

atëherë redaktoni skedarin e parazgjedhjeve.list E vendosur në . / .lokale / ndajnë / aplikacione dhe futni linjat vijuese:

inode/directory=thunar.desktop
x-directory/normal=thunar.desktop

Me këtë, llojet MIME do të shoqërohen me thunar dhe ju do të jeni në gjendje të shihni efektet menjëherë, pa pasur nevojë të rindizni kompjuterin.

Aktivizimi i Thunar përmes skriptit

Për të ekzekutuar sa vijon dorëshkrim, kopjoni kodin që lëmë më poshtë në një skedar që krijoni në direktorinë tuaj shtëpi. Në udhëzuesin tonë do ta emërtojmë si parazgjedhur

#!/bin/bash

## Originally written by aysiu from the Ubuntu Forums
## This is GPL'ed code
## So improve it and re-release it

## Define portion to make Thunar the default if that appears to be the appropriate action
makethunardefault()
{
## I went with --no-install-recommends because
## I didn't want to bring in a whole lot of junk,
## and Jaunty installs recommended packages by default.
echo -e "\nMaking sure Thunar is installed\n"
sudo apt-get update && sudo apt-get install thunar --no-install-recommends

## Does it make sense to change to the directory?
## Or should all the individual commands just reference the full path?
echo -e "\nChanging to application launcher directory\n"
cd /usr/share/applications
echo -e "\nMaking backup directory\n"

## Does it make sense to create an entire backup directory?
## Should each file just be backed up in place?
sudo mkdir nonautilusplease
echo -e "\nModifying folder handler launcher\n"
sudo cp nautilus-folder-handler.desktop nonautilusplease/

## Here I'm using two separate sed commands
## Is there a way to string them together to have one
## sed command make two replacements in a single file?
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-folder-handler.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-folder-handler.desktop
echo -e "\nModifying browser launcher\n"
sudo cp nautilus-browser.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop --browser/thunar/g' nautilus-browser.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-browser.desktop
echo -e "\nModifying computer icon launcher\n"
sudo cp nautilus-computer.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-computer.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-computer.desktop
echo -e "\nModifying home icon launcher\n"
sudo cp nautilus-home.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-home.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-home.desktop
echo -e "\nModifying general Nautilus launcher\n"
sudo cp nautilus.desktop nonautilusplease/
sudo sed -i -n 's/Exec=nautilus/Exec=thunar/g' nautilus.desktop

## This last bit I'm not sure should be included
## See, the only thing that doesn't change to the
## new Thunar default is clicking the files on the desktop,
## because Nautilus is managing the desktop (so technically
## it's not launching a new process when you double-click
## an icon there).
## So this kills the desktop management of icons completely
## Making the desktop pretty useless... would it be better
## to keep Nautilus there instead of nothing? Or go so far
## as to have Xfce manage the desktop in Gnome?
echo -e "\nChanging base Nautilus launcher\n"
sudo dpkg-divert --divert /usr/bin/nautilus.old --rename /usr/bin/nautilus && sudo ln -s /usr/bin/thunar /usr/bin/nautilus
echo -e "\nRemoving Nautilus as desktop manager\n"
killall nautilus
echo -e "\nThunar is now the default file manager. To return Nautilus to the default, run this script again.\n"
}

restorenautilusdefault()
{
echo -e "\nChanging to application launcher directory\n"
cd /usr/share/applications
echo -e "\nRestoring backup files\n"
sudo cp nonautilusplease/nautilus-folder-handler.desktop .
sudo cp nonautilusplease/nautilus-browser.desktop .
sudo cp nonautilusplease/nautilus-computer.desktop .
sudo cp nonautilusplease/nautilus-home.desktop .
sudo cp nonautilusplease/nautilus.desktop .
echo -e "\nRemoving backup folder\n"
sudo rm -r nonautilusplease
echo -e "\nRestoring Nautilus launcher\n"
sudo rm /usr/bin/nautilus && sudo dpkg-divert --rename --remove /usr/bin/nautilus
echo -e "\nMaking Nautilus manage the desktop again\n"
nautilus --no-default-window &

## The only change that isn't undone is the installation of Thunar
## Should Thunar be removed? Or just kept in?
## Don't want to load the script with too many questions?
}



## Make sure that we exit if any commands do not complete successfully.
## Thanks to nanotube for this little snippet of code from the early
## versions of UbuntuZilla
set -o errexit
trap 'echo "Previous command did not complete successfully. Exiting."' ERR


## This is the main code
## Is it necessary to put an elseif in here? Or is
## redundant, since the directory pretty much
## either exists or it doesn't?
## Is there a better way to keep track of whether
## the script has been run before?
if [[ -e /usr/share/applications/nonautilusplease ]]; then

restorenautilusdefault

else

makethunardefault

fi;

Pastaj, ngjisni komandat e mëposhtme në terminalin tuaj dhe do të keni përfunduar:

chmod +x defaultthunar
./defaultthunar

Aktivizimi i Thunar për GUI Lovers

Së fundmi, për ata prej jush që nuk po kërkoni shumë ndërlikime dhe që ju pëlqen konfiguroni sistemin nga një ambient dritarës, provoni të ekzekutoni komandën e mëposhtme nga tastiera e terminalit:

exo-preferred-applications

Tjetra, do të shfaqet një dritare si më poshtë, nga e cila mund të zgjidhni menaxherin tuaj:

Zgjedhja e tunarit të paracaktuar


Lini komentin tuaj

Adresa juaj e emailit nuk do të publikohet. Fusha e kërkuar janë shënuar me *

*

*

  1. Përgjegjës për të dhënat: Miguel Ángel Gatón
  2. Qëllimi i të dhënave: Kontrolloni SPAM, menaxhimin e komenteve.
  3. Legjitimimi: Pëlqimi juaj
  4. Komunikimi i të dhënave: Të dhënat nuk do t'u komunikohen palëve të treta përveç me detyrim ligjor.
  5. Ruajtja e të dhënave: Baza e të dhënave e organizuar nga Occentus Networks (BE)
  6. Të drejtat: Në çdo kohë mund të kufizoni, rikuperoni dhe fshini informacionin tuaj.