Add a dedicated folder for wal themes

This commit is contained in:
foo-dogsquared 2020-03-27 02:52:38 +08:00
parent 1533e4ade4
commit 9f4b3c902f
11 changed files with 331 additions and 31 deletions

View File

@ -128,7 +128,7 @@ A few examples of which is my cron setups where it is tasked with updating and c
== Configured programs
Here's a list of the programs with details on the config found in this repo.
Each of the directory is designed to be used/managed with https://www.gnu.org/software/stow/[GNU Stow] at the indicated target path.
Each of the listed directory is designed to be used/managed with https://www.gnu.org/software/stow/[GNU Stow] at the indicated target path.
=== https://github.com/baskerville/bspwm[bspwm]
@ -332,6 +332,25 @@ It is also monthly updated from a cron job.
* The setup also uses `yay` as the AUR helper tool.
=== https://github.com/dylanaraps/pywal[Pywal]
Pywal is a tool for generating color schemes from an image.
It is mainly used to produce templates for different applications (e.g., Vim, Visual Studio, the tty).
* The config directory is at `wal`.
* The usual target path would be on `~/.local/share/wal`.
The target path is more lenient since it only contains data files.
You have more choices here.
* Minimum version (from `wal -v`):
** `wal 3.3.0`
* The folder only contains a bunch of themes in JSON files.
All of the data files are named after the filenames of the wallpapers.
A few of them are listed in the <<Wallpapers>> section for the sources.
The JSON files does need a little bit of tweaking especially with the `wallpaper` key.
You could apply them with `wal --theme /path/to/file`.
* To easily create some more themes into JSON, I've created a small script named `create-wal-theme` located in my custom scripts location.
== Additional programs used
@ -362,36 +381,41 @@ TIP: I recommend to start at this list especially if you're starting with a bare
=== General purpose programs
* https://audacious-media-player.org/[Audacious] - An audio player with various listening options.
* https://feh.finalrewind.org/[feh] - A minimal image viewer.
* https://www.mozilla.org/en-US/firefox/new/[Firefox] - One of the major web browser second to Chrome.
* https://github.com/naelstrof/maim[maim] - A simple screenshot utility.
* https://obsproject.com/[OBS Studio] - A facility for streaming and recording videos.
* https://www.shotcut.org/[Shotcut] - A video editor built with the https://www.mltframework.org/[MLT Framework].
* https://docs.xfce.org/xfce/thunar/start[Thunar] - A file manager. A part of the Xfce desktop environment.
* https://www.thunderbird.net/[Thunderbird] - A email client.
* https://www.videolan.org/vlc/[VLC Media Player] - A multimedia player.
* https://weechat.org/[Weechat] - An IRC client on the command line.
=== Device drivers and servers
* https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture[ALSA] - A Linux
sound driver.
* https://ffmpeg.org/[ffmpeg] - A multimedia codec including for MP4, FLV, and more. Also can be used as a recorder.
* https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture[ALSA] - A Linux sound driver.
* https://wiki.archlinux.org/index.php/NetworkManager[GNOME NetworkManager]
* https://www.nvidia.com/Download/index.aspx?lang=en-us[NVIDIA Driver] - Since
I have an NVIDIA-based GPU (NVIDIA GeForce GT 630), I have to use that. I also have to
use the https://www.archlinux.org/packages/extra/x86_64/nvidia-390xx/[legacy version].
* https://www.nvidia.com/Download/index.aspx?lang=en-us[NVIDIA Driver] - Since I have an NVIDIA-based GPU (NVIDIA GeForce GT 630), I have to use that.
I also have to use the https://www.archlinux.org/packages/extra/x86_64/nvidia-390xx/[legacy version].
=== Multimedia-related tools
* https://audacious-media-player.org/[Audacious] - An audio player with various listening options.
* https://ffmpeg.org/[ffmpeg] - A multimedia codec including for MP4, FLV, and more.
* https://www.imagemagick.org/[ImageMagick] - A software suite for graphics.
Also can be used as a recorder.
* https://obsproject.com/[OBS Studio] - A facility for streaming and recording videos.
* https://www.shotcut.org/[Shotcut] - A video editor built with the https://www.mltframework.org/[MLT Framework].
* https://www.videolan.org/vlc/[VLC Media Player] - A multimedia player.
=== Music production
* https://kx.studio/Applications:Cadence[Cadence] - A set of audio tools. Part of the KX Studio project.
* https://kx.studio/Applications:Carla[Carla] - An audio plug-in host supporting various audio
plug-in formats such as VST2/3, SF2, and SFZ. Part of the KX Studio project.
* https://kx.studio/Applications:Carla[Carla] - An audio plug-in host supporting various audio plug-in formats such as VST2/3, SF2, and SFZ.
Part of the KX Studio project.
* https://lmms.io/[LMMS] - A digital audio workstation for beat production.
* https://musescore.org/[Musescore] - A music composition and notation software.
* https://supercollider.github.io/[SuperCollider] - A platform for audio synthesis and algorithmic composition.
=== Design
@ -407,10 +431,26 @@ plug-in formats such as VST2/3, SF2, and SFZ. Part of the KX Studio project.
* https://github.com/belluzj/fantasque-sans[Fantasque Sans Mono]
* https://github.com/tonsky/FiraCode[Fira Code] - A programmer-oriented font that supports ligatures.
* https://github.com/be5invis/iosevka[Iosevka]
* https://github.com/be5invis/iosevka[Iosevka] - A monospace text that features ligatures and provides a wide variety of symbols.
It is currently my terminal font.
* http://www.gust.org.pl/projects/e-foundry/lm-math[Latin Modern Math] - A serif font specifically for mathematical and scientific work.
It is based from Computer Modern Math (the default typeface for LaTeX documents).
It is also my go-to font for mathematical fonts.
* https://github.com/ryanoasis/nerd-fonts[Nerd Fonts] - A suite of font tools.
Also offers 40+ patched fonts of the popular fonts such as Iosevka, Fira Code, and many others.
* https://github.com/googlefonts/noto-fonts[Noto Fonts]
* https://github.com/googlefonts/noto-fonts[Noto Fonts] - A font family provided by Google.
Features a wide support for a variety of languages and styles.
* https://www.ibm.com/plex/[Plex] - The font family of IBM.
Offers a wide variety of styles from the serif, sans, and monospace.
footnote:[There is a plan to extend the fonts to include mathematical symbols but as of 2020-03-27, it's not yet complete.]
* https://github.com/adobe-fonts/source-serif-pro[Source Serif Pro] - A free and open source serif font by Frank Grießhammer for Adobe.
Part of the Adobe's Source Pro open source font family.
It is also my go-to serif font for my documents (e.g., LaTeX documents).
* https://github.com/adobe-fonts/source-sans-pro[Source Sans Pro] - Another one of the Adobe's Source Pro open source font family.
I use it when paired with Source Serif Pro.
The go-to sans font for my go-to serif font.
* https://github.com/stipub/stixfonts[STIX] - A mathematical font based from the Times New Roman font.
This is my second math font of choice.
=== Documents

80
bin/create-wal-theme Normal file
View File

@ -0,0 +1,80 @@
#!/usr/bin/env sh
# Create a theme with wal and copy the theme JSON in the appropriate location.
# Dependencies:
# * GNU coreutils 8.31
# * wal 3.3.0
function extract_path_without_ext() {
local path=$1
local filename=$(basename -- "$path")
# Return the filename without the file extension.
# For more information, you can look up the parameter expansion in
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html.
# Even if the filename has no extension, it will print the whole filename.
printf "${filename%.*}"
}
# Constant settings
LIGHT_MODE_SUFFIX='__light'
XDG_CACHE_HOME=${XDG_CACHE_HOME:-"$HOME/.cache"}
CACHE_DIR=${PYWAL_CACHE_DIR:-"$XDG_CACHE_HOME/wal"}
help_section="Create a theme with wal and copy the theme JSON in the appropriate location.
Usage: $0 IMAGE_PATH [-o/--output OUTPUT_DIR] [--light-mode]
Options:
* -o, --output OUTPUT_DIR - The location where the JSON file will be copied.
The given argument should be a directory that already exists.
The default value is given from the 'OUTPUT' variable.
* --light-mode - Create a light mode theme.
Appends the resulting file name with '$LIGHT_MODE_SUFFIX'.
* -b, --background BG_COLOR - Creates the theme with the following background color.
This is passed to the 'wal' command.
"
# Setting the variables for the program.
# Feel free to change `OUTPUT_DIR`.
OUTPUT_DIR="~/.local/share/wal"
LIGHT_MODE=0
IMAGE_PATH="$1"
while [[ $# -gt 0 ]]
do
case $1 in
-h|--help)
printf "$help_section"
exit 0;;
-o|--output)
OUTPUT_DIR="$2"
shift
shift;;
--light-mode)
LIGHT_MODE=1
shift;;
-b|--background)
BG_COLOR="$2"
shift
shift;;
*)
shift;;
esac
done
image_basename=$(extract_path_without_ext "$IMAGE_PATH")
wal_command_string="wal -i $IMAGE_PATH"
output_file=$([ $LIGHT_MODE -eq 1 ] && echo "$OUTPUT_DIR/$image_basename$LIGHT_MODE_SUFFIX.json" || echo "$OUTPUT_DIR/$image_basename.json")
if [[ $LIGHT_MODE -eq 1 ]]; then
wal_command_string+=" -l"
fi
if [[ -n "$BG_COLOR" ]]; then
wal_command_string+=" -b $BG_COLOR"
fi
command -p $wal_command_string && cp "$CACHE_DIR/colors.json" "$output_file"

56
bin/extract Normal file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env sh
# Extracts the archive.
# The process can vary depending on the file extension.
# Usage: $0 ARCHIVE_FILE
# Dependencies:
# * xxd V1.10 27oct98 by Juergen Weigert
# * UnZip 6.00 of 20 April 2009
# * tar (GNU tar) 1.32
# * printf (GNU coreutils 8.31)
function get_bytes() {
local file=$1
local length=${2:-20}
# Getting the file signature.
# At most, we will just get the first 20 bytes of the file.
local file_sig=$(xxd -l "$length" -ps "$file")
printf "$file_sig"
}
function extract_path_without_ext() {
local path=$1
local filename=$(basename -- "$path")
# Return the filename without the file extension.
# For more information, you can look up the parameter expansion in
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html.
# Even if the filename has no extension, it will print the whole filename.
printf "${filename%.*}"
}
function extract_file() {
local file=$1
local length=$2
# Checking the file signatures.
# The reference is at https://en.wikipedia.org/wiki/List_of_file_signatures.
local file_sig=$(get_bytes "$file" "$length")
# Extracting the extension out of the given file and creating a directory out of it.
local file_without_ext=$(extract_path_without_ext "$file")
mkdir -p "$file_without_ext"
# Checking if the file signature matches of a zip
if [[ $(printf "$file_sig" | head -c 4) == "504b" ]]; then
cd "$file_without_ext" && unzip "../$file"
else
tar xf "$file" --directory "$file_without_ext"
fi
}
extract_file $1

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env sh
# A script that utilizes OCR for a screenshot and copies the text to the clipboard.

