Как обнаружить и убить синергию, если моя игра загружается?

Таким образом, я просто получил свой удар ногами в нескольких играх Battle.Net (в частности, StarCraft), потому что он ненавидит синергию. Причины очевидны, так как это действительно интенсивная игра с мышью, которая контролирует все, когда вы ее запускаете. У меня есть псевдонимы для запуска и остановки синергии, но проблема в том, что я продолжаю забывать использовать их, прежде чем начать игру, и после этого я уже совершен. Это ДЕЙСТВИТЕЛЬНО нервничает.

Игра установлена ​​с использованием PlayOnLinux. Какой сценарий я редактирую, чтобы вставить что-то, что убьет синергию? Имеет ли PlayOnLinux стандартное место для размещения пользовательских скриптов или есть некоторые стандартизированные средства для выполнения такого рода вещей?

Новая информация - Найдено:

/usr/share/playonlinux/playonlinux --run "Battle.Net" %F

Это подходит или есть лучшее место?

0
задан 9 April 2017 в 02:54

4 ответа

Вместо того, чтобы редактировать чужой скрипт, я написал обертку. Этот скрипт обрабатывает pulseaudio и синергию достаточно хорошо, но сама команда playonlinux является проблемой, потому что она возвращается, и мне нужно придумать способ заставить мой скрипт ждать ... или, может быть, нет. Я мог бы написать это, чтобы опросить игру, чтобы увидеть, работает ли она.

... ОК, я переписал его, чтобы включить цикл опроса. У меня есть одна последняя проблема, и если это не работает из ярлыка.

... ОК была проблема с запуском из ярлыка, но добавление '& amp;' в конце команды playonlinux, похоже, обратился к ней.

#!/bin/bash

#The idea is to use this script to replace the command in the shortcut.
#
# Architectural & contextual notes: This is a desktop ( my wargamer's box called
# Warmachine ) which has a synergy server running on it and also a laptop that
# runs a synergy client. Synergy & pulseaudio must die in order for the game to
# play correctly. Synergy must die on both machines but pulseaudio is an issue
# local to the desktop. The Synergy client running remotely must die because it
# freaks out when it can't find the server. The most annoying effect of this is
# a shrieking laptop fan while you are trying to conentrate when it isn't even
# supposed to be doing anything. I have aliases for all these functions and I'm
# really just putting them into a wrapper script form because I keep forgetting
# to use them.
#
# In order for the sudo commands to work in a non-interactive fashion
# i.e., without a password, you need the following entry in your sudoers file:
# [username goes here] ALL=(root) NOPASSWD: /usr/sbin/service avahi-daemon restart, /usr/bin/killall synergys
# ...and this one on the laptop:
# [username goes here] ALL=(root) NOPASSWD: /usr/bin/killall synergyc, /home/jim/scripts/restartSynergy.sh
# I use a special script to restart synergy on the laptop as it includes a
# screen resizing background process that fixes the synergy screen size
# when it swtches from the laptops display to the 42" TV I use for a regular
# game display.

#kpa - Kill Pulse Audio alias
#We are killing pulseaudio because WINE hates it.

echo "autospawn = no" > ~/.config/pulse/client.conf &
pulseaudio --kill

#Now we need to kill our synergy server and also stop the client in my laptop.

ssh -t -t bl sudo /usr/bin/killall synergyc &
sudo /usr/bin/killall synergys

sleep 1

# This is the command to start the game. This is what the script is wrapping.
# Unfortunately this command returns as soon as it is called regardless, so I
# need to come up with something to deal with that. Perhaps a polling system?
# The apparently extraneous '&' below fixes an issue.
/usr/share/playonlinux/playonlinux --run "Battle.Net" %F &

sleep 1

#This is our polling loop.
EXIT=0
while [ ${EXIT} -eq 0 ]; do
  sleep 5

  ps aux | grep -v grep | grep Battle\.Net
  EXIT=$?
  if [[ ${EXIT} != 0 ]]; then

    #spa - Start Pulse Audio alias
    rm -f ~/.config/pulse/client.conf
    pulseaudio --start

    # Reload the audio devices in the GUI
    sudo /usr/sbin/service avahi-daemon restart &

    /usr/bin/synergys -a 127.0.0.1 -c /etc/synergy.conf
    sleep 1
    #Restart synergy client on laptop.
    ssh -t -t bl /home/jim/scripts/restartSynergy.sh

  fi

done
0
ответ дан 22 May 2018 в 23:51

Вместо того, чтобы редактировать чужой скрипт, я написал обертку. Этот скрипт обрабатывает pulseaudio и синергию достаточно хорошо, но сама команда playonlinux является проблемой, потому что она возвращается, и мне нужно придумать способ заставить мой скрипт ждать ... или, может быть, нет. Я мог бы написать это, чтобы опросить игру, чтобы увидеть, работает ли она.

