From 91ff5c8add2a696a7a6ec6021a800b7f404363d7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 7 Oct 2020 06:24:55 +0800 Subject: [PATCH] Update the "Fair and square" theme --- modules/themes/fair-and-square/README.adoc | 7 ++- .../fair-and-square/config/bspwm/bspwmrc | 11 ++-- .../fair-and-square/config/polybar/config | 4 +- .../config/rofi/themes/fds-mini-sidebar.rasi | 2 +- modules/themes/fair-and-square/default.nix | 52 ++++++++++-------- .../README.adoc | 7 ++- .../config/alacritty/alacritty.yml | 0 .../config/bspwm/bspwmrc | 10 ++-- .../config/dunst/dunstrc | 0 .../config/polybar/config | 22 +------- .../config/rofi/config.rasi | 0 .../config/rofi/themes/dmenu.rasi | 0 .../config/rofi/themes/fds-center-menu.rasi | 2 +- .../config/rofi/themes/fds-mini-sidebar.rasi | 0 .../config/wallpaper | Bin .../default.nix | 18 ++++-- 16 files changed, 71 insertions(+), 64 deletions(-) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/README.adoc (59%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/alacritty/alacritty.yml (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/bspwm/bspwmrc (70%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/dunst/dunstrc (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/polybar/config (89%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/rofi/config.rasi (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/rofi/themes/dmenu.rasi (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/rofi/themes/fds-center-menu.rasi (99%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/rofi/themes/fds-mini-sidebar.rasi (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/config/wallpaper (100%) rename templates/themes/fair-and-square/{{{ cookiecutter.project_slug }} => {{ cookiecutter.name | slugify }}}/default.nix (88%) diff --git a/modules/themes/fair-and-square/README.adoc b/modules/themes/fair-and-square/README.adoc index 81939614..1d732afe 100755 --- a/modules/themes/fair-and-square/README.adoc +++ b/modules/themes/fair-and-square/README.adoc @@ -4,16 +4,17 @@ A theme featuring fairly simple graphics with not much bells and whistles. Thus, it focuses on snapiness and efficient use of keyboard shortcuts. Intended to be used for potatoes (READ: cheap low-end computers) like mine. -This theme is mainly composed of the following components: +This theme is mainly composed of the following components that are already configured: - bspwm as the window manager - polybar for the bars - rofi for the application laucher and the generic interface - dunst (and libnotify) for desktop notifications +- feh (for setting the background) with the wallpaper to be used at `./config/wallpaper`. - Arc is the chosen GTK theme -Other miscellaneous stuff: +Here are the miscellaneous programs that are being used. +The theme provides no configuration so you have to make sure the configuration is in the already placed. - sxhkd (since you're using bspwm, anyways) -- feh (for setting the background) diff --git a/modules/themes/fair-and-square/config/bspwm/bspwmrc b/modules/themes/fair-and-square/config/bspwm/bspwmrc index 29a47a5c..34da6bff 100755 --- a/modules/themes/fair-and-square/config/bspwm/bspwmrc +++ b/modules/themes/fair-and-square/config/bspwm/bspwmrc @@ -1,14 +1,15 @@ #!/bin/sh -# Starting all of the required programs. +# Open all of the programs needed. pkill polybar || polybar "fds-bar" & -pkill feh || feh $HOME/.background-image +pkill feh || feh --bg-fill $HOME/.background-image +pkill dunst || dunst & -# Removing all rules at startup to prevent duplicating rules. +# Removing all rules at startup to prevent duplicating rules. bspc rule -r "*" # Set up the desktops (workspaces) for the monitor -bspc monitor -d I II III IV V +bspc monitor -d I II III IV V bspc config border_width 2 bspc config window_gap 9 @@ -25,5 +26,5 @@ xsetroot -cursor_name left_ptr # Rules bspc rule -a code-oss desktop=^2 bspc rule -a firefox desktop=^1 -bspc rule -a Emacs state=tiled +bspc rule -a emacs state=tiled diff --git a/modules/themes/fair-and-square/config/polybar/config b/modules/themes/fair-and-square/config/polybar/config index 40200dc3..d0339a2a 100755 --- a/modules/themes/fair-and-square/config/polybar/config +++ b/modules/themes/fair-and-square/config/polybar/config @@ -139,9 +139,9 @@ ; We've formatted the time string to alter between the time and the date instead. ; Although, I feel it's a hacky workaround, it still is functional as a date module. date = "%A, %F" - date-alt = "%B %d, %Y" + date-alt = "%B %d, %Y (%F)" time = %T - time-alt = %F + time-alt = format-prefix = "" label = %date% %time% diff --git a/modules/themes/fair-and-square/config/rofi/themes/fds-mini-sidebar.rasi b/modules/themes/fair-and-square/config/rofi/themes/fds-mini-sidebar.rasi index 4aeeabac..18e62f21 100755 --- a/modules/themes/fair-and-square/config/rofi/themes/fds-mini-sidebar.rasi +++ b/modules/themes/fair-and-square/config/rofi/themes/fds-mini-sidebar.rasi @@ -36,7 +36,7 @@ window { background-color: transparent; height: 65%; - width: 45%; + width: 35%; position: center; location: center; text-color: @foreground; diff --git a/modules/themes/fair-and-square/default.nix b/modules/themes/fair-and-square/default.nix index 13b21460..d6c6b79c 100755 --- a/modules/themes/fair-and-square/default.nix +++ b/modules/themes/fair-and-square/default.nix @@ -11,23 +11,26 @@ with lib; config = mkIf config.modules.themes."fair-and-square".enable { # Pass the metadata of the theme. - modules.themes = { + modules.theme = { name = "Fair and square"; version = "0.1.0"; path = ./.; }; - # Enable picom compositor. services = { + # Enable picom compositor. picom = { enable = true; fade = false; shadow = false; }; + # Enable certain Xorg-related services. xserver = { displayManager = { lightdm.enable = true; + lightdm.greeters.mini.enable = true; + lightdm.greeters.mini.user = config.my.username; defaultSession = "none+bspwm"; }; enable = true; @@ -36,16 +39,16 @@ with lib; }; }; - # Enable QT configuration to style with the GTK theme. - qt5 = { - style = "gtk2"; - platformTheme = "gtk2"; - }; - - my.env.TERMINAL = "alacritty"; my.home = { + # Enable GTK configuration. + gtk.enable = true; + + # Enable QT configuration and set it to the same GTK config. + qt.enable = true; + qt.platformTheme = "gtk"; + # Install all of the configurations in the XDG config home. xdg.configFile = mkMerge [ (let recursiveXdgConfig = name: { @@ -64,7 +67,8 @@ with lib; }; }) - { + # Applying the theme for GTK. + ({ "gtk-3.0/settings.ini".text = '' [Settings] gtk-theme-name=Arc @@ -75,20 +79,24 @@ with lib; gtk-xft-hinting=1 gtk-xft-hintstyle=hintfull gtk-xft-rgba=none - gtk-font-name=Sans 10 ''; - } - ]; - # Except for the GTK2 config which still needs to be in `$HOME/.gtkrc-2.0`. - home.file = { - ".gtkrc-2.0".text = '' - gtk-theme-name="Arc" - gtk-icon-theme-name="Arc" - gtk-font-name="Sans 10" - gtk-cursor-theme-name="Adwaita" - ''; - }; + "gtk-2.0/gtkrc".text = '' + gtk-theme-name="Arc" + gtk-icon-theme-name="Arc" + gtk-font-name="Sans 10" + gtk-cursor-theme-name="Adwaita" + ''; + }) + ]; + }; + + # Set the cursor theme. + xdg.dataFile = { + "icons/default/index.theme".text = '' + [icon theme] + Inherits=Adwaita + ''; }; my.packages = with pkgs; [ diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/README.adoc b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/README.adoc similarity index 59% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/README.adoc rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/README.adoc index 7b612ebb..9a8dc2df 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/README.adoc +++ b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/README.adoc @@ -4,16 +4,17 @@ A theme featuring fairly simple graphics with not much bells and whistles. Thus, it focuses on snapiness and efficient use of keyboard shortcuts. Intended to be used for potatoes (READ: cheap low-end computers) like mine. -This theme is mainly composed of the following components: +This theme is mainly composed of the following components that are already configured: - bspwm as the window manager - polybar for the bars - rofi for the application laucher and the generic interface - dunst (and libnotify) for desktop notifications +- feh (for setting the background) with the wallpaper to be used at `./config/wallpaper`. - Arc is the chosen GTK theme -Other miscellaneous stuff: +Here are the miscellaneous programs that are being used. +The theme provides no configuration so you have to make sure the configuration is in the already placed. - sxhkd (since you're using bspwm, anyways) -- feh (for setting the background) diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/alacritty/alacritty.yml b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/alacritty/alacritty.yml similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/alacritty/alacritty.yml rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/alacritty/alacritty.yml diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/bspwm/bspwmrc b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/bspwm/bspwmrc similarity index 70% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/bspwm/bspwmrc rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/bspwm/bspwmrc index 264e2e2f..3c7322eb 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/bspwm/bspwmrc +++ b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/bspwm/bspwmrc @@ -1,14 +1,15 @@ #!/bin/sh # Open all of the programs needed. -pkill polybar || polybar "fds-bar" & -pkill feh || feh --bg-fill $HOME/.background-image +pkill polybar; polybar "fds-bar" & +pkill feh; feh --bg-fill $HOME/.background-image +pkill dunst; dunst & -# Removing all rules at startup to prevent duplicating rules. +# Removing all rules at startup to prevent duplicating rules. bspc rule -r "*" # Set up the desktops (workspaces) for the monitor -bspc monitor -d I II III IV V +bspc monitor -d I II III IV V bspc config border_width 2 bspc config window_gap 9 @@ -25,4 +26,5 @@ xsetroot -cursor_name left_ptr # Rules bspc rule -a code-oss desktop=^2 bspc rule -a firefox desktop=^1 +bspc rule -a emacs state=tiled diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/dunst/dunstrc b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/dunst/dunstrc similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/dunst/dunstrc rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/dunst/dunstrc diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/polybar/config b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/polybar/config similarity index 89% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/polybar/config rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/polybar/config index a5c33524..ad135594 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/polybar/config +++ b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/polybar/config @@ -59,23 +59,7 @@ modules-left = bspwm modules-center = date - modules-right = pulseaudio eth memory home-fs root-fs - - -[module/home-fs] - type = internal/fs - mount-0 = /home - format-margin = 0 - format-padding = 0 - label-margin = 0 - label-padding = 0 - - format-mounted-prefix = "" - format-mounted-prefix-margin-right = 1 - format-unmounted-prefix = "" - format-unmounted-prefix-margin-right = 1 - label-mounted = %free% - label-unmounted = N/A + modules-right = pulseaudio eth memory root-fs [module/root-fs] @@ -155,9 +139,9 @@ ; We've formatted the time string to alter between the time and the date instead. ; Although, I feel it's a hacky workaround, it still is functional as a date module. date = "%A, %F" - date-alt = "%B %d, %Y" + date-alt = "%B %d, %Y (%F)" time = %T - time-alt = %F + time-alt = format-prefix = "" label = %date% %time% diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/config.rasi b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/config.rasi similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/config.rasi rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/config.rasi diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/dmenu.rasi b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/dmenu.rasi similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/dmenu.rasi rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/dmenu.rasi diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/fds-center-menu.rasi b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/fds-center-menu.rasi similarity index 99% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/fds-center-menu.rasi rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/fds-center-menu.rasi index 945cd3e1..a8e70f0b 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/fds-center-menu.rasi +++ b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/fds-center-menu.rasi @@ -35,7 +35,7 @@ window { background-color: transparent; height: 65%; - width: 45%; + width: 55%; position: center; location: center; text-color: @foreground; diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/fds-mini-sidebar.rasi b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/fds-mini-sidebar.rasi similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/rofi/themes/fds-mini-sidebar.rasi rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/rofi/themes/fds-mini-sidebar.rasi diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/wallpaper b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/wallpaper similarity index 100% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/config/wallpaper rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/config/wallpaper diff --git a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/default.nix b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/default.nix similarity index 88% rename from templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/default.nix rename to templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/default.nix index 29bf7e76..e14f4830 100755 --- a/templates/themes/fair-and-square/{{ cookiecutter.project_slug }}/default.nix +++ b/templates/themes/fair-and-square/{{ cookiecutter.name | slugify }}/default.nix @@ -17,14 +17,15 @@ with lib; path = ./.; }; - # Enable picom compositor. services = { + # Enable picom compositor. picom = { enable = true; fade = false; shadow = false; }; + # Enable certain Xorg-related services. xserver = { displayManager = { lightdm.enable = true; @@ -44,7 +45,7 @@ with lib; # Enable GTK configuration. gtk.enable = true; - # Enable QT configuration. + # Enable QT configuration and set it to the same GTK config. qt.enable = true; qt.platformTheme = "gtk"; @@ -66,9 +67,10 @@ with lib; }; }) - (mkIf config.services.xserver.enable { + # Applying the theme for GTK. + ({ "gtk-3.0/settings.ini".text = '' - [Settings] + [Settings] gtk-theme-name=Arc gtk-icon-theme-name=Arc gtk-fallback-icon-theme=gnome @@ -89,6 +91,14 @@ with lib; ]; }; + # Set the cursor theme. + xdg.dataFile = { + "icons/default/index.theme".text = '' + [icon theme] + Inherits=Adwaita + ''; + }; + my.packages = with pkgs; [ alacritty # Muh GPU-accelerated terminal emulator. dunst # Add more annoying pop-ups on your screen!