Гедит не бери

По какой-то причине, gedit не запускается. Вот результат, который он дает:

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

Описательный, давайте попробуем помощь.

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

Так что это тоже не работает. Я пытался открыть файл. Методы запуска GUI тоже терпят неудачу. Синаптические и терминальные попытки переустановить не удаются. Единственное, что работает, это использование sudo. Я не хочу работать как суперпользователь, поэтому я не случайно что-то сломал (похоже, не помогает: D). О да, я заметил это, когда запускал сценарий оболочки, который я тестировал. Вот оно:

#/bin/bash

##Copyright 2012 Christopher David King
##Email: G.nius.ck@gmail.com
##
##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

Я надеюсь, что это не сломало.

0
задан 14 November 2012 в 04:21

1 ответ

Похоже, у вас есть фиктивный gedit на вашем $PATH, который может быть создан этим сценарием. Попробуйте type gedit выяснить, какой gedit действительно запущен.

0
ответ дан 14 November 2012 в 04:21

Другие вопросы по тегам:

Похожие вопросы: