Coder Social home page Coder Social logo

urxvt-resize-font's Introduction

Installation

  1. Copy resize-font to where URxvt looks for Perl extensions, e.g: $HOME/.urxvt/ext/. For the exact path, see the urxvt(1) manual page on perl-lib.

  2. In your ~/.Xresources file, add resize-font to the urxvt.perl-ext-common setting so URxvt loads the extension, e.g:

     urxvt.perl-ext-common: default,tabbed,matcher,resize-font,-tabbed
    

Configuration

All configuration of resize-font is done in ~/.Xresources.

Note that this extension requires you to set your font size through the urxvt.font property.

Fonts

Default font sizes can be specified in pixels, using the pixelsize attribute, e.g.:

urxvt.font: xft:Inconsolata:pixelsize=12

Or they can be given in points, using the size attribute, e.g.:

urxvt.font: xft:Inconsolata:size=12

Fixed fonts are also supported, for example:

urxvt.font: 7x14

And, finally, XLFD/X logical font description is supported as well, e.g.:

urxvt.font: -*-inconsolata-medium-*-normal-*-14-*-*-*-*-*-iso8859-*

Keybindings

The default keybindings look like this:

URxvt.keysym.C-minus:     resize-font:smaller
URxvt.keysym.C-plus:      resize-font:bigger
URxvt.keysym.C-equal:     resize-font:reset
URxvt.keysym.C-question:  resize-font:show

Keybindings can be modified using the above syntax. For more information on how to specify keys, see the description of the keysym resource in the urxvt(1) manual page.

Resize interval

You can also configure the number of steps to take when changing the font size:

URxvt.resize-font.step: 2

And even fractions like 0.2 are supported.

urxvt-resize-font's People

Contributors

csabahenk avatar de-vri-es avatar edeadlink avatar esyr avatar jrouly avatar msiism avatar simmel avatar syusui-s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

urxvt-resize-font's Issues

feature: display (briefly) resulting number of columns after font resize

I always end up checking that I have around 75-95 columns in my terminal after resizing the font. It would be great if the number of columns that the new font size results in would be displayed after a resize. Assuming it's feasible to get hold of this value. Urxvt has some kind of overlay text system that might be used for this, right? Only flashing the number for a second or so would be ideal I think.

Wayland support

Hi simmel,

I hope you are having a great day!

I am trying to get this to work in Wayland with no success. My guess is that keysym doesn't work with it.

Do you know if there is any way to get this to work on Wayland?

Thanks for the great extension!

Can I use other fonts to resize?

Looks like I cant change, I was trying those but only Inconsolata work.

!URxvt.font: 9x15,xft:TerminessTTFNerdFontMono
URxvt.font: xft:Inconsolata:pixelsize=15
!URxvt.font: xft:curie:pixelsize=20
!URxvt.font: xft:tewi:pixelsize=10

Clipboard Controls Quit Working

I've been working out the conflict that's causing my custom clipboard keys to no longer work after loading this script. If you have any ideas in the meantime - much appreciated!

! REMAP CLIPBOARD CONTROLS
URxvt.iso14755: false
URxvt.iso14755_52: false
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard

using:
rxvt-unicode (urxvt256c) v9.22 - released: 2016-01-23
Fedora 31 Repo

Resize fonts relatively

#7 fixed so we resize all fonts specified but we resize them all to the same size.

When you specify multiple fonts some of them might be different sizes, e.g:

urxvt.font: xft:Inconsolata:pixelsize=12,xft:Symbola:size=8,xft:Noto Emoji:size=8

How to

Split up update_font_size in:

  • get_updated_font_size which calculates the font size we're supposed to set for a given font
  • set_font_size which sets the font size for a given font
  • And do something like $current =~ s/$regex/set_font_size(get_updated_font_size($something?))/ge if ($newsize > 0); I can't exactly remember the syntax and how to get the match into the function.

There are others who also has noticed that this is a problem but solved it another way.

shift ctrl - does not decrease font size

