Gedit não iniciando

0

Por algum motivo, o gedit não é iniciado. Aqui está a saída que dá:

chris@Chris-Ubuntu-Laptop:~$ gedit
chris@Chris-Ubuntu-Laptop:~$ 

Descritivo, vamos tentar a ajuda.

chris@Chris-Ubuntu-Laptop:~$ gedit --help
chris@Chris-Ubuntu-Laptop:~$ 

Isso também não funciona. Eu tentei abrir um arquivo. As técnicas de lançamento da GUI também falham. Os esforços baseados no Synaptic e no terminal para reinstalar falham. A única coisa que funciona é usando o sudo. Eu não quero correr como um super usuário, então eu não quebro acidentalmente algo (não parece estar ajudando: D). Ah, sim, notei isso quando estava executando um script de shell que testei. Aqui está:

#/bin/bash

##Copyright 2012 Christopher David King
##Email: [email protected]
##
##This program is free software: you can redistribute it and/or modify
##it under the terms of the GNU General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##This program is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU General Public License for more details.
##
##You should have received a copy of the GNU General Public License
##along with this program.  If not, see <http://www.gnu.org/licenses/>.

##usage: [-h]|[--help]|[-u] [filename] [mode]
##Helps to create new scripts. It will open them in a text editor of your choice (gedit by default) and give it the permissions you want (777 by default.)
##-u, uninteractive, will automatically overwrite scripts, and will fail if a file name is not supplied
##-h Display this help.
##--help Display this help.

if [ -w ~/bin ]; then cd ~/bin; fi #Work in the user's bin folder.

usage() #This is for help
{
    cat <<- _EOF_
    usage: [-h|--help] [-q|--quite] [filename] [text_editor] [mode]

    Helps to create new scripts. It will open them in a text editor of your choice (gedit by default) and give it the permissions you want (777 by default.)

    Options:

    -q, --quiet Will not prompt user for input. Will fail if no filename given. Will automatically overwrite files if necesary.
    -h, --help Display this help.
    _EOF_
}
interactive=0
if [ "$1" = "-q" ] || [ "$1" = "--quiet" ]; then
    interactive=1
    shift
fi

case $1 in
    "" ) if [ "$interactive" = "0" ]; then
            echo -n "What will you name your script? >" #In case they forgot, we do not want to crash
            read name
         else
        echo "No file supplied." 1>&2
        exit 1
         fi;;

    "-h" | "--help") usage
                     exit 0;;
    * ) name=$1;;

esac

mode=777 #A default
command="gedit +2 -b" #Also a default

case $2 in
    [0-8][0-8][0-8] ) mode=$2; shift;; #I will adapt it in the future to accept more values of chmod
esac

case $2 in
    "" ) :;;
    * ) command=$2
esac

if [ -f $name ] && [ "$interactive" = "0" ]; then
    echo -n "The file \"$name\" exists. Do you want to overwrite it? (y/n)>"
    read response
    if [ $response = 'n' ]; then
        echo "Exiting"
        exit 0
    fi
fi

echo -e "#/bin/bash\n\nexit 0" > $name #add in the first line of any shell script
$command $name #Go to line 2, since the first was already done for them. Also, make sure gedit doesn't close when the terminal does, and it doesn't block the terminal.
chmod $mode $name

exit 0

Espero que não o tenha quebrado.

    
por PyRulez 14.11.2012 / 01:21

1 resposta

3

Parece que você tem um falso gedit no seu $PATH , pode ser criado por esse script. Experimente type gedit para descobrir qual gedit é realmente lançado.

    
por Dennis Kaarsemaker 14.11.2012 / 01:26