Browse Source

added emoji support and emojipicker

Hans Martin 2 years ago
parent
commit
dc2275dda7
5 changed files with 151 additions and 10 deletions
  1. 19 8
      .bash_aliases
  2. 65 0
      .config/fontconfig/conf.d/56-twemoji-color.conf
  3. 65 0
      .config/fontconfig/fonts.conf
  4. 1 1
      .config/i3/config
  5. 1 1
      install.sh

+ 19 - 8
.bash_aliases

@@ -12,25 +12,30 @@ alias yay='yay --color=auto'
 alias v='nvim'
 alias vi='nvim'
 alias vim='nvim'
+#alias neovide='neovide --multigrid'
 
 # modern-unix tools
 [ -f "$(which duf)" ] && alias df="duf"
 [ -f "$(which fd)" ] && alias find="fd -H"
 [ -f "$(which rg)" ] && alias grep="rg"
+[ -f "$(which neovide)" ] && alias gvim="neovide --multigrid $@"
 
 # cat on wings
 alias bat='bat --theme zenburn'
 
 # universal opener
-alias open="xdg-open"
+function open () {
+    xdg-open "$*" &
+}
+
 
 # Run vifmrun for image preview with ueberzug
 alias vifm="$HOME/.config/vifm/scripts/vifmrun"
 
 # Configure neovide as gvim alternative
-function gvim {
-    nohup neovide --multiGrid --disowned $@ >/dev/null 2>&1 &
-}
+#function gvim {
+#    neovide --multigrid $@
+#}
 
 # some ls aliases
 alias ll='ls -alh --color=auto --group-directories-first'
@@ -53,6 +58,7 @@ alias md=markdown_previewer
 
 # default PDF viewer
 alias pdf='zathura --fork'
+#alias pdf='sioyek'
 
 # source: github.com/sharkdp/hexyl
 alias hex=hexyl
@@ -63,8 +69,8 @@ alias netstat='netstat -tulanp'
 
 
 alias loadX='xrdb $HOME/.Xresources'
-alias zzz='systemctl suspend'
-alias ZZZ='systemctl hibernate'
+alias zzz='systemctl suspend -i && $HOME/.scripts/i3/lock.sh'
+alias ZZZ='systemctl hibernate -i && $HOME/.scripts/i3/lock.sh'
 alias python-env="source $HOME/.scripts/misc/python-env"
 
 # brightness settings
@@ -88,8 +94,9 @@ alias cpwd='xclip -selection clipboard -i <(pwd | tr -d "\n")'
 # copy the last command issued to the clipboard
 alias clc='fc -ln -1 | tr -d "\n" | sed "s/^\s*//g" | xclip -selection clipboard -i'
 
-alias fcd='cd $(fd -t d | fzf)'
-alias cdf='cd $(fd -t d | fzf)'
+alias fcd='cd "$(fd -t d | fzf)"'
+alias cdf='cd "$(fd -t d | fzf)"'
+alias cdp='cd "$(fd -t d --full-path --maxdepth 3 /home/msc/projects | fzf)"'
 # ipaddr
 alias ipa='ip --brief --color add'
 
@@ -101,6 +108,10 @@ alias cpy='xclip -selection clipboard'
 alias pubip="dig +short myip.opendns.com @resolver1.opendns.com"
 alias localip="ip a | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'"
 
