Author: ninjaaron Language: bash
Description: script to generate .Xresources Timestamp: 2012-09-10 16:11:51 -0400
View raw paste Reply
  1. #!/bin/bash
  2. # generates and loads a new ~/.Xresources file based on settings from another file.
  3.  
  4. # get the settings
  5. theme=$(cat ~/.themes/theme)
  6. font="bitocrafull"
  7. source ~/.themes/"$theme"
  8.  
  9. # write the comments and colors
  10. echo "! -----------------------------------------------
  11. ! $theme_name theme
  12. ! file:     ~/.Xresources
  13. ! author:   Aaron \"ninjaaron\" Christianson
  14. ! modified: $date_modified
  15. ! -----------------------------------------------
  16.  
  17. ! color scheme
  18. *background: $bg_color
  19. *foreground: $fg_color
  20. ! Black + DarkGrey
  21. *color0:  $black
  22. *color8:  $dark_grey
  23. ! Red
  24. *color1:  $red
  25. *color9:  $light_red
  26. ! Green
  27. *color2:  $green
  28. *color10: $light_green
  29. ! Yellow
  30. *color3:  $yellow
  31. *color11: $light_yellow
  32. ! Blue
  33. *color4:  $blue
  34. *color12: $light_blue
  35. ! Magenta
  36. *color5:  $magenta
  37. *color13: $light_magenta
  38. ! Cyan
  39. *color6:  $cyan
  40. *color14: $light_cyan
  41. ! LightGrey + White
  42. *color7: $light_gray
  43. *color15: $white" > ~/.Xresources
  44.  
  45. # add fadding if desired
  46. if [ -n "$fading" ]; then
  47.   echo "
  48. ! fading options
  49. URxvt.fadeColor: $bg_color
  50. URxvt.fading: 50" >> ~/.Xresources
  51. fi
  52.  
  53. # add transparency based on settings
  54. if [ "$transparent" = "true" ];then
  55.   echo "
  56. ! transparency settings
  57. URxvt.transparent: true" >> ~/.Xresources
  58.   if [ -z "$tr_settings" ];then
  59.     echo "URxvt.shading: 25" >> ~/.Xresources
  60.   elif [ "$tr_settings" = "light" ];then
  61.     echo "URxvt.shading: 170" >> ~/.Xresources
  62.   else
  63.     echo "$tr_settings" >> ~/.Xresources
  64.   fi
  65. fi
  66.  
  67. # add font and various other universal defaults
  68. echo "
  69. ! font
  70. URxvt.font: xft:$font,xft:Miriam Mono CLM:style=bold
  71.  
  72. ! scrollbar
  73. URxvt.scrollBar: off
  74.  
  75. ! link handing
  76. URxvt.perl-ext:      default,url-select
  77. URxvt.keysym.M-u:    perl:url-select:select_next
  78. URxvt.urlLauncher:   firefox
  79. URxvt.underlineURLs: true
  80.  
  81. ! fonts to choose
  82. URxvt.keysym.M-C-0x37: command:\033]710;-*-bitocra7-*,xft:Miriam Mono CLM:style=bold\007
  83. URxvt.keysym.M-C-0x31: command:\033]710;xft:bitocrafull,xft:Miriam Mono CLM:style=bold\007
  84. URxvt.keysym.M-C-0x33: command:\033]710;xft:bitocra13,xft:Miriam Mono CLM:style=bold\007
  85. URxvt.keysym.M-C-0x30: command:\033]710;xft:bitbuntufull,xft:Miriam Mono CLM:style=bold\007
  86. URxvt.keysym.M-C-0x32: command:\033]710;-*-fixed-medium-r-*-*-12-*\007
  87. URxvt.keysym.M-C-0x36: command:\033]710;xft:5thElementHeb,xft:Miriam Mono CLM:style=bold\007
  88. URxvt.keysym.M-C-0x35: command:\033]710;-*-5thElementHeb-*\007
  89. URxvt.keysym.M-C-0x38: command:\033]710;xft:bitocra7Heb,xft:Miriam Mono CLM:style=bold\007
  90. URxvt.keysym.M-C-u: command:\033]710;xft:Ubuntu Mono:pixelsize=11:style=bold,xft:Miriam Mono CLM:style=bold\007
  91. URxvt.keysym.M-C-m: command:\033]710;xft:Miriam Mono CLM:pixelsize=20:style=bold\007
  92. URxvt.keysym.M-C-o: command:\033]710;xft:ocra10:pixelsize=10,xft:Miriam Mono CLM:style=bold\007
  93. URxvt.keysym.M-C-d: command:\033]710;xft:Dejavu Sans Mono:pixelsize=9:antialias=false,xft:Miriam Mono CLM:style=bold\007
  94. " >> ~/.Xresources
  95.  
  96. xrdb ~/.Xresources
  97. echo $fading
  98.  
View raw paste Reply