Thank you for making this plugin.... I have used URXVT for over 10 years and I refuse to switch from it. However, now that I am getting old now I can not read text as good. This plugin allows me to continue to use my favorite urxvt!

I noticed that shift ctrl + was able to enlarge the print. But shift ctrl - fails to decrease size. Is there anything I need to change on my end?

instead of resizing, prints the content of Xdefaults to the console

I configured my resize hotkey as usual (following arch wiki), my hotkey works but instead of resizing the window, it prints the list of my fonts from Xdefaults.
Interestingly enough, it prints the list correctly modify of the step I wanted up or down according to bigger or smalle hotkey.

Exemple, all my fonts are 10, when pressing the "bigger key", I get this in the terminal:

$ xft:Inconsolata Nerd Font Mono:size=11, xft:Terminess TTF Nerd Font Mono:size=11, xft:Source Code Pro:size=11:hinting=true, xft:Consolas:size=11:hinting=true, xft:DejaVu Sans:size=11:hinting=true, xft:UbuntuMono Nerd Font:size=11

What is happening?

My .Xdefaults relevant snippet:

!! Extensions
URxvt.perl-ext-common:	default,matcher,resize-font,url-select,keyboard-select,clipboard
!URxvt.perl-ext-common:	default,resize-font,keyboard-select,clipboard,
URxvt.colorUL:		#4682B4
!! url-select
URxvt.keysym.M-u:	perl:url-select:select_next
URxvt.url-select.launcher: linkhandler
URxvt.url-select.underline: true
!! keyboard-select:
URxvt.keysym.M-Escape: perl:keyboard-select:activate
!! resize-font
URxvt.iso14755: false
URxvt.iso14755_52: false
!URxvt.resize-font.smaller:	C-j
!URxvt.resize-font.bigger:	C-k
URxvt.keysym.C-Shift-J:  resize-font:smaller
URxvt.keysym.C-Shift-K:    resize-font:bigger
URxvt.resize-font.step: 1

Resize fallback fonts

Hello,
first of all thanks for providing this plugin.

I have multiple fonts defined in my .Xresources (see below).
I would like urxvt-resize-font to resize all of them when I press any of the keysyms.
Currently, only the first is resized.
This means that when e.g. random Unicode characters are displayed at a different size than surrounding text when the characters are not available in the first font.

Screenshot of the issue:
screenshot

Relevant parts of my ~/.Xresources:

URxvt.font: xft:Dejavu Sans Mono:pixelsize=12,xft:Consolas:pixelsize=12,xft:Code2000:pixelsize=12,xft:symbola:pixelsize=12
URxvt.perl-ext-common: default,matcher,resize-font
URxvt.resize-font.smaller: C-Down
URxvt.resize-font.bigger: C-Up
URxvt.resize-font.reset: C-Right
URxvt.resize-font.show: R-Left

bigger only works to config size?

Hi, I have my font line in .Xresources set to:

URxvt.font:xft:Inconsolata:size=12

and I notice with my key bindings I can go smaller and bigger but bigger never goes above 12 points. Is this a known thing? Or am I doing something wrong?

Font Size Limit

I know almost a year has passed since your last commit but, could you try and add a limit to the minimum font size? Not 100% sure but perhaps also a limit to the maximum font size.
It's just that I'm not at all familiar with Perl.

Use standard config syntax

Instead of

URxvt.resize-font.smaller: C-minus
URxvt.resize-font.bigger: C-plus
URxvt.resize-font.reset: C-equal
URxvt.resize-font.show: C-question

use the standardized

URxvt.keysym.C-minus:     resize-font:smaller
URxvt.keysym.C-plus:      resize-font:bigger
URxvt.keysym.C-equal:     resize-font:reset
URxvt.keysym.C-question:  resize-font:show

Also start using on_action instead of on_user_command, from urxvtperl(3):

       on_user_command $term, $string *DEPRECATED*
           […]
           This interface is going away in preference to the "on_action" hook.

Mousewheel support

Any idea on how to add mousewheel support to use C-<scroll up> and C-<scroll down> to increase/decrease font sizes?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.