Bitcoin Forum
November 11, 2024, 02:10:19 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Here is how to produce the ₿ (Bitcoin) symbol in xorg (Linux/BSD/etc) by keypres  (Read 204 times)
Artemis3 (OP)
Legendary
*
Offline Offline

Activity: 2030
Merit: 1573


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
December 30, 2018, 01:51:18 AM
Merited by r1s2g3 (1)
 #1

The (Bitcoin) symbol exists officially in unicode under code U+20BF since 2017 (Unicode v10). If you have a fairly recent Unicode font, such as Google's Noto, you can already see the Bitcoin symbol and use it by copy paste or unicode input along the traditional fiat symbols like $, £, €, etc.

But wouldn't it be nice to have it at your disposal by just pressing a key? Well you can!

xmodmap to the rescue. Yup, xmodmap can assign any key you like to produce this (or any other) unicode symbol.

All you need to do is execute the xmodmap command. First take a look at your current settings with xmodmap -pke

I noticed an unassigned key, menu with shift, so in my case i used:
Code:
xmodmap -e "keycode 135 = Menu U20BF Menu"

The columns after = means what does the key do when you just press it, when you press it with shift, or when you use altgr. US keyboards might actually just need the first two, other more complex key combinations exist such as when the compose key is enabled (ie. a 4th column means altgr+shift, etc).

If you add this to your user xmodmap config file, at ~/.Xmodmap then you don't need to repeat this command every time you login:
Code:
keycode 135 = Menu U20BF Menu

If you want to use another key, or some unused key, you can use xev to find out the keycode, just run:
Code:
xev -event keyboard
and press the key to find out its keycode. In Arch and its derivatives you need to install the package xorg-xev.

And that is all, you can now just press your key and have the (Bitcoin) symbol ready for your chats or any other text typing.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
bitfocus
Member
**
Offline Offline

Activity: 532
Merit: 15


View Profile
December 31, 2018, 12:42:59 AM
 #2

a little geeky but would come handy to me, thanks.
Artemis3 (OP)
Legendary
*
Offline Offline

Activity: 2030
Merit: 1573


CLEAN non GPL infringing code made in Rust lang


View Profile WWW
December 31, 2018, 04:34:53 AM
 #3

a little geeky but would come handy to me, thanks.

Glad it helped you. I decided to post this because I couldn't quickly find the answer on how to do it myself, so I decided to tackle this problem and post the solution. Now its hopefully indexed by the search engines, so the next person (using Xorg) that wants to push a key and get ₿ (or any other unicode symbol) can hopefully find this post now.

██████
███████
███████
████████
BRAIINS OS+|AUTOTUNING
MINING FIRMWARE
|
Increase hashrate on your Bitcoin ASICs,
improve efficiency as much as 25%, and
get 0% pool fees on Braiins Pool
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!