this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial Commit

yemou e1ba1ef8

+302
+24
LICENSE
··· 1 + This is free and unencumbered software released into the public domain. 2 + 3 + Anyone is free to copy, modify, publish, use, compile, sell, or 4 + distribute this software, either in source code form or as a compiled 5 + binary, for any purpose, commercial or non-commercial, and by any 6 + means. 7 + 8 + In jurisdictions that recognize copyright laws, the author or authors 9 + of this software dedicate any and all copyright interest in the 10 + software to the public domain. We make this dedication for the benefit 11 + of the public at large and to the detriment of our heirs and 12 + successors. We intend this dedication to be an overt act of 13 + relinquishment in perpetuity of all present and future rights to this 14 + software under copyright law. 15 + 16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 + OTHER DEALINGS IN THE SOFTWARE. 23 + 24 + For more information, please refer to <http://unlicense.org/>
+20
README
··· 1 + # description 2 + thm is a shell script that applies colors to a template file. 3 + 4 + # usage 5 + thm theme_name 6 + 7 + the theme_name does not include the `.theme` at the end of the file. 8 + 9 + # directories 10 + By default, the config files will be searched for in `$XDG_CONFIG_HOME/thm` or `$HOME/.config/thm`. 11 + The generated files will be placed in either `$XDG_CACHE_HOME/thm` or `$HOME/.cache/thm`. This can 12 + be changed by setting the environment variables `THM_CONFIG_DIR` and `THM_DEST_DIR`. The dest dir 13 + is cleared while running. 14 + 15 + # inside config directory 16 + The themes directory holds shell scripts defining the colors. These files should end with `.theme` 17 + if they should be usable with thm. The templates directory holds files for generating the themes. 18 + These files should end with `.template` The scripts directory holds files to be executed after thm 19 + is finished generating all the files. These files should be executable in order for thm to launch 20 + them. Examples of these files can be found in the examples directory of this repository.
+2
exmaples/scripts/reload-sway
··· 1 + #!/bin/sh 2 + swaymsg reload
+22
exmaples/templates/colors.sh.template
··· 1 + #!/bin/sh 2 + 3 + bg_color='{bg_color}' 4 + fg_color='{fg_color}' 5 + 6 + color0='{color0}' 7 + color1='{color1}' 8 + color2='{color2}' 9 + color3='{color3}' 10 + color4='{color4}' 11 + color5='{color5}' 12 + color6='{color6}' 13 + color7='{color7}' 14 + 15 + color8='{color8}' 16 + color9='{color9}' 17 + color10='{color10}' 18 + color11='{color11}' 19 + color12='{color12}' 20 + color13='{color13}' 21 + color14='{color14}' 22 + color15='{color15}'
+29
exmaples/templates/sway-colors.template
··· 1 + # class border background text indicator child_border 2 + client.focused #{color5} #{color13} #{bg_color} #{color5} #{color5} 3 + client.focused_inactive #{color4} #{color12} #{bg_color} #{color4} #{color4} 4 + client.unfocused #{color8} #{color8} #{bg_color} #{color8} #{color8} 5 + client.urgent #{color1} #{color9} #{bg_color} #{color1} #{color1} 6 + 7 + # set variables 8 + set { 9 + $bg_color {bg_color} 10 + $fg_color {fg_color} 11 + 12 + $color0 {color0} 13 + $color1 {color1} 14 + $color2 {color2} 15 + $color3 {color3} 16 + $color4 {color4} 17 + $color5 {color5} 18 + $color6 {color6} 19 + $color7 {color7} 20 + $color8 {color8} 21 + $color9 {color9} 22 + 23 + $color10 {color10} 24 + $color11 {color11} 25 + $color12 {color12} 26 + $color13 {color13} 27 + $color14 {color14} 28 + $color15 {color15} 29 + }
+21
exmaples/themes/default-dark.theme
··· 1 + #!/bin/sh 2 + 3 + bg_color="000000" 4 + fg_color="ffffff" 5 + 6 + color0="000000" 7 + color1="800000" 8 + color2="008000" 9 + color3="808000" 10 + color4="000080" 11 + color5="800080" 12 + color6="008080" 13 + color7="c0c0c0" 14 + color8="808080" 15 + color9="ff0000" 16 + color10="00ff00" 17 + color11="ffff00" 18 + color12="0000ff" 19 + color13="ff00ff" 20 + color14="00ffff" 21 + color15="ffffff"
+21
exmaples/themes/default-light.theme
··· 1 + #!/bin/sh 2 + 3 + bg_color="ffffff" 4 + fg_color="000000" 5 + 6 + color0="ffffff" 7 + color1="800000" 8 + color2="008000" 9 + color3="808000" 10 + color4="000080" 11 + color5="800080" 12 + color6="008080" 13 + color7="808080" 14 + color8="c0c0c0" 15 + color9="ff0000" 16 + color10="00ff00" 17 + color11="ffff00" 18 + color12="0000ff" 19 + color13="ff00ff" 20 + color14="00ffff" 21 + color15="000000"
+20
exmaples/themes/grayscale-light.theme
··· 1 + #!/bin/sh 2 + bg_color="efefef" 3 + fg_color="1f1f1f" 4 + 5 + color0="efefef" 6 + color1="b0b0b0" 7 + color2="9d9d9d" 8 + color3="8a8a8a" 9 + color4="787878" 10 + color5="656565" 11 + color6="525252" 12 + color7="3f3f3f" 13 + color9="808080" 14 + color8="bfbfbf" 15 + color10="707070" 16 + color11="606060" 17 + color12="505050" 18 + color13="3f3f3f" 19 + color14="2f2f2f" 20 + color15="1f1f1f"
+21
exmaples/themes/light.theme
··· 1 + #!/bin/sh 2 + 3 + bg_color="efefef" 4 + fg_color="1f1f1f" 5 + 6 + color0="efefef" 7 + color1="e67b7b" 8 + color2="80ba63" 9 + color3="f5a868" 10 + color4="849ce6" 11 + color5="b37fe3" 12 + color6="6ebdc4" 13 + color7="3f3f3f" 14 + color8="b0b0b0" 15 + color9="ed9a9a" 16 + color10="a3d989" 17 + color11="f7c297" 18 + color12="a6baf5" 19 + color13="d1adf2" 20 + color14="bedcde" 21 + color15="1f1f1f"
+122
thm
··· 1 + #!/bin/sh 2 + # shellcheck disable=SC1090,SC2154 3 + 4 + # Usage statement 5 + usage() { 6 + printf '%s\n' "usage: ${0##*/} theme" 7 + } 8 + 9 + # Convert hex colors into rgb 10 + hex2rgb() { 11 + hex=$1 12 + hex_r=${hex%????} 13 + hex_g=${hex#??} 14 + hex_g=${hex_g%??} 15 + hex_b=${hex%????} 16 + printf '%d,%d,%d' "0x$hex_r" "0x$hex_g" "0x$hex_b" 17 + } 18 + 19 + # Set directory variables 20 + [ "$THM_CONFIG_DIR" ] \ 21 + && conf_dir="$THM_CONFIG_DIR" \ 22 + || conf_dir="${XDG_CONFIG_HOME:-$HOME/.config}/thm" 23 + [ "$THM_DEST_DIR" ] \ 24 + && conf_dir="$THM_DEST_DIR" \ 25 + || dest_dir="${XDG_CACHE_HOME:-$HOME/.cache}/thm" 26 + 27 + err() { 28 + [ "$*" ] && err_msg="$*" || err_msg="error" 29 + printf '%s%b' "${0##*/}: " "$err_msg\n" 1>&2 30 + exit 1 31 + } 32 + 33 + # Ensure the theme file exist and source it 34 + case $1 in 35 + -h|h|--help|help ) usage; exit 0 ;; 36 + * ) [ "$1" ] || err "missing argument" 37 + [ -f "$conf_dir/themes/$1.theme" ] || err "$1: theme not found" 38 + theme_file="$conf_dir/themes/$1.theme" 39 + . "$theme_file" ;; 40 + esac 41 + 42 + # Create RGB colors from the hex colors 43 + bg_color_rgb="$(hex2rgb "$bg_color")" 44 + fg_color_rgb="$(hex2rgb "$fg_color")" 45 + color0_rgb="$(hex2rgb "$color0")" 46 + color1_rgb="$(hex2rgb "$color1")" 47 + color2_rgb="$(hex2rgb "$color2")" 48 + color3_rgb="$(hex2rgb "$color3")" 49 + color4_rgb="$(hex2rgb "$color4")" 50 + color5_rgb="$(hex2rgb "$color5")" 51 + color6_rgb="$(hex2rgb "$color6")" 52 + color7_rgb="$(hex2rgb "$color7")" 53 + color8_rgb="$(hex2rgb "$color8")" 54 + color9_rgb="$(hex2rgb "$color9")" 55 + color10_rgb="$(hex2rgb "$color10")" 56 + color11_rgb="$(hex2rgb "$color11")" 57 + color12_rgb="$(hex2rgb "$color12")" 58 + color13_rgb="$(hex2rgb "$color13")" 59 + color14_rgb="$(hex2rgb "$color14")" 60 + color15_rgb="$(hex2rgb "$color15")" 61 + 62 + # Make sure the dest_dir exist 63 + [ -d "$dest_dir" ] || { mkdir -p "$dest_dir" || err "failed to create $dest_dir"; } 64 + 65 + # Ensure the dest_dir is empty before populating it 66 + rm "$dest_dir/"* 67 + 68 + # Make a file with the name of the new theme 69 + printf '%s\n' "$theme_file" > "$dest_dir/current_thm" 70 + 71 + # Repalce template syntax with the actual colors 72 + for t in "${conf_dir}/templates/"*".template" 73 + do 74 + file_name=${t##*/} 75 + file_name=${file_name%.template} 76 + 77 + sed " 78 + s/{bg_color}/$bg_color/g 79 + s/{fg_color}/$fg_color/g 80 + s/{color0}/$color0/g 81 + s/{color1}/$color1/g 82 + s/{color2}/$color2/g 83 + s/{color3}/$color3/g 84 + s/{color4}/$color4/g 85 + s/{color5}/$color5/g 86 + s/{color6}/$color6/g 87 + s/{color7}/$color7/g 88 + s/{color8}/$color8/g 89 + s/{color9}/$color9/g 90 + s/{color10}/$color10/g 91 + s/{color11}/$color11/g 92 + s/{color12}/$color12/g 93 + s/{color13}/$color13/g 94 + s/{color14}/$color14/g 95 + s/{color15}/$color15/g 96 + s/{bg_color.rgb}/$bg_color_rgb/g 97 + s/{fg_color.rgb}/$fg_color_rgb/g 98 + s/{color0.rgb}/$color0_rgb/g 99 + s/{color1.rgb}/$color1_rgb/g 100 + s/{color2.rgb}/$color2_rgb/g 101 + s/{color3.rgb}/$color3_rgb/g 102 + s/{color4.rgb}/$color4_rgb/g 103 + s/{color5.rgb}/$color5_rgb/g 104 + s/{color6.rgb}/$color6_rgb/g 105 + s/{color7.rgb}/$color7_rgb/g 106 + s/{color8.rgb}/$color8_rgb/g 107 + s/{color9.rgb}/$color9_rgb/g 108 + s/{color10.rgb}/$color10_rgb/g 109 + s/{color11.rgb}/$color11_rgb/g 110 + s/{color12.rgb}/$color12_rgb/g 111 + s/{color13.rgb}/$color13_rgb/g 112 + s/{color14.rgb}/$color14_rgb/g 113 + s/{color15.rgb}/$color15_rgb/g 114 + " "$t" > "${dest_dir}/${file_name}" 115 + done 116 + 117 + # Run extra user scripts 118 + [ -d "$conf_dir/scripts" ] || return 0 119 + for i in "$conf_dir/scripts/"* 120 + do 121 + [ -x "$i" ] && $i > /dev/null 2>&1 & 122 + done