Script para configurar o DOOM Retro no Linux
O
DOOM Retro é um "source port" clássico, minimalista e muito elegante. No entanto, sua configuração é feita através de um arquivo de texto (
doomretro.cfg) que pode ser chato de ser editado pelo número de opções.
Para facilitar a vida, criei um script em Bash que utiliza o
dialog para criar uma interface de texto (TUI). Com ele, você pode buscar variáveis por nome ou descrição, ver o que cada uma faz e alterá-las sem precisar abrir um editor de texto.
O que o script faz
- Edição: Altera o arquivo
~/.config/doomretro/doomretro.cfg. - Busca: Permite filtrar variáveis por termo (ex: pesquisar "mouse" traz todas as opções de sensibilidade e aceleração).
- Documentação: O script possui a descrição oficial de quase todas as variáveis do programa, exibindo-as no momento da edição.
Requisitos
O único requisito é ter o pacote
dialog instalado no seu sistema. No Gentoo:
sudo emerge --ask dev-util/dialog
Como usar
Copie o código abaixo e salve em um arquivo chamado
edita_doom.sh.
#!/bin/bash
ARQUIVO_CFG="$HOME/.config/doomretro/doomretro.cfg"
if [ ! -f "$ARQUIVO_CFG" ]; then
ARQUIVO_CFG="doomretro.cfg"
if [ ! -f "$ARQUIVO_CFG" ]; then
echo "Erro: Arquivo doomretro.cfg não encontrado."
exit 1
fi
fi
if ! command -v dialog &> /dev/null; then
echo "Erro: Dependência 'dialog' não encontrada."
exit 1
fi
declare -A INFO_VAR
while IFS='|' read -r var def desc; do
INFO_VAR["$var"]="Padrão: $def\nDescrição: $desc"
done << 'DATA'
alwaysrun|off|Toggles you to always run instead of walk.
am_allmapcdwallcolor|109|The color of unmapped lines in the automap indicating a change in a ceiling's height once you have a computer area map power-up (0 to 255).
am_allmapfdwallcolor|110|The color of unmapped lines in the automap indicating a change in a floor's height once you have a computer area map power-up (0 to 255).
am_allmapwallcolor|108|The color of unmapped solid walls in the automap once you have a computer area map power-up (0 to 255).
am_antialiasing|off|Toggles anti-aliasing in the automap.
am_author|on|Toggles displaying the map's author (if available) in the automap.
am_backcolor|0|The color of the automap's background (0 to 255).
am_bloodsplatcolor|124|The color of blood splats in the automap when you cheat (0 to 255).
am_bluedoorcolor|162|The color of doors in the automap unlocked with a blue keycard or skull key (0 to 255).
am_bluekeycolor|112|The color of blue keycards and skull keys in the automap when you cheat (0 to 255).
am_cdwallcolor|162|The color of lines in the automap indicating a change in a ceiling's height (0 to 255).
am_corpsecolor|116|The color of corpses in the automap when you cheat (0 to 255).
am_correctaspectratio|on|Toggles aspect ratio correction in the automap.
am_crosshaircolor|4|The color of the crosshair in the automap when follow mode is off (0 to 255).
am_display|2|The display used to show the external automap.
am_dynamic|on|Toggles dynamically updating the automap while it is open.
am_external|off|Toggles showing the automap on an external display.
am_fdwallcolor|64|The color of lines in the automap indicating a change in a floor's height (0 to 255).
am_followmode|on|Toggles following you in the automap.
am_grid|off|Toggles the grid in the automap.
am_gridcolor|6|The color of the grid in the automap (0 to 255).
am_gridsize|128x128|The size of the grid in the automap (widthxheight).
am_markcolor|89|The color of marks in the automap (0 to 255).
am_mousepanning|off|Toggles panning using the mouse in the automap when follow mode is off.
am_path|off|Toggles your path in the automap.
am_pathlength|medium|The length of your path in the automap (short, medium, long or endless).
am_pathcolor|89|The color of your path in the automap (0 to 255).
am_playercolor|4|The color of your arrow in the automap (0 to 255).
am_playerstats|off|Toggles your stats in the automap.
am_playerstatscolor|4|The color of your stats in the automap (0 to 255).
am_reddoorcolor|162|The color of doors in the automap unlocked with a red keycard or skull key (0 to 255).
am_redkeycolor|112|The color of red keycards and skull keys in the automap when you cheat (0 to 255).
am_rotatemode|on|Toggles rotating around you in the automap.
am_teleportercolor|184|The color of teleporter lines in the automap (0 to 255).
am_thingcolor|112|The color of things in the automap when you cheat (0 to 255).
am_tswallcolor|104|The color of lines in the automap indicating no change in height (0 to 255).
am_wallcolor|180|The color of solid walls in the automap (0 to 255).
am_yellowdoorcolor|162|The color of doors in the automap unlocked with a yellow keycard or skull key (0 to 255).
am_yellowkeycolor|112|The color of yellow keycards and skull keys in the automap when you cheat (0 to 255).
ammo|50|The amount of ammo you have for your currently equipped weapon.
animatedstats|on|Toggles animating your health, armor and ammo in the status bar and widescreen HUD when they change.
armor|0%|Your armor (0% to 200%).
armortype|none|Your armor type (none, green or blue).
autoaim|on|Toggles vertical autoaiming as you fire your weapon while using mouselook.
autoload|on|Toggles automatically loading the last savegame when you die.
autosave|on|Toggles automatically saving the game at the start of each map.
autoswitch|on|Toggles automatically switching your weapon when picking up a new one or better ammo.
autotilt|off|Toggles automatically tilting your view while going up or down a flight of stairs.
autouse|off|Toggles automatically using doors and switches in front of you.
centerweapon|on|Toggles centering your weapon when fired.
con_edgecolor|auto|The color of the console's bottom edge (auto, or 0 to 255).
con_timestampformat|standard|The format of the timestamps in the console (standard or military).
con_timestamps|on|Toggles timestamps in the console.
con_warninglevel|1|The console's warning level (0, 1 or 2).
crosshair|none|Toggles your crosshair (none, cross, angle, dot, bigcross, circle, bigcircle, chevron, chevrons or arcs).
crosshaircolor|112|The color of your crosshair (0 to 255).
english|american|Toggles the use of American or British English (american or british).
episode|1|The currently selected DOOM episode in the menu (1 to 6).
expansion|1|The currently selected DOOM II expansion in the menu (1 or 2).
facebackcolor|5|The color of your face's background in the status bar (0 to 255).
fade|on|Toggles a fading effect when transitioning between some screens.
flashkeys|on|Toggles flashing the keycard or skull key that is needed when you try to open a locked door.
freelook|off|Toggles freely looking up and down using the mouse or a controller.
gametime|00:00.00|The amount of time DOOM Retro has been running.
groupmessages|on|Toggles the grouping of identical player messages.
health|100%|Your health (-99% to 200%).
infighting|on|Toggles infighting amongst monsters once you die.
infiniteheight|off|Toggles giving you and everything else in the current map infinite height.
joy_analog|on|Toggles whether movement using a controller's thumbsticks is analog or digital.
joy_deadzone_left|15%|The dead zone of a controller's left thumbstick (0% to 30%).
joy_deadzone_right|15%|The dead zone of a controller's right thumbstick (0% to 30%).
joy_invertyaxis|off|Toggles inverting the vertical axis of a controller's right thumbstick when you look up or down.
joy_rumble_barrels|100%|The amount a controller rumbles when you are near an exploding barrel (0% to 200%).
joy_rumble_damage|100%|The amount a controller rumbles when you take damage (0% to 200%).
joy_rumble_fall|on|Toggles rumbling a controller when you land after a fall.
joy_rumble_pickup|on|Toggles rumbling a controller when you pick something up.
joy_rumble_weapons|100%|The amount a controller rumbles when you fire your weapon (0% to 200%).
joy_sensitivity_horizontal|64|The horizontal sensitivity of a controller's thumbsticks (0 to 128).
joy_sensitivity_vertical|64|The vertical sensitivity of a controller's thumbsticks (0 to 128).
joy_swapthumbsticks|off|Toggles swapping a controller's left and right thumbsticks.
joy_thumbsticks|2|The number of thumbsticks on a controller (1 or 2).
m_acceleration|on|Toggles the acceleration of mouse movement.
m_doubleclick_use|off|Toggles double-clicking a mouse button to perform the +use action.
m_invertyaxis|off|Toggles inverting the vertical axis of the mouse when using mouselook.
m_novertical|on|Toggles no vertical movement of the mouse.
m_pointer|on|Toggles the mouse pointer in the menu.
m_sensitivity|16|The mouse's sensitivity (0 to 128).
maptime|00:00.00|The amount of time you have been in the current map.
melt|on|Toggles a melting effect when transitioning between some screens.
menuhighlight|on|Toggles the highlighting of selected items in the menu.
menushadow|on|Toggles items in the menu casting a shadow.
menuspin|on|Toggles spinning the player's view in the menu's background.
messages|on|Toggles displaying player messages at the top of the screen.
movebob|75%|The amount your view bobs as you move (0% to 100%).
negativehealth|on|Toggles allowing your health to be less than 0% when you die.
obituaries|on|Toggles displaying obituaries when you or monsters are killed.
playergender|male|Your gender (male, female or other).
playername|""|Your name.
r_althud|off|Toggles an alternate heads-up display when widescreen.
r_althudfont|on|Toggles displaying messages in an alternate font when the alternate HUD is displayed.
r_antialiasing|off|Toggles anti-aliasing when the graphic detail is low.
r_berserkeffect|3|The intensity of the red effect when you have a berserk power-up and your fists equipped (0 to 8).
r_blood|nofuzz|The colors of the blood spilled by you and monsters (all, none, red, green or nofuzz).
r_blood_gibs|on|Toggles spawning blood when monsters are gibbed.
r_blood_melee|on|Toggles spawning blood during melee attacks from monsters.
r_bloodsplats_max|131,072|The maximum number of blood splats allowed in each map (0 to 1,048,576).
r_bloodsplats_translucency|on|Toggles the translucency of blood splats.
r_brightmaps|on|Toggles brightmaps on some wall textures.
r_corpses_color|on|Toggles randomly colored marine corpses.
r_corpses_gib|on|Toggles some corpses gibbing when barrels or rockets explode nearby.
r_corpses_mirrored|on|Toggles randomly mirrored corpses.
r_corpses_moreblood|on|Toggles blood splats spawned around corpses at the start of each map.
r_corpses_nudge|on|Toggles corpses and the items they drop being nudged when walked over.
r_corpses_slide|on|Toggles corpses sliding when barrels or rockets explode nearby.
r_corpses_smearblood|on|Toggles corpses leaving blood splats behind as they slide.
r_damageeffect|on|Toggles the red effect when you take damage.
r_detail|high|Toggles the graphic detail (high or low).
r_diskicon|off|Toggles showing a disk icon when loading and saving.
r_ditheredlighting|on|Toggles dithered lighting cast on all textures and sprites.
r_extralighting|0%|The extra lighting applied to the current map (0% to 100%).
r_fixmaperrors|on|Toggles fixing many mapping errors in the official DOOM and DOOM II WADs.
r_fixspriteoffsets|on|Toggles fixing sprite offsets.
r_floatbob|on|Toggles some power-ups bobbing up and down.
r_fov|90°|Your field of view (45° to 135°).
r_gamma|0.90|The screen's gamma correction level (off, or 0.50 to 2.0).
r_graduallighting|on|Toggles gradual lighting under doors and crushing sectors.
r_homindicator|off|Toggles a flashing "Hall Of Mirrors" indicator.
r_hud|off|Toggles a heads-up display when widescreen.
r_hud_translucency|on|Toggles the translucency of the heads-up display when widescreen.
r_linearskies|off|Toggles horizontally linear skies.
r_liquid_bob|on|Toggles the bobbing of liquid sectors.
r_liquid_bobsprites|on|Toggles the bobbing of sprites in liquid sectors.
r_liquid_clipsprites|on|Toggles clipping the bottom of sprites in liquid sectors.
r_liquid_current|on|Toggles a slight current being applied to liquid sectors.
r_liquid_lowerview|on|Toggles lowering your view when you are in a liquid sector.
r_liquid_swirl|on|Toggles the swirl of liquid sectors.
r_lowpixelsize|2x2|The size of each pixel when the graphic detail is low (widthxheight).
r_mirroredweapons|off|Toggles randomly mirroring the weapons dropped by monsters.
r_percolumnlighting|on|Toggles per-column lighting cast on monsters.
r_pickupeffect|on|Toggles the gold effect when you pick something up.
r_playersprites|on|Toggles showing your weapon.
r_radsuiteffect|on|Toggles the green effect while you wear a radiation shielding suit power-up.
r_randomstartframes|on|Toggles randomizing the start frames of certain sprites.
r_rockettrails|on|Toggles the trail of smoke behind rockets fired by you and cyberdemons.
r_rockettrails_translucency|on|Toggles the translucency of the trail of smoke behind rockets fired by you and cyberdemons.
r_screensize|7|The screen size (0 to 8).
r_shadows|on|Toggles sprites casting shadows.
r_shadows_translucency|on|Toggles the translucency of shadows cast by sprites.
r_shake_barrels|on|Toggles shaking your view when you are near an exploding barrel.
r_shake_berserk|on|Toggles shaking your view when you have a berserk power-up and punch something.
r_shake_damage|on|Toggles shaking the screen when you take damage.
r_sprites_translucency|on|Toggles the translucency of certain sprites.
r_textures|on|Toggles showing all textures.
r_textures_translucency|on|Toggles the translucency of certain BOOM-compatible wall textures.
s_channels|32|The number of sound effects that can be played at the same time (8 to 64).
s_fullsfx|on|Toggles playing sound effects in full as things are removed from the map.
s_lowermenumusic|on|Toggles lowering the music's volume in the menu and console.
s_musicinbackground|off|Toggles continuing to play music in the background when DOOM Retro's window loses focus.
s_musicvolume|100%|The volume level of music (0% to 100%).
s_randommusic|off|Toggles randomizing the music for each map.
s_randompitch|off|Toggles randomizing the pitch of sound effects made by monsters.
s_sfxvolume|100%|The volume level of sound effects (0% to 100%).
s_stereo|on|Toggles playing sound effects in mono or stereo.
savegame|1|The currently selected savegame in the menu (1 to 8).
secretmessages|on|Toggles displaying a message when you find a secret.
skilllevel|3|The currently selected skill level in the menu (1 to 5).
stillbob|0%|The amount your view and weapon bob up and down when you stand still (0% to 100%).
sucktime|1|The amount of time you must complete a map before you "SUCK" (off, or 1 to 24 hours).
tossdrop|on|Toggles tossing items dropped by monsters when they die.
turbo|100%|The speed you move (10% to 400%).
units|imperial|The units used by certain stats (imperial or metric).
version|5.8.2|DOOM Retro's version.
vid_aspectratio|auto|The aspect ratio of the display when widescreen (16:9, 16:10, 21:9, 32:9 or auto).
vid_blue|0%|The intensity of blue on the screen (-100% to 100%).
vid_borderlesswindow|on|Toggles using a borderless window when fullscreen.
vid_brightness|0%|The screen's brightness (-100% to 100%).
vid_capfps|200|The number of frames at which to cap the framerate (off, or 35 to 1,000). There is no interpolation between frames when this CVAR is 35.
vid_contrast|0%|The screen's contrast (-100% to 100%).
vid_display|1|The display used to play DOOM Retro on.
vid_fullscreen|on|Toggles between fullscreen and a window.
vid_green|0%|The intensity of green on the screen (-100% to 100%).
vid_motionblur|0%|The amount of motion blur when you turn quickly (0% to 100%).
vid_pillarboxes|off|Toggles using the pillarboxes either side of the screen for certain effects when not widescreen.
vid_red|0%|The intensity of red on the screen (-100% to 100%).
vid_saturation|0%|The saturation of the colors on the screen (-100% to 100%).
vid_scaleapi|direct3d|The API used to scale every frame ("direct3d", "opengl" or "software").
vid_scalefilter|nearest_linear|The filter applied when scaling every frame ("nearest", "linear" or "nearest_linear").
vid_screenresolution|desktop|The screen's resolution when fullscreen (desktop or widthxheight).
vid_showfps|off|Toggles showing the number of frames per second.
vid_vsync|off|Toggles vertical sync with the display's refresh rate (on, off or adaptive).
vid_widescreen|off|Toggles widescreen.
vid_windowpos|centered|The position of the window on the desktop (centered or (x,y)).
vid_windowsize|854x480|The size of the window on the desktop (widthxheight).
wad|""|The last WAD to be opened by the WAD launcher.
wadfolder|"C:\"|The folder the currently loaded WAD is in.
weaponbob|75%|The amount your weapon bobs up and down as you move (0% to 100%).
weaponbounce|on|Toggles the bounce of your weapon when you land after a fall.
weaponrecoil|off|Toggles the recoil of your weapon when you fire it.
DATA
TERMO_BUSCA=""
while true; do
OPCOES=()
while IFS= read -r linha; do
if [[ -z "$linha" || "$linha" == \;* || "$linha" == \[* || "$linha" == bind* ]]; then
continue
fi
chave=$(echo "$linha" | awk '{print $1}')
valor=$(echo "$linha" | awk '{$1=""; print $0}' | sed 's/^[ \t]*//')
if [[ -n "$TERMO_BUSCA" ]]; then
TERMO_LOWER="${TERMO_BUSCA,,}"
CHAVE_LOWER="${chave,,}"
VALOR_LOWER="${valor,,}"
DESC_LOWER="${INFO_VAR[$chave],,}"
if [[ "$CHAVE_LOWER" != *"$TERMO_LOWER"* && "$VALOR_LOWER" != *"$TERMO_LOWER"* && "$DESC_LOWER" != *"$TERMO_LOWER"* ]]; then
continue
fi
fi
OPCOES+=("$chave" "$valor")
done < "$ARQUIVO_CFG"
if [ ${#OPCOES[@]} -eq 0 ]; then
dialog --clear --msgbox "Nenhum resultado encontrado para o termo: '$TERMO_BUSCA'" 7 50
TERMO_BUSCA=""
continue
fi
TITULO="Doom Retro - Editor"
[[ -n "$TERMO_BUSCA" ]] && TITULO="$TITULO [Filtro: $TERMO_BUSCA]"
ARQ_ESCOLHA=$(mktemp)
dialog --clear --title "$TITULO" \
--cancel-label "Sair" \
--extra-button --extra-label "Buscar" \
--menu "Selecione a variável para modificar:" 22 75 15 \
"${OPCOES[@]}" 2> "$ARQ_ESCOLHA"
RETORNO=$?
ESCOLHA=$(cat "$ARQ_ESCOLHA")
rm -f "$ARQ_ESCOLHA"
if [ $RETORNO -eq 1 ] || [ $RETORNO -eq 255 ]; then
clear
exit 0
elif [ $RETORNO -eq 3 ]; then
ARQ_BUSCA=$(mktemp)
dialog --clear --title "Busca" \
--inputbox "Digite o termo (deixe em branco para remover o filtro atual):" 8 60 2> "$ARQ_BUSCA"
RET_BUSCA=$?
if [ $RET_BUSCA -eq 0 ]; then
TERMO_BUSCA=$(cat "$ARQ_BUSCA")
fi
rm -f "$ARQ_BUSCA"
continue
fi
VALOR_ATUAL=$(grep "^$ESCOLHA\b" "$ARQUIVO_CFG" | awk '{$1=""; print $0}' | sed 's/^[ \t]*//')
TEXTO_INFORMATIVO="${INFO_VAR[$ESCOLHA]:-Padrão: Desconhecido\nDescrição: Variável não mapeada na tabela original.}"
ARQ_VALOR=$(mktemp)
dialog --clear --title "Editando: $ESCOLHA" \
--cancel-label "Voltar" \
--inputbox "$TEXTO_INFORMATIVO\n\nValor Atual:" 14 75 "$VALOR_ATUAL" 2> "$ARQ_VALOR"
RET_VALOR=$?
NOVO_VALOR=$(cat "$ARQ_VALOR")
rm -f "$ARQ_VALOR"
if [ $RET_VALOR -eq 0 ] && [ "$NOVO_VALOR" != "$VALOR_ATUAL" ]; then
sed -i -E "s/^(${ESCOLHA}[[:space:]]+).*/\1${NOVO_VALOR}/" "$ARQUIVO_CFG"
fi
done
Dê permissão de execução:
chmod +x edita_doom.sh
./edita_doom.sh
Execute:

Links:
Outras dicas deste autor
Vino sem GNOME
USB do host reconhecido na máquina virtual
Canal do YouTube sobre GNU/Linux
Aviso de problemas por causa do Typora [Resolvido]
Samsung Kies Air no GNU/Linux
Leitura recomendada
Configuração de placas de vídeo nVidia através do module assistant
Funções ZZ é uma coletânea com 111 miniaplicativos
Adicionando cor ao comando echo
Minha solução para monitorar múltiplos termômetros no Slackware
Como verificar senha no shell script
Comentários
Nenhum comentário foi encontrado.