Urban Terror Forums: Post your startup scripts! - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Post your startup scripts! Rate Topic: -----

#1 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 14 June 2014 - 07:29 PM

# Urban Terror startup script

xrandr --output HDMI-0 --gamma 2:2:2
export R600_DEBUG=hyperz
export SDL_VIDEO_FULLSCREEN_HEAD={0}
export GALLIUM_MSAA=4
/home/cobalt60/UrbanTerror42/Quake3-UrT.x86_64
xrandr --output HDMI-0 --gamma 1.25:1.25:1.25

#2 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 04 July 2014 - 06:07 AM

Wow no interest here I guess.

Well Ill bring it up here anyway; I have dual monitors, the one on the left is the one I game on and the one on the right has system monitors (conky) as well as the terminal emulator I start UrT on. While the game is running, the terminal outputs all sorts of information, such as who joins, gets killed, next map, chat, etc. I was wondering if there was a way to highlight keywords in this.

#3 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 04 July 2014 - 07:20 AM

OK so I asked the question in another forum and got my answer!

Heres how it looks:

/home/cobalt60/UrbanTerror42/Quake3-UrT.x86_64 2>&1 | grep --color=always --line-buffered -e join -e you -e $


basically, every pattern I want to search for is preceded by -e
the last part (-e $) is there so that the terminal still outputs all the lines, but only highlights the pattern. If you wanted to *only* output the pattern you could omit that.

the first part (2>$1) redirects STDERR to STDOUT which is required to get grep to be able to work with it.

I first got this idea when people would not use auto-join, and I knew the information was right there in front of me to prove if it was happening, it was just buried in with lots of other information. It has other uses of course, by highlighting information most relevant. So heres my full startup script:

# Urban Terror startup script

xrandr --output HDMI-0 --gamma 2:2:2
export R600_DEBUG=hyperz
export SDL_VIDEO_FULLSCREEN_HEAD={0}
export GALLIUM_MSAA=4
/home/cobalt60/UrbanTerror42/Quake3-UrT.x86_64 2>&1 | grep --color=always --line-buffered -e radeon -e join -e you -e $
xrandr --output HDMI-0 --gamma 1.25:1.25:1.25

This post has been edited by cobalt60: 04 July 2014 - 07:23 AM


#4 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 01 January 2015 - 11:00 PM

Well, I got some nice colored output of my terminal Id like to share. Please note I switched to using the proprietary driver as the free driver has (foolishly) had it force AA option removed

# Urban Terror startup script

xrandr --output DFP9 --gamma 1.9:1.9:1.9
export SDL_VIDEO_FULLSCREEN_HEAD={0}

/home/cobalt60/urt/UrbanTerror42/Quake3-UrT.x86_64 2>&1 |

 GREP_COLOR="1;32" grep --color=always --line-buffered -i -e "^.*you hit.*" -e $ |
 GREP_COLOR="1;31" grep --color=always --line-buffered -i -e "^.*you were hit.*" -e $ |
 GREP_COLOR="1;33" grep --color=always --line-buffered -i -e "^.*disconnected.*" -e $ |
 GREP_COLOR="0;36" grep --color=always --line-buffered -i -e "^.*joined.*" -e $ |
 GREP_COLOR="1;34" grep --color=always --line-buffered -i -e "^.*vote.*" -e "^.*nextmap.*" -e $ |
 GREP_COLOR="1;35" grep --color=always --line-buffered -i -e "^.*: ^3.*" -e $

xrandr --output DFP9 --gamma 1.25:1.25:1.25


Im going to go over things a bit, but I think you get the idea.

#5 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 20 August 2017 - 01:47 AM

Just the latest iteration of my startup script. Added comments, a color code cheat sheet, and a few more phrases colorized and also modified to be more accurate (ie, wanted to highlight when I bled to death, but it would also highlight words such as disabled)


#!/bin/bash
#
# Urban Terror startup script
#
# /usr/local/bin/urt43


# increases the brightness before starting UrT; be sure to select the correct monitor
xrandr --output DVI-I-1 --gamma 2.2:2.2:2.2