+
+# for weird manjaro stuff
+alias fixsudo="cat /etc/sudoers.d/10-installer"
+
 # search files with fzf and open them
 function sf {
         file=$(fzf --preview='head -n$LINES {}')

+ 65 - 0
.config/fontconfig/conf.d/56-twemoji-color.conf

@@ -0,0 +1,65 @@
+<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+<!-- REQUIRES Noto fonts (along with Noto Color Emoji)
+     run `fc-list | grep -i -e "noto sans" -e "noto serif" -e "noto color emoji"` to confirm
+-->
+
+ <alias>
+ <!-- Change the string in the family tag to whatever font -->
+    <family>serif</family>
+    <prefer><family>Noto Serif</family></prefer>
+  </alias>
+  <alias>
+    <family>sans-serif</family>
+    <prefer><family>Noto Sans</family></prefer>
+  </alias>
+  <alias>
+    <family>sans</family>
+    <prefer><family>Noto Sans</family></prefer>
+  </alias>
+  <alias>
+    <family>monospace</family>
+    <prefer><family>Noto Mono</family></prefer>
+  </alias>
+
+   <!-- This adds Noto Color Emoji to the font families sans, serif, sans-serif and monospace -->
+  <match target="pattern">
+        <test name="family"><string>monospace</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+  <match target="pattern">
+        <test name="family"><string>sans</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+
+  <match target="pattern">
+        <test name="family"><string>serif</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+  <!-- Discord loads the system's sans-serif font family, add Noto Color Emoji to it -->
+  <match target="pattern">
+        <test name="family"><string>sans-serif</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+    </match>
+
+   <!-- Add emoji generic family -->
+  <alias binding="strong">
+    <family>emoji</family>
+    <default><family>Noto Color Emoji</family></default>
+  </alias>
+
+  <!-- Alias requests for the other emoji fonts -->
+  <alias binding="strong">
+    <family>Apple Color Emoji</family>
+    <prefer><family>Noto Color Emoji</family></prefer>
+    <default><family>emoji</family></default>
+  </alias>
+  <alias binding="strong">
+    <family>Segoe UI Emoji</family>
+    <prefer><family>Noto Color Emoji</family></prefer>
+    <default><family>emoji</family></default>
+  </alias>
+
+<!-- Run "fc-cache -fv" after saving the file and kill and restart whichever app (like discord) and enjoy emoji -->
+
+</fontconfig>

+ 65 - 0
.config/fontconfig/fonts.conf

@@ -0,0 +1,65 @@
+<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+<!-- REQUIRES Noto fonts (along with Noto Color Emoji)
+     run `fc-list | grep -i -e "noto sans" -e "noto serif" -e "noto color emoji"` to confirm and sudo apt-get install fonts-noto to install the fonts
+-->
+
+ <alias>
+ <!-- Change the string in the family tag to whatever font -->
+    <family>serif</family>
+    <prefer><family>Noto Serif</family></prefer>
+  </alias>
+  <alias>
+    <family>sans-serif</family>
+    <prefer><family>Noto Sans</family></prefer>
+  </alias>
+  <alias>
+    <family>sans</family>
+    <prefer><family>Noto Sans</family></prefer>
+  </alias>
+  <alias>
+    <family>monospace</family>
+    <prefer><family>Noto Mono</family></prefer>
+  </alias>
+
+   <!-- This adds Noto Color Emoji to the font families sans, serif, sans-serif and monospace -->
+  <match target="pattern">
+        <test name="family"><string>monospace</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+  <match target="pattern">
+        <test name="family"><string>sans</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+
+  <match target="pattern">
+        <test name="family"><string>serif</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+  </match>
+  <!-- Discord loads the system's sans-serif font family, add Noto Color Emoji to it -->
+  <match target="pattern">
+        <test name="family"><string>sans-serif</string></test>
+        <edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
+    </match>
+
+   <!-- Add emoji generic family -->
+  <alias binding="strong">
+    <family>emoji</family>
+    <default><family>Noto Color Emoji</family></default>
+  </alias>
+
+  <!-- Alias requests for the other emoji fonts -->
+  <alias binding="strong">
+    <family>Apple Color Emoji</family>
+    <prefer><family>Noto Color Emoji</family></prefer>
+    <default><family>emoji</family></default>
+  </alias>
+  <alias binding="strong">
+    <family>Segoe UI Emoji</family>
+    <prefer><family>Noto Color Emoji</family></prefer>
+    <default><family>emoji</family></default>
+  </alias>
+
+<!-- Run "fc-cache -fv" after saving the file and kill and restart whichever app (like discord) and enjoy emoji -->
+
+</fontconfig>

+ 1 - 1
.config/i3/config

@@ -103,7 +103,7 @@ bindsym $mod+n exec $dropdownnotes
 bindsym $mod+u exec $HOME/.scripts/tools/umount.sh
 
 # unicode emoji finder
-bindsym $mod+i exec $HOME/.scripts/i3/unicode.sh
+bindsym $mod+i exec rofimoji
 
 # yt-mpv
 bindsym $mod+y exec $HOME/.scripts/tools/yt-viewer.sh

+ 1 - 1
install.sh

@@ -7,7 +7,7 @@ read yesno
 if [[ "$yesno" == "y" ]]; then
     echo "[*] Installing most popular tools"
     # most important tools that are _always_ needed
-    sudo pacman -Sy fzf fd neovim ripgrep nmap hexyl ctags git podman ueberzug duf exa i3blocks udiskie alacritty rofi firefox python-pip vifm zathura zathura-pdf-mupdf sxiv feh xclip flameshot manjaro-pipewire pavucontrol
+    sudo pacman -Sy fzf fd neovim ripgrep nmap hexyl ctags git podman ueberzug duf exa i3blocks udiskie alacritty rofi firefox python-pip vifm zathura zathura-pdf-mupdf sxiv feh xclip flameshot manjaro-pipewire pavucontrol rofimoji noto-font noto-fonts-emoji noto-fonts-extra
 fi