... ОК, я переписал его, чтобы включить цикл опроса. У меня есть одна последняя проблема, и если это не работает из ярлыка.

... ОК была проблема с запуском из ярлыка, но добавление '& amp;' в конце команды playonlinux, похоже, обратился к ней.

#!/bin/bash #The idea is to use this script to replace the command in the shortcut. # # Architectural & contextual notes: This is a desktop ( my wargamer's box called # Warmachine ) which has a synergy server running on it and also a laptop that # runs a synergy client. Synergy & pulseaudio must die in order for the game to # play correctly. Synergy must die on both machines but pulseaudio is an issue # local to the desktop. The Synergy client running remotely must die because it # freaks out when it can't find the server. The most annoying effect of this is # a shrieking laptop fan while you are trying to conentrate when it isn't even # supposed to be doing anything. I have aliases for all these functions and I'm # really just putting them into a wrapper script form because I keep forgetting # to use them. # # In order for the sudo commands to work in a non-interactive fashion # i.e., without a password, you need the following entry in your sudoers file: # [username goes here] ALL=(root) NOPASSWD: /usr/sbin/service avahi-daemon restart, /usr/bin/killall synergys # ...and this one on the laptop: # [username goes here] ALL=(root) NOPASSWD: /usr/bin/killall synergyc, /home/jim/scripts/restartSynergy.sh # I use a special script to restart synergy on the laptop as it includes a # screen resizing background process that fixes the synergy screen size # when it swtches from the laptops display to the 42" TV I use for a regular # game display. #kpa - Kill Pulse Audio alias #We are killing pulseaudio because WINE hates it. echo "autospawn = no" > ~/.config/pulse/client.conf & pulseaudio --kill #Now we need to kill our synergy server and also stop the client in my laptop. ssh -t -t bl sudo /usr/bin/killall synergyc & sudo /usr/bin/killall synergys sleep 1 # This is the command to start the game. This is what the script is wrapping. # Unfortunately this command returns as soon as it is called regardless, so I # need to come up with something to deal with that. Perhaps a polling system? # The apparently extraneous '&' below fixes an issue. /usr/share/playonlinux/playonlinux --run "Battle.Net" %F & sleep 1 #This is our polling loop. EXIT=0 while [ ${EXIT} -eq 0 ]; do sleep 5 ps aux | grep -v grep | grep Battle\.Net EXIT=$? if [[ ${EXIT} != 0 ]]; then #spa - Start Pulse Audio alias rm -f ~/.config/pulse/client.conf pulseaudio --start # Reload the audio devices in the GUI sudo /usr/sbin/service avahi-daemon restart & /usr/bin/synergys -a 127.0.0.1 -c /etc/synergy.conf sleep 1 #Restart synergy client on laptop. ssh -t -t bl /home/jim/scripts/restartSynergy.sh fi done
0
ответ дан 18 July 2018 в 15:19

Вместо того, чтобы редактировать чужой скрипт, я написал обертку. Этот скрипт обрабатывает pulseaudio и синергию достаточно хорошо, но сама команда playonlinux является проблемой, потому что она возвращается, и мне нужно придумать способ заставить мой скрипт ждать ... или, может быть, нет. Я мог бы написать это, чтобы опросить игру, чтобы увидеть, работает ли она.

... ОК, я переписал его, чтобы включить цикл опроса. У меня есть одна последняя проблема, и если это не работает из ярлыка.

... ОК была проблема с запуском из ярлыка, но добавление '& amp;' в конце команды playonlinux, похоже, обратился к ней.

