Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
graphics
tgif
tgif-4.2.5-reconf.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File tgif-4.2.5-reconf.patch of Package tgif
--- tgif-reconf.original 2021-01-06 21:13:45.271199851 +0100 +++ tgif-reconf 2021-01-06 21:53:03.099212713 +0100 @@ -0,0 +1,123 @@ +#!/bin/sh +XAPPDEFS="/usr/share/X11/app-defaults" +BINDIR="/usr/bin" +LIMITVAL="3000" +echo "" +echo "tgif-reconf" +echo "" +echo "This serves to reconfigure tgif in case you changed the display resolution" +echo "or switch to another monitor that comes with a higher / different resolution." +echo "" +echo "Please note that this script reconfigures the geometry of tgif according to" +echo "data derived from your system setup". +echo "If you need an individual configuration it is highly recommended to enter the" +echo "corresponding values in ~/.Xdefaults-<HOSTNAME>, the value for <HOSTNAME> can" +echo "easily determined via" +echo "" +echo "echo \$HOSTNAME" +echo "" +echo "in a terminal. If you want your own geometry specification please edit your local" +echo ".Xdefaults-<HOSTNAME> and enter a line such as:" +echo "" +echo "Tgif.Geometry: 1000x1000+0+0" +echo "" +echo "what will start tgif with a size of 1000 x 1000 at a position 0 / 0, i. e. on the" +echo "upper left corner of your display independent of the settings created by tgif-reconf." +echo "The settings determined by tgif-reconf get written into:" +echo "" +echo "/usr/share/X11/app-defaults/Tgif" +echo "" +echo "Moreover the binary in use might be changed depending on the actual resolution of the" +echo "display. This can improve the usability on lowres and/or highres displays significantly" +echo "If you are not sure what to do simply reinstall tgif via zypper and / or yast2" +echo "" +echo -n "Please enter y (Y) to continue, anything else to quit: " +echo -ne "N"'\b' +read DOIT +if test -z "${DOIT}"; then + DOIT=N +fi + +if [[ "Y" != "${DOIT}" && "y" != "${DOIT}" ]]; then + echo "" + echo "Ok, I quit!" + exit 0 +fi +echo "" + +WHOAMI=`whoami` + +if [ "root" != "${WHOAMI}" ]; then + echo "You have to be root to use this script!" + echo "I quit now" + echo "" + exit 1 +fi + +if [[ ! -f "${BINDIR}/tgif.Stdres" || ! -f "${XAPPDEFS}/Tgif.Stdres" || ! -f "${BINDIR}/tgif.Highres" || ! -f "${XAPPDEFS}/Tgif.Stdres" ]]; then + echo "Seems as if this installation differs from what I would expect!" + echo "Files that are required are not in place." + echo "You should have kept all files from the original installation in place for this to work." + echo "Please check if your installation stems from openSUSE of 2021" + echo "" + echo "Therefore I quit!" + exit 1 +fi + +VAL=`xrandr 2>/dev/null | sed '/\ connected primary/!d; s/^.*primary\ //g;s/+.*//g'` +XVAL=`echo ${VAL} | sed 's/x.*//g'` +YVAL=`echo ${VAL} | sed 's/.*x//g'` +# Check whether the result is a number, if not, assign 0 to avoid trouble ... +case ${XVAL} in + ''|*[!0-9]*) XVAL=0 ;; + *) ;; +esac +case ${YVAL} in + ''|*[!0-9]*) YVAL=0 ;; + *) ;; +esac + +# Check whether the link to Tgif already exists in xappdefs ... +if [ -f ${XAPPDEFS}/Tgif ]; then + rm -f ${XAPPDEFS}/Tgif +fi +# ${LIMITVAL} has been chosen as arbitrary limit, might depend on individual taste ... +echo -n "Adjusting links in ${XAPPDEFS} and ${BINDIR} ..." +if [ "${XVAL}" -gt "${LIMITVAL}" ]; then + echo -n "... linking to high resolution variant ..." + (cd ${XAPPDEFS}; ln -s Tgif.Highres Tgif) + (cd ${BINDIR}; test -f tgif && rm -f tgif; ln -s tgif.Highres tgif) +else + echo -n "... linking to standard resolution variant ..." + (cd ${XAPPDEFS}; ln -s Tgif.Stdres Tgif) + (cd ${BINDIR}; test -f tgif && rm -f tgif; ln -s tgif.Stdres tgif) +fi +echo "... done" +echo "" +# Ok. Now if the values are meaningful let us preset a resolution that might fit to the current setup. +# User might modify accordingly at any time he likes to. + +echo -n "Adjusting geometry information in ${XAPPDEFS}/Tgif ..." + +if [[ "${XVAL}" != "0" && "${YVAL}" != "0" ]]; then + # I initially wanted to use 0.85 but 0.84 provides smaller int-multiplication values .... + # 0.84=84/100=21/25 .... + NEWXVAL=$[${XVAL}*21/25] + NEWYVAL=$[${YVAL}*21/25] + XOFFS=$[(${XVAL} - ${NEWXVAL})/2] + YOFFS=$[(${YVAL} - ${NEWYVAL})/2] + GEOMETRY="${NEWXVAL}x${NEWYVAL}+${XOFFS}+${YOFFS}" + TGIFGEOMETRY="Tgif.Geometry: ${GEOMETRY}" + # sed -i converts the link to a regular file -> this should not happen! + if [ "${XVAL}" -gt "${LIMITVAL}" ]; then + echo -n "... high resolution variant ..." + sed -i "s/^Tgif.Geometry.*/${TGIFGEOMETRY}/" ${XAPPDEFS}/Tgif.Highres + else + echo -n "... standard resolution variant ..." + sed -i "s/^Tgif.Geometry.*/${TGIFGEOMETRY}/" ${XAPPDEFS}/Tgif.Stdres + fi +fi +echo "... done" +echo "" +echo "Please start tgif now. It should be nearly centered to the current screen." +echo "" --- tgif-reconf.1x.original 2021-01-16 21:32:25.438431119 +0100 +++ tgif-reconf.1x 2021-01-16 21:31:49.121952941 +0100 @@ -0,0 +1,65 @@ +.\" manpage of tgif-reconf +.\" tgif-reconf.man v 1.0 2021/01/16 +.\" +.\" +.\" +.TH tgif-reconf manpage 1 "Version 1.0" "tgif-reconf" +.\" +.SH NAME +.\" +.B tgif-reconf +geometry configuration of tgif under X11. +.\" +.SH SYNOPSIS +.\" +.B tgif-reconf +.\" +.SH OPTIONS +.\" +none +.\" +.SH DESCRIPTION +.\" +.B tgif-reconf +will adjust X-size, Y-size, X-position and Y-position +permanently to match the properties of the display in use. It is intended +for the unexperienced user and provides a first best guess configuration for +the geometry settings. Please note that this will impact the configuration +for all users on this very computer. If a user requires a deviating +configuration it is recommended to create a personal setting as described +below. + +The resulting geometry places the application +.B tgif +in the middle of the screen, with a size of 84% of the total width and heigth +of the screen. If a new display is connected to the computer, re-running +.B tgif-reconf +will adjust the size accordingly. + +Several checks are done beforehand to avoid damaging an existing configuration. +.B tgif-reconf +will only work with a recent installation of +.B tgif +based on the setup provided by +.B openSUSE +as of today. +.B tgif-reconf +must be called as root in order to work. + +The configuration created by +.B tgif-reconf +can be overridden by placing an appropriate entry into +.B ~/.Xdefaults +such as + +.B Tgif.Geometry: 1000x1000+10+20 + +what would create a +.B tgif +window of the size 1000x1000 with a x-offset of 10 pixel and a yoffset of 20 +pixel onto the screen. Given this setting exists running tgif-reconf will +not have any more impact on the geometry of the application for this user. +To return to the global settings it it is sufficient to put an exclamation +mark at the begin of the line in the example above such as + +.B !Tgif.Geometry: 1000x1000+10+20
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor