Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The GUI version for some reason is a different color than the Terminal Version #100

Closed
ryanpeach opened this issue Dec 1, 2019 · 2 comments

Comments

@ryanpeach
Copy link

ryanpeach commented Dec 1, 2019

https://imgur.com/a/1FJZF25

I'm struggling with finding a reason that my monokai theme looks different on this computer when in GUI mode vs Terminal. Any suggestions?

This is my .emacs.d:

https://github.com/ryanpeach/spacelite

This is the most relevant file:

https://github.com/ryanpeach/spacelite/blob/master/core/core-makeup.el

All of my installed packages:

(ag aggressive-indent benchmark-init bind-map bug-hunter centered-cursor-mode deft diminish elisp-format elpy ensime company eshell-prompt-extras eshell-z evil-anzu anzu evil-easymotion evil-escape evil-iedit-state evil-magit evil-org evil-surround evil exec-path-from-shell expand-region flycheck flyspell-popup google-this goto-chg groovy-mode haskell-mode helm-ag helm-projectile helm helm-core highlight-indentation highlight-numbers highlight-parentheses htmlize linum-relative lispy counsel iedit magit git-commit monokai-pro-theme monokai-theme mwim parent-mode popup pyvenv racer pos-tip restart-emacs rust-mode rustic markdown-mode projectile pkg-info epl sbt-mode scala-mode shell-pop solarized-theme spaceline powerline spinner swiper ivy transient treemacs ht hydra lv pfuture ace-window avy f s undo-tree use-package bind-key which-key whitespace-cleanup-mode winum dash with-editor async xterm-color yasnippet zoutline)

I'm using nixos and xmonad if that's relevant.

This is my .Xdefaults

#include ".Xresources-themes/iterm-Solarized_Dark.Xresources"

!! Transparency (0-1):
st.alpha: 0.8

!! Set a default font and font size as below:
st.font: xft:Dejavu Sans Mono for Powerline:size=11

! st.termname: st-256color
! st.borderpx: 2

!! Set the background, foreground and cursor colors as below:
*.background: #282828
*.foreground: white
*.cursorColor: white

! URxvt
URxvt.scrollBar: false
URxvt.font:     xft:Dejavu Sans Mono for Powerline:size=11
URxvt.alpha: 0.8
XTerm*faceName: xft:Dejavu Sans Mono for Powerline:size=11

This is my /etc/nixos/configuration.nix

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{

  # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  # Per-interface useDHCP will be mandatory in the future, so this generated config
  # replicates the default behaviour.
  networking.useDHCP = false;
  networking.interfaces.wlp1s0.useDHCP = true;

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Select internationalisation properties.
  i18n = {
    consoleFont = "Lat2-Terminus16";
    consoleKeyMap = "us";
    defaultLocale = "en_US.UTF-8";
  };

  # Set your time zone.
  time.timeZone = "America/New_York";

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
      mmv                              # Batch move utility
      calibre                          # Books
      gcc                              # Standard compiler
      gnumake                          # Makefiles
      libffi
      wget                             # Downloader
      vim                              # Minimal text editor
      tmux                             # Multiplexing
      tor                              # Tor Protocol
      brave                            # Web Browser
      fortune                          # Funny sayings
      figlet                           # Big Font
      cowsay                           # Funny Cow
      screenfetch                      # Show linux info
      lolcat                           # Colors
      emacs                            # OS
      git                              # Version control system
      stow                             # Dotfiles Manager
      unzip                            # Unzips packages
      firefox                          # Needed for adobe flash
      feh                              # Wallpaper Manager
      
      # Rust
      rustc                            # TODO: Rust Programming Language
      cargo                            # Rust language package manager
      rustfmt                          # Rust linter

      # Zsh
      zsh-powerlevel9k

      # Xmonad
      xlibs.xmessage
      haskellPackages.ghc
      haskellPackages.xmonad-contrib
      haskellPackages.xmonad-extras
      haskellPackages.xmonad-wallpaper
      haskellPackages.xmonad
      haskellPackages.xmobar

      # Haskell Emacs
      haskellPackages.apply-refact
      haskellPackages.hlint
      haskellPackages.stylish-haskell
      haskellPackages.hasktags
      haskellPackages.hoogle

      thefuck                          # Corrects bad bash
      ranger                           # TODO: File Browser
      weechat                          # TODO: IRC & Matrix
      weechat-matrix-bridge            # For the weechat matrix library
      dmenu                            # Launch bar
      rxvt_unicode                     # TODO: Terminal Emulator
      bc                               # Basic Calculator
      scrot                            # TODO: Screenshot capturing
      physlock                         # Screen locker
      stack                            # Haskell Environment Handling
      ispell                           # Spelling
      xfontsel                         # Fonts
      xlsfonts                         # Fonts
      # xclip                            # TODO: Clipboard command line util
      xautolock                        # To lock the screen

      # Wifi
      networkmanager                   # For graphical wifi management
      # gnome.nm-applet

      # Python 3
      python37
      # python36Packages.poetry
      python37Packages.virtualenv
      python37Packages.virtualenvwrapper
      python37Packages.yapf
      python37Packages.flake8
      python37Packages.rope

      pulseaudioFull                   # TODO: Audio
      openjdk                          # JDK
      gradle                           # Java package manager
  ];

  # IN CASE OF EMERGENCY
  # nixos-help, nixos-option
  # nix-env -qaP
  services.nixosManual.showManual = true;

  # GUI Network Manager
  # nmcli device wifi rescan
  # nmcli device wifi list
  # nmcli device wifi connect <SSID> password <password>
  networking.networkmanager.enable = true;

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };

  # Collect nix store garbage and optimize daily
  nix.gc.automatic = true;
  nix.autoOptimiseStore = true;

  # Enable Adobe Flash
  nixpkgs.config.firefox.enableAdobeFlash = true;

  # Zsh & Bash
  programs.zsh = {
    enable = true;
    ohMyZsh = {
      enable = true;
    };
    promptInit = "source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme";
  };

  # Emacs
  services.emacs.enable = true;
  services.emacs.defaultEditor = true;
  services.emacs.install = true;

  # Xserver
  services.xserver = {

    # Enable the X11 windowing system.
    enable = true;
    layout = "us";
    xkbOptions = "eurosign:e";

    # X Auto Lock
    xautolock.enable = true;
    xautolock.time = 15;
    xautolock.notify = 10;

    # Display Manager
    displayManager = {
      sddm.enable = true;
      sddm.autoNumlock = true;
    };

    # Desktop Manager
    desktopManager = {
      plasma5.enable = false;
      xterm.enable = false;
    };

    # XMonad
    windowManager.xmonad = {
      enable = true;
      enableContribAndExtras = true;
      extraPackages = haskellPackages: [
        haskellPackages.xmonad-contrib
        haskellPackages.xmonad-extras
        haskellPackages.xmonad-wallpaper
        haskellPackages.xmonad
        haskellPackages.xmobar
      ];
    };

    windowManager.default = "xmonad";
  };

  # Fonts
  fonts = {
    enableFontDir = true;
    enableGhostscriptFonts = true;
    fonts = with pkgs; [
      ubuntu_font_family
      liberation_ttf
      powerline-fonts
    ];
  };

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.rgpeach10 = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    shell = pkgs.zsh;
  };

  # Weechat
  services.weechat.enable = true;
  # packageOverrides = pkgs: rec {
  #   weechat = pkgs.weechat.override {
  #     configure = {availablePlugins}: {
  #       plugins = with availablePlugins: [weechat-matrix-bridge];
  #     };
  #   };
  # };

  # This value determines the NixOS release with which your system is to be
  # compatible, in order to avoid breaking some software such as database
  # servers. You should change this only after NixOS release notes say you
  # should.
  system.stateVersion = "19.09"; # Did you read the comment?
}

My xmonad config

-- REF: https://wiki.archlinux.org/index.php/Xmonad#Using_xmobar_with_xmonad
import XMonad

import XMonad.Util.Run
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks

import XMonad.Layout
import XMonad.Layout.NoBorders
import XMonad.Layout.Maximize
import XMonad.Layout.Spacing

import XMonad.Util.EZConfig
import XMonad.Actions.SpawnOn

import qualified Data.Map as M
import qualified XMonad.StackSet as W

import XMonad.Wallpaper

import XMonad.Config.Desktop

-- Gaps
gaps = spacingRaw True (Border 0 0 0 0) False (Border 8 8 8 8) True -- gaps (border / window spacing)

-- The main function.
main = do
  setRandomWallpaper ["$HOME/Pictures/Wallpaper"]
  h <- spawnPipe "xmobar -d"
  xmonad $ desktopConfig {
    borderWidth = 0
  , layoutHook = avoidStruts $ gaps $ smartBorders $ layoutHook def
  , logHook = dynamicLogWithPP $ xmobarPP
    { ppOutput = hPutStrLn h
    , ppCurrent = xmobarColor "#429942" "" . wrap "<" ">" 
    }
  , manageHook = myManageHook <+> manageHook def
  , startupHook = startupHook desktopConfig <+> myStartupHook
  , terminal = "urxvt"
  , workspaces = ["1:Net", "2:Terminal", "3:Code", "4:Org", "5", "6", "7", "8", "9"]
  , focusFollowsMouse = False
  } `additionalKeys` [ ((mod1Mask, xK_p), spawn "dmenu_run -b")
                     , ((mod1Mask, xK_e), spawn "emacsclient --create-frame")
                     , ((mod1Mask, xK_b), spawn "brave")
                     , ((mod1Mask, xK_t), spawn "urxvt")
                     ]
            
myStartupHook = do
  spawnOn "1:Net" "brave"
  spawnOn "2:Terminal" "urxvt"
  spawnOn "3:Code" "emacs"
  spawnOn "4:Org" "emacs ~/Org/Todos.org"
  spawnOn "4:Org" "emacs ~/.emacs.d/init.el"

myManageHook = composeAll [ manageDocks
                          , manageSpawn
                          ]
@oneKelvinSmith
Copy link
Owner

oneKelvinSmith commented Dec 9, 2019

Hi @ryanpeach,

I think the underlying issue is that emacs in the terminal is not using "TrueColor" (https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Colors-on-a-TTY).

It looks to me that the GUI colours you're seeing are more in line with the desired theme colours, while the terminal colours are the 256 approximation.

Unfortunately, I'm not familiar with NixOS but the 256/TrueColor problem is an old one. The reason you see different but similar colours is because this theme tries to cover both implementations for situations when TrueColor is not supported.

@oneKelvinSmith
Copy link
Owner

Closing because it's been a while and this issue isn't something I'm equipped to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants