rofi icon indicating copy to clipboard operation
rofi copied to clipboard

Generating config files for "custom" resolutions

Open Syphdias opened this issue 3 years ago • 1 comments

As I mentioned in #33, my native resolution (1440p) sadly is not supported.

I wrote a small python script to (mostly) generate the proper alignments.

The script looks at the directories 720p/ and 1080p/ and tries to generate a new directory "{resolution}p" where the numbers are adjusted. It does this by going through all files in the initial directories and scaling changed numbers linearly. For example: If a number is 2 for 720p, 3 for 1080p, and you generate for 1400p You will end up with 4 for 1440p. Likewise 5 (2+3) (720p) and 6 (3+3) (1080p) would yield 7 (4+3).

The script is quite raw, but I would improve on it if there is interest or any use for it.

Some things I just did not tackle (yet):

  • The system "prompt" for powermenu is not adjusted correctly (I suspect the initial values are not optimal or linearly scaling does not work in this case)
  • The script does not check if you are in the correct directory
  • If you ran the script once you need to manually remove the config dir if you want to rerun it (similar to the issue the setup script has if you run it after moving rofi dir to rofi.old
  • no integration in setup.sh
  • font might be adjusted to float which likely is not valid
  • Whitespace is not being adjusted to fit other alignments (would be hard since current config files mix tabs and spaces)
  • It assumes the 720p resolution is for 720p even if the setup.sh states 1366x768
  • It does not take into account how wide the resolution is. As all other config options (720p, 1080p) it assumes it is 16:9

I think it could be a jumping-off point or workaround if your resolution is not 720p or 1080p.

Syphdias avatar Jan 09 '21 16:01 Syphdias

I am also a 1440p user myself, this script looks great! Would be great to see it refined and merged.

I have a question/suggestion: would it be easier to put all the screen size related variables into one file (e.g. size/1080p.rasi & size/720p.rasi, etc.) and have all the other configs just pull from there when they need the variables? This would make the maintenance easier, as the actual styling and the rest of the code can be written once, and the script from this PR could be simplified to only run on the one file.

redxtech avatar Sep 01 '21 05:09 redxtech