View File

@ -47,7 +47,7 @@ file 5.38-3
filesystem 2019.10-2
findutils 4.7.0-2
firefox 74.0-2
firefox-developer-edition 75.0b7-1
firefox-developer-edition 75.0b9-1
flex 2.6.4-3
freeciv 2.6.2-1
freeglut 3.2.1-1
@ -57,6 +57,7 @@ gcc-libs 9.3.0-1
gdb 9.1-2
gettext 0.20.1-3
gimp 2.10.18-4
gimp-help-en 2.10.0-1
git 2.26.0-1
glava 1.6.3-1
glibc 2.31-2
@ -69,7 +70,7 @@ groff 1.22.4-3
gvfs 1.44.0-1
gzip 1.10-3
htop 2.2.0-3
hugo 0.68.2-1
hugo 0.68.3-1
i3-gaps 4.18-1
i3blocks 1.5-3
i3status 2.13-2
@ -89,7 +90,7 @@ krita 4.2.9-1
less 551-3
libtool 2.4.6+42+gb88cebd5-11
licenses 20191011-2
linux 5.5.11.arch1-1
linux 5.5.13.arch1-1
linux-firmware 20200224.efcfa03-1
lldb 9.0.1-1
llvm 9.0.1-2
@ -116,10 +117,10 @@ networkmanager 1.22.10-1
nnn 3.0-1
nodejs 13.11.0-1
noto-fonts 20190926-4
noto-fonts-emoji 20191016-5
npm 6.14.3-1
noto-fonts-emoji 20191016-6
npm 6.14.4-1
ntfs-3g 2017.3.23-4
obs-studio 25.0.1-1
obs-studio 25.0.3-1
octave 5.2.0-1
otf-latin-modern 2.004-3
otf-latinmodern-math 1.959-3
@ -127,7 +128,7 @@ p7zip 16.02-5
pacman 5.2.1-4
pacman-contrib 1.3.0-1
pamixer 1.4-3
pandoc 2.9.2-72
pandoc 2.9.2-73
patch 2.7.6-8
pavucontrol 1:4.0-1
pciutils 3.6.4-1
@ -184,7 +185,7 @@ texlive-formatsextra 2019.51280-1
texlive-latexextra 2019.52575-1
texlive-pictures 2019.52499-1
texlive-science 2019.52582-1
thunar 1.8.13-1
thunar 1.8.14-1
thunar-volman 0.9.5-2
thunderbird 68.6.0-1
timidity++ 2.15.0-2
@ -260,7 +261,7 @@ xorg-xvinfo 1.1.4-1
xorg-xwd 1.0.7-1
xorg-xwininfo 1.1.5-1
xorg-xwud 1.0.5-1
youtube-dl 2020.03.08-1
youtube-dl 2020.03.24-1
zathura 0.4.5-1
zathura-pdf-mupdf 0.3.5-2
zsh 5.8-1

