fralb5
May 26, 2023, 10:08am
1
This topic is a follow-up to an other one
I did everything just like you said and that is what shows up for a brief moment in gnome-terminal and the scale does not change.
EDIT: I did not do everything you said, I used a different command in the shortcut, But it still does not work after I fixed it.
Let’s try step by step where your configuration is broken, can you share the following:
What happens when you open a new terminal and type in
./ChangeScale.sh
This should change the scale of the display and print “Change to scale : xx” (where xx is one of the values you put in the list_scale
variable of the script
What do you see when you also type in the terminal, the following:
cat .local/share/applications/ChangeScale.desktop
Nothing
[Desktop Entry]
Name=Change Scale
Exec=/home/purism/ChangeScale.sh
StartupNotify=true
Terminal=false
NoDisplay=false
Type=Application
Categories=Utility;Settings;
Icon=/home/purism/.local/share/Icons/ScaleChange.png
What do you see when you type in the terminal:
ls -l ./ChangeScale.sh
Any particular reason you added NoDisplay=false
and put true
to StartupNotify
in the desktop file ?
purism@pureos:~$ ls -l ./ChangeScale.sh -rwxr-xr-x 1 purism purism 525 May 26 07:07 ./ChangeScale.sh purism@pureos:~$
No, I just used my template and then filled in the right fields.
wlr-randr
output
DSI-1 "<Unknown> <Unknown> (DSI-1)"
Physical size: 65x130 mm
Enabled: yes
Modes:
720x1440 px, 63.414001 Hz (preferred, current)
Position: 0,0
Transform: normal
Scale: 2.000000
purism@pureos:~$
ok, there is something wrong here, permissions are OK, but the size of the file is not
The size of your script is 525, it should be around 610-620
Make sure that the script you have is identical to what I have currently posted in the other topic
I copied this right off of your post.
#!/bin/bash
[ ! -e /usr/bin/wlr-randr ] && echo -e "\e[31mError\e[0m: wlr-randr is missing\n==> sudo apt install wlr-randr" && exit 1
list_scale="1.25 2 1.75"
output="DSI-1"
current_scale=$(wlr-randr --output "${output}" | grep 'Scale:' | awk '{ print $2 }')
next_scale=${list_scale%% *}
flg_found=0
for scale in ${list_scale} ; do
if [ $flg_found -eq 0 ] ; then
len=${#scale}
[ "${scale}" == "${current_scale:0:$len}" ] && flg_found=1
continue
fi
next_scale=${scale}
break;
done
the first line is missing (which makes it a shell script)
And the last ones are also missing … (which are doing the job of changing the scale)
Yeah it was just the last line missing. Thanks😅