#!/bin/bash #The idea is to use this script to replace the command in the shortcut. # # Architectural & contextual notes: This is a desktop ( my wargamer's box called # Warmachine ) which has a synergy server running on it and also a laptop that # runs a synergy client. Synergy & pulseaudio must die in order for the game to # play correctly. Synergy must die on both machines but pulseaudio is an issue # local to the desktop. The Synergy client running remotely must die because it # freaks out when it can't find the server. The most annoying effect of this is # a shrieking laptop fan while you are trying to conentrate when it isn't even # supposed to be doing anything. I have aliases for all these functions and I'm # really just putting them into a wrapper script form because I keep forgetting # to use them. # # In order for the sudo commands to work in a non-interactive fashion # i.e., without a password, you need the following entry in your sudoers file: # [username goes here] ALL=(root) NOPASSWD: /usr/sbin/service avahi-daemon restart, /usr/bin/killall synergys # ...and this one on the laptop: # [username goes here] ALL=(root) NOPASSWD: /usr/bin/killall synergyc, /home/jim/scripts/restartSynergy.sh # I use a special script to restart synergy on the laptop as it includes a # screen resizing background process that fixes the synergy screen size # when it swtches from the laptops display to the 42" TV I use for a regular # game display. #kpa - Kill Pulse Audio alias #We are killing pulseaudio because WINE hates it. echo "autospawn = no" > ~/.config/pulse/client.conf & pulseaudio --kill #Now we need to kill our synergy server and also stop the client in my laptop. ssh -t -t bl sudo /usr/bin/killall synergyc & sudo /usr/bin/killall synergys sleep 1 # This is the command to start the game. This is what the script is wrapping. # Unfortunately this command returns as soon as it is called regardless, so I # need to come up with something to deal with that. Perhaps a polling system? # The apparently extraneous '&' below fixes an issue. /usr/share/playonlinux/playonlinux --run "Battle.Net" %F & sleep 1 #This is our polling loop. EXIT=0 while [ ${EXIT} -eq 0 ]; do sleep 5 ps aux | grep -v grep | grep Battle\.Net EXIT=$? if [[ ${EXIT} != 0 ]]; then #spa - Start Pulse Audio alias rm -f ~/.config/pulse/client.conf pulseaudio --start # Reload the audio devices in the GUI sudo /usr/sbin/service avahi-daemon restart & /usr/bin/synergys -a 127.0.0.1 -c /etc/synergy.conf sleep 1 #Restart synergy client on laptop. ssh -t -t bl /home/jim/scripts/restartSynergy.sh fi done
0
ответ дан 24 July 2018 в 20:36

Вместо того, чтобы редактировать чужой скрипт, я написал обертку. Этот скрипт обрабатывает pulseaudio и синергию достаточно хорошо, но сама команда playonlinux является проблемой, потому что она возвращается, и мне нужно придумать способ заставить мой скрипт ждать ... или, может быть, нет. Я мог бы написать это, чтобы опросить игру, чтобы увидеть, работает ли она.

... ОК, я переписал его, чтобы включить цикл опроса. У меня есть одна последняя проблема, и если это не работает из ярлыка.

... ОК была проблема с запуском из ярлыка, но добавление '& amp;' в конце команды playonlinux, похоже, обратился к ней.

#!/bin/bash #The idea is to use this script to replace the command in the shortcut. # # Architectural & contextual notes: This is a desktop ( my wargamer's box called # Warmachine ) which has a synergy server running on it and also a laptop that # runs a synergy client. Synergy & pulseaudio must die in order for the game to # play correctly. Synergy must die on both machines but pulseaudio is an issue # local to the desktop. The Synergy client running remotely must die because it # freaks out when it can't find the server. The most annoying effect of this is # a shrieking laptop fan while you are trying to conentrate when it isn't even # supposed to be doing anything. I have aliases for all these functions and I'm # really just putting them into a wrapper script form because I keep forgetting # to use them. # # In order for the sudo commands to work in a non-interactive fashion # i.e., without a password, you need the following entry in your sudoers file: # [username goes here] ALL=(root) NOPASSWD: /usr/sbin/service avahi-daemon restart, /usr/bin/killall synergys # ...and this one on the laptop: # [username goes here] ALL=(root) NOPASSWD: /usr/bin/killall synergyc, /home/jim/scripts/restartSynergy.sh # I use a special script to restart synergy on the laptop as it includes a # screen resizing background process that fixes the synergy screen size # when it swtches from the laptops display to the 42" TV I use for a regular # game display. #kpa - Kill Pulse Audio alias #We are killing pulseaudio because WINE hates it. echo "autospawn = no" > ~/.config/pulse/client.conf & pulseaudio --kill #Now we need to kill our synergy server and also stop the client in my laptop. ssh -t -t bl sudo /usr/bin/killall synergyc & sudo /usr/bin/killall synergys sleep 1 # This is the command to start the game. This is what the script is wrapping. # Unfortunately this command returns as soon as it is called regardless, so I # need to come up with something to deal with that. Perhaps a polling system? # The apparently extraneous '&' below fixes an issue. /usr/share/playonlinux/playonlinux --run "Battle.Net" %F & sleep 1 #This is our polling loop. EXIT=0 while [ ${EXIT} -eq 0 ]; do sleep 5 ps aux | grep -v grep | grep Battle\.Net EXIT=$? if [[ ${EXIT} != 0 ]]; then #spa - Start Pulse Audio alias rm -f ~/.config/pulse/client.conf pulseaudio --start # Reload the audio devices in the GUI sudo /usr/sbin/service avahi-daemon restart & /usr/bin/synergys -a 127.0.0.1 -c /etc/synergy.conf sleep 1 #Restart synergy client on laptop. ssh -t -t bl /home/jim/scripts/restartSynergy.sh fi done
0
ответ дан 31 July 2018 в 23:38

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

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