View File

@ -63,3 +63,8 @@ snippet qw-as "Asciidoctor" iw
Asciidoctor
endsnippet
# Miscellaneous snippets
snippet #! "Quick snippet for a shebang." bi
#!${1:/usr/bin/env} ${2:sh}
endsnippet

View File

@ -19,8 +19,14 @@ snippet "h(\d)" "Quick header snippet" bir
header_level = int(match.group(1))
legit_header_level = True if header_level >= 1 and header_level <= 6 else False
snip.rv = "=" * header_level if legit_header_level else ""
`
if header_level == 2:
snip.rv = "\n" * 4
else:
snip.rv = "\n" * 2
snip.rv += "=" * header_level if legit_header_level else ""
` ${1:Chapter name}
$0
endsnippet

28
wal/alien-moon.json Normal file
View File

@ -0,0 +1,28 @@
{
"wallpaper": "/home/foo-dogsquared/wallpapers/alien-moon.jpg",
"alpha": "100",
"special": {
"background": "#221e21",
"foreground": "#ede3e7",
"cursor": "#ede3e7"
},
"colors": {
"color0": "#221e21",
"color1": "#95A6BC",
"color2": "#D2B3BF",
"color3": "#A5AFC4",
"color4": "#D7A9C8",
"color5": "#F0B6CE",
"color6": "#F9CCD5",
"color7": "#ede3e7",
"color8": "#a59ea1",
"color9": "#95A6BC",
"color10": "#D2B3BF",
"color11": "#A5AFC4",
"color12": "#D7A9C8",
"color13": "#F0B6CE",
"color14": "#F9CCD5",
"color15": "#ede3e7"
}
}

28
wal/forest-bright.json Normal file
View File

@ -0,0 +1,28 @@
{
"wallpaper": "/home/foo-dogsquared/wallpapers/forest-bright.jpg",
"alpha": "100",
"special": {
"background": "#04142E",
"foreground": "#d7d2ce",
"cursor": "#d7d2ce"
},
"colors": {
"color0": "#04142E",
"color1": "#E7AE79",
"color2": "#206D8B",
"color3": "#5B6F88",
"color4": "#2E94A8",
"color5": "#5AA5B1",
"color6": "#59BDC9",
"color7": "#d7d2ce",
"color8": "#969390",
"color9": "#E7AE79",
"color10": "#206D8B",
"color11": "#5B6F88",
"color12": "#2E94A8",
"color13": "#5AA5B1",
"color14": "#59BDC9",
"color15": "#d7d2ce"
}
}

View File

@ -0,0 +1,28 @@
{
"wallpaper": "/home/foo-dogsquared/wallpapers/hotline-miami-iv-alt.png",
"alpha": "100",
"special": {
"background": "#221e21",
"foreground": "#f4cec7",
"cursor": "#f4cec7"
},
"colors": {
"color0": "#221e21",
"color1": "#D06E7F",
"color2": "#AD3C84",
"color3": "#F65286",
"color4": "#FD7089",
"color5": "#FD918C",
"color6": "#FEAF90",
"color7": "#f4cec7",
"color8": "#aa908b",
"color9": "#D06E7F",
"color10": "#AD3C84",
"color11": "#F65286",
"color12": "#FD7089",
"color13": "#FD918C",
"color14": "#FEAF90",
"color15": "#f4cec7"
}
}

28
wal/nebula.json Normal file
View File

@ -0,0 +1,28 @@
{
"wallpaper": "/home/foo-dogsquared/wallpapers/nebula.jpg",
"alpha": "100",
"special": {
"background": "#0c080b",
"foreground": "#e5e3e3",
"cursor": "#e5e3e3"
},
"colors": {
"color0": "#0c080b",
"color1": "#A83D63",
"color2": "#D09177",
"color3": "#506699",
"color4": "#B5659A",
"color5": "#4DA6CE",
"color6": "#AEA0C7",
"color7": "#e5e3e3",
"color8": "#a09e9e",
"color9": "#A83D63",
"color10": "#D09177",
"color11": "#506699",
"color12": "#B5659A",
"color13": "#4DA6CE",
"color14": "#AEA0C7",
"color15": "#e5e3e3"
}
}