# selects which monitor to display UrT on
export SDL_VIDEO_FULLSCREEN_HEAD=0

# launches UrT with path to the executable
# "(2>$1)" redirects STDERR to STDOUT, which is required to get grep to be able to work with it.

/home/cobalt60/UrbanTerror43/Quake3-UrT.x86_64 2>&1 |

# select the phrases you want colorized and which colors you want
# every pattern I want to search for is preceded by -e
# the last part (-e $) is there so that the terminal still outputs all the lines, but only 
# colorizes the pattern. If you wanted to *only* output the pattern, you could omit that.

 GREP_COLOR="0;32" grep --color=always --line-buffered -i -e "^.*you hit.*" -e $ |
 GREP_COLOR="1;31" grep --color=always --line-buffered -i -e "^.*bled to death.*" -e $ |
 GREP_COLOR="0;31" grep --color=always --line-buffered -i -e "^.*you were hit.*" -e $ |
 GREP_COLOR="0;33" grep --color=always --line-buffered -i -e "^.*disconnected.*" -e $ |
 GREP_COLOR="0;33" grep --color=always --line-buffered -i -e "^.*joined.*" -e $ |
 GREP_COLOR="0;35" grep --color=always --line-buffered -i -e "^.*vote.*" -e "^.*nextmap.*" -e $ |
 GREP_COLOR="1;33" grep --color=always --line-buffered -i -e "^.*has taken.*" -e $ |
 GREP_COLOR="0;36" grep --color=always --line-buffered -i -e "^.*: ^3.*" -e $

# example if you need to change the resolution back to normal when done playing:
# xrandr --output DFP3 --mode 1680x1050 --rate 60.0 --output CRT1 --pos 1680x0

# set brightness back to normal
xrandr --output DVI-I-1 --gamma 1.0:1.0:1.0

#	COLOR CODES	("*" = used color)
#	Black       0;30     Dark Gray     1;30
#	Blue        0;34     Light Blue    1;34
#	Green*      0;32     Light Green   1;32
#	Cyan*       0;36     Light Cyan    1;36
#	Red*        0;31     Light Red*    1;31
#	Purple*     0;35     Light Purple  1;35
#	Brown*      0;33     Yellow        1;33
#	Light Gray  0;37     White         1;37



This post has been edited by cobalt60: 20 August 2017 - 02:26 AM


bullet_loaderAdvertisement

#6 User is offline   cobalt60 Icon

  • Account: cobalt60
  • Joined: 15-January 11
  • Posts: 56

Posted 20 August 2017 - 02:11 AM

A cropped image from my secondary monitor, showing the terminal output as well as conky (a system monitor)

Posted Image

This post has been edited by cobalt60: 20 August 2017 - 02:13 AM


#7 User is online   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 1,054

Posted 21 August 2017 - 01:14 AM

i suggest changing your greps to something like this:

 grep -e "keyword" | sed 's/^1/\e[31m'" 


you would now replace every ^1 (red color code) with a bash color code :)
or just leave out the color code in the sed, in case you dont want fancy colored words :P
Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

#8 User is offline   ge0rdie Icon

  • Account: ge0rdie
  • Country:
  • Joined: 28-December 10
  • Posts: 32

Posted 10 October 2018 - 09:32 AM

View Postcobalt60, on 14 June 2014 - 07:29 PM, said:

# Urban Terror startup script

xrandr --output HDMI-0 --gamma 2:2:2
export R600_DEBUG=hyperz
export SDL_VIDEO_FULLSCREEN_HEAD={0}
export GALLIUM_MSAA=4
/home/cobalt60/UrbanTerror42/Quake3-UrT.x86_64
xrandr --output HDMI-0 --gamma 1.25:1.25:1.25


A (very) belated thanks for this, the xrandr bit fixed a shitty brightness problem I have been having.
I would add that doing a "xrandr | grep -i hdmi" will find the name of your HDMI port, mine was HDMI-0-1

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Sponsored link
https://www.frozensand.com/


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942