Я только что перешел на Wayland из XOrg под Ubuntu 17.10.
Скажем, я в Nautilus, и я нажимаю текстовый файл. Раньше для меня было автоматически переключено на gedit (каждый раз, когда я нажимаю на файл, даже если gedit уже открыт).
На Wayland это происходит в первый раз, когда я нажимаю на файл (когда gedit открывается в первый раз), но потом он больше не переключается. gedit просто открывает текстовые файлы в фоновом режиме, даже если не появляется всплывающее окно с сообщением: «blablabla.txt готов в gedit».
В XOrg gnome-shell я имел возможность установить расширение под названием Steal My Focus (есть также обновленная версия для 3.26, которая может быть найдена здесь). Ни один из этих расширений, похоже, больше не работает.
Был также gsetting, который сделал то же самое, что и эти расширения:
gsettings set org.gnome.desktop.wm.preferences focus-new-windows 'strict'
И это, похоже, больше не работает.
Поскольку это происходит сразу после того, как я перешел на Wayland, я предполагаю, что это связано с Wayland.
Любому удалось отключить защиту от кражи фокуса под Wayland. Если нет, у кого-нибудь есть идеи? предложения?
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
В ожидании этого исправления я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор (уведомлять) в панели управления и открыть с помощью меню. В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
В ожидании этого исправления я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор (уведомлять) в панели управления и открыть с помощью меню. В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
В ожидании этого исправления я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор (уведомлять) в панели управления и открыть с помощью меню. В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.
Ну, не уверен, что эта ошибка происходит только на моей машине или если она более распространена. Я могу ошибаться, но я предполагаю, что это, вероятно, связано с некоторыми ограничениями безопасности на wayland, которые не позволяют приложениям фокусировать уже открытые окна (насколько я знаю, оконный менеджер должен обрабатывать эти вещи сейчас, а не сервер отображения, например, в X ). Я предполагаю, что это переходная проблема, и что gnome в конечном итоге даст gedit возможность сфокусировать новые вкладки.
Ожидая этого исправления, я придумал частичное исправление, которое отправит уведомление, когда откроется новая вкладка в gedit. Это не устраняет проблему автофокусировки, но, по крайней мере, она дает вам какую-то подсказку, так что вы не сидите там 2-3 секунды, задаваясь вопросом, почему ваше окно еще не открылось.
В терминале без корня введите:
gedit admin:///usr/bin/gedit-notify
В gedit-notify вставьте следующий скрипт:
#!/bin/bash
# purpose of this script: gedit under gnome Wayland has pretty messed up focusing and activation problems. First document/tab opened will focus normally but all the following ones open in the background without the traditional notification: "Your window is now read, click to focus". Its very distracting behavior because for the first 2 seconds you're wondering if your click was registered or not, if the app opened or not, etc. This script sends a notification every time you open a text file in the background.
skip_list=true # you get notified but your notification list doesn't get spammed.
gedit_inst=$(ps ax|grep " gedit "|wc -l) #total number gedit windows + 1
gedit_inst=$(expr $gedit_inst - 1) #remove one from the count to account for the grep " gedit " process
gedit_s=$(ps ax|grep " gedit -s"|wc -l) # -s switch represents signle / independent instance for gedit.
# gedit_s represents the number of gedit windows running as
# independent instances + 1
gedit_s=$(expr $gedit_s - 1) # same logic as before
gedit_inst=$(expr $gedit_inst - $gedit_s) #substracts the # of windows running in independent instances
#from total cound - because they don't affect the focus behavior.
if [ "$skip_list" = true ]; then
n_arg0="--hint";n_arg1="int:transient:1"
else
n_arg0="-u";n_arg1="low"
fi
if [ "$gedit_inst" = 0 ]; then notify=false;fi
n=0
while true; do
n=$(expr $n + 1)
file=$(eval echo \$$n)
if ! [ -z "$file" ]; then
gedit "$file" &
if [ -z "$err" -o "$err" = 0 ]; then
err="$?"
fi
else
count=$(expr $n - 1)
if [ $count = 0 ]; then
if [ "$notify" != false ]; then notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually.";fi
gedit
fi
break;
fi
done
if [ "$err" = 0 -a "$notify" != false ]; then
if [ $count -gt 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "$count files were opened."
elif [ $count = 1 ]; then
notify-send $n_arg0 $n_arg1 "TEXT EDITOR is ready. Activate it manually." "file: \"$1\""
fi
elif [ "$err" != 0 ]; then
notify-send -i error "TEXT EDITOR: I ran into some error(s) while opening your file(s)."
fi
save gedit-notify , и введите:
cd /usr/bin
sudo chmod +x gedit-notify; sudo touch gedit-notify
gedit admin:///usr/share/applications/gedit-notify.desktop
в gedit-notify.desktop, вставьте следующий код:
[Desktop Entry]
Name=Text Editor (Notify)
Comment=Edit text files
Exec=gedit-notify %U
Terminal=false
Type=Application
StartupNotify=true
Icon=gedit
Categories=GNOME;GTK;Utility;TextEditor;
X-GNOME-DocPath=gedit/gedit.xml
X-GNOME-FullName=Text Editor
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gedit
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=3.22.1
X-GNOME-Bugzilla-ExtraInfoScript=/usr/share/gedit/gedit-bugreport.sh
Actions=new-window;new-document;
Keywords=Text;Editor;Plaintext;Write;
X-Ubuntu-Gettext-Domain=gedit
X-AppStream-Ignore=true
[Desktop Action new-window]
Name=New Window
Exec=gedit --new-window
[Desktop Action new-document]
Name=New Document
Exec=gedit --new-document
Это создаст ярлык на рабочем столе, который будет отображаться как текстовый редактор ( уведомлять) в панели управления и в меню «Открыть». В наутилусе, найдите текстовый файл, щелкните его правой кнопкой мыши, выберите «Свойства», нажмите «Открыть с вкладкой», выберите «Текстовый редактор (уведомление)», установите по умолчанию. Будет 4 или 5 различных типов текстовых файлов, которые должны повторить этот процесс. Промыть и повторить.