Feat: initial setup for my X230 laptop

This commit is contained in:
minhtrannhat
2022-03-04 14:42:27 -05:00
parent 9e0da2b4bf
commit d38a777f75
23 changed files with 999 additions and 422 deletions

View File

@@ -0,0 +1,32 @@
## Waybar
![Red waybar](https://user-images.githubusercontent.com/39676098/153702595-1b836a1c-1d31-44c1-bc3f-cf94d4cb28ac.png)
My personal Waybar config.
Instead of directly editing the `.css` file, I recommend using Sass and
edit the [`style.scss`](./_style.scss) and `_colors.scss` files instead. This allows you for example, to
change the entire color of the bar with just one variable change.
[Install the latest version of Sass](https://github.com/sass/dart-sass/releases)
and run this in the `waybar/` directory so that the CSS file will be automatically updated as you edit the Sass files:
```sass --watch . --no-source-map```
By just editing the `$bg` value in [`_colors.scss`](./_colors.scss), you can get an entirely different color:
![Orange waybar](https://user-images.githubusercontent.com/39676098/153702593-fc17a027-25c4-4ba3-989b-f43a71fc2f74.png)
![Green waybar](https://user-images.githubusercontent.com/39676098/153702590-aa256ff6-7fa3-445e-b1f9-4dc851399659.png)
![Blue waybar](https://user-images.githubusercontent.com/39676098/153702589-854d4c15-348a-49cb-816c-dc9192f21915.png)
![Purple waybar](https://user-images.githubusercontent.com/39676098/153702586-c74292d9-0c78-4396-8038-2b7f77bab677.png)
## Fonts
If the River workspace fonts don't show up, you need to download the specific Japanese font, Han Sans JP.
The command for this on Arch/Arch-based systems should be `sudo pacman -S adobe-source-han-sans-jp-fonts` .
## Dependencies
For the GitHub download stats counter to work, you need to have Python 3 installed and also the Requests library.
Install it with `pip install requests`. You also need mpd installed AND running for the modules at the center.

View File

@@ -0,0 +1,37 @@
// Gruvbox Material theme
$red: #ea6962;
$orange: #e78a4e;
$yellow: #d8a657;
$green: #a9b665;
$cyan: #89b482;
$blue: #7daea3;
$magenta: #d3869b;
$bg: #464646;
$fg: $orange;
$fg-opposite: scale-color($fg, $lightness: -25%, $saturation: -15%);
// Box shadow of modules automatically calculated from the background color
$shadow: scale-color($bg, $lightness: -34%, $saturation: -28%);
$fg-alt: $shadow;
@if lightness($bg) < 50% {
$fg-alt: scale-color($bg, $lightness: 27%);
}
// Accent color used by the River active tags
$accent-color: $fg;
// Foreground + accent color for modules w/o backgrounds
$fg-no-bg: $fg;
$accent-color-no-bg: $shadow;
// Set this to true or false depending if the mpd module is readable
$dark-theme: true;
@if $dark-theme {
$fg-no-bg: $fg-opposite;
$accent-color-no-bg: $bg;
}

View File

@@ -1,39 +1,38 @@
// -*- mode: json -*-
[
// Angelo's Waybar config
// https://github.com/angelofallars/dotfiles
{
"layer": "bottom",
"position": "top",
"modules-left": [
"custom/menu",
"custom/separator",
"sway/workspaces",
"custom/separator"
],
"modules-center": [
"custom/separator",
"clock",
"custom/separator",
"battery",
"custom/separator"
],
"modules-right": [
"tray",
"custom/separator",
"temperature",
"custom/separator",
"cpu",
"custom/separator",
"memory",
"custom/separator",
"sway/mode",
//"custom/separator",
//"backlight",
"custom/separator",
"network",
"custom/separator",
"pulseaudio",
"custom/separator"
],
"layer": "bottom",
"height": 33,
"spacing": 0,
"margin-top": 4,
// If you're using sway, replace `river/tags` with `sway/workspaces` .
"modules-left": ["sway/workspaces"],
"modules-right": ["tray","cpu", "memory", "battery", "clock#date", "clock", "pulseaudio"],
"sway/workspaces": {
"disable-scroll": true,
"disable-markup" : false,
"all-outputs": true,
"format": " {icon} ",
//"format":"{icon}",
"format-icons": {
"1": "一",
"2": "二",
"3": "三",
"4": "四",
"5": "五",
"6": "六",
"7": "七",
"8": "八",
"9": "九",
"10": "十",
"focused": "",
"default": ""
}
},
"cpu": {
"interval": 5,
"tooltip": false,
@@ -52,117 +51,13 @@
},
},
"custom/menu": {
"tooltip-format": "Applications",
"tooltip": true,
"format": "",
"on-click": "wofi -p Run -L 10 -w 2 --show drun"
},
"wlr/taskbar": {
"format": "{icon}",
"icon-size": 16,
"icon-theme": "Numix-Circle",
"tooltip-format": "{title}",
"on-click": "activate",
"on-click-middle": "close"
},
"bluetooth": {
"format": "{icon}",
"interval": 30,
"format-icons": {
"enabled": " [X]",
"disabled": " [ ]"
},
"tooltip-format": "{}",
"on-click": "blueberry"
},
"temperature": {
"critical-threshold": 90,
"interval": 5,
//"format": "{icon} {temperatureC}°C",
"format": "{icon} {temperatureC}°",
"format-icons": [
"", // Icon: temperature-empty
"", // Icon: temperature-quarter
"", // Icon: temperature-half
"", // Icon: temperature-three-quarters
"" // Icon: temperature-full
],
"tooltip": false
},
"network": {
"interval": 5,
"format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi
"format-ethernet": " {ifname}",
"format-disconnected": "Disconnected",
"tooltip": false
},
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}",
"persistent_workspaces": {
"1": [],
"2": [],
"3": [],
"4": [],
"5": [],
"6": [],
"7": [],
"8": [],
"9": []
},
"format-icons": {
"urgent": "",
"focused": "",
"default": ""
}
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"sway/mode": {
"format": "{}"
},
"backlight": {
"format": "{icon} {percent}%",
"format-icons": ["", ""],
"on-scroll-up": "brightnessctl set +5%",
"on-scroll-down": "brightnessctl set 5%-"
},
"clock": {
"format": "{:%a %d %b %H:%M}",
"tooltip": false
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": [
"",
"",
""
]
},
"on-click": "pavucontrol"
},
"battery": {
"battery": {
"states": {
"good": 100,
"warning": 30,
"critical": 15
},
"format": "{icon} {capacity}%",
"format": "{icon} {capacity}%",
"format-icons": [
"",
"",
@@ -171,21 +66,34 @@
""
]
},
"custom/separator": {
"format": "",
"tooltip": false
"tray": {
// "icon-size": 21,
// "spacing": 10
},
"clock": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format": "{:%I:%M %p}",
},
"clock#date": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format": "{:%B %d, %A}",
},
"pulseaudio": {
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-icons": {
"headphone": "",
"default": [
"",
"",
""
]
},
"on-click": "pavucontrol"
},
"custom/shutdown": {
"tooltip-format": "Power menu",
"format": "",
"on-click": "wlogout -p layer-shell -r 50",
},
"memory": {
"interval": 5,
"format": "memory {}%", // Icon: memory
"states": {
"warning": 70,
"critical": 90
}
}}
]
}

2
waybar/.config/waybar/sass.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
sass --watch . --no-source-map

View File

@@ -1,147 +1,134 @@
/* Polar Night */
@define-color nord0 #2e3440;
@define-color nord1 #3b4252;
@define-color nord2 #434c5e;
@define-color nord3 #4c566a;
/* Snow Storm */
@define-color nord4 #d8dee9;
@define-color nord5 #e5e9f0;
@define-color nord6 #eceff4;
/* Frost */
@define-color nord7 #8fbcbb;
@define-color nord8 #88c0d0;
@define-color nord9 #81a1c1;
@define-color nord10 #5e81ac;
/* Aurora */
@define-color nord11 #bf616a;
@define-color nord12 #d08770;
@define-color nord13 #ebcb8b;
@define-color nord14 #a3be8c;
@define-color nord15 #b48ead;
/* Simple color names */
@define-color bgkdark @nord0;
@define-color bgkgrey @nord2;
@define-color text @nord4;
@define-color lightblue @nord7;
@define-color darkblue @nord10;
@define-color red @nord11;
@define-color orange @nord12;
@define-color yellow @nord13;
@define-color green @nord14;
@define-color purple @nord15;
#backlight, #battery, #cpu, #disk, #idle_inhibitor, #keyboard-state,
#pulseaudio, #clock, #tags, #language, #memory, #network, #sndio,
#mode, #window, #workspaces, #temperature, #taskbar, #workspaces,
#custom-treefetch-downloads, #custom-update-count {
box-shadow: 4px 4px 0 #2e2e2e;
margin-bottom: 4px;
margin-right: 4px;
margin-left: 3px;
margin-right: 7px;
padding-left: 10px;
padding-right: 10px;
background: #464646;
border-radius: 0px;
}
* {
font-size: 16;
font-family: "Fira Code Nerd Font Mono", "Font Awesome 5 Free";
}
:hover {
border: 1px solid @purple;
background: @bgkgrey;
}
window#waybar {
color: @lightblue;
background: @bgkdark;
border: 1px solid @darkblue;
}
/* Base styling for modules */
#workspaces,
#mode,
#window,
#idle_inhibitor,
#bluetooth,
#pulseaudio,
#clock,
#battery,
#backlight,
#network,
#custom-separator,
#custom-shutdown,
#cpu,
#memory,
#temperature,
#custom-menu,
#taskbar,
#tray {
padding: 2px 7px 2px 7px;
margin: 5px 0px 5px 0px;
background: @bgkgrey;
border-radius: 5px;
}
#custom-shutdown {
color: @bgkgrey;
background: @red;
}
#custom-menu {
color: @bgkgrey;
background: @purple;
}
#custom-separator {
opacity: 0;
padding: 0px;
}
#custom-menu {
margin-left: 5px;
}
#workspaces {
padding: 0px;
min-height: 0;
}
#workspaces button {
color: @purple;
margin: 0;
padding: 1px 3px 0px 3px;
}
#workspaces button.persistent {
color: @lightblue;
color: #d8a657;
margin: 0;
padding: 1px 1px 0px 1px;
}
#workspaces button.focused {
border: 1px solid @green;
border: 1px solid #e78a4e;
}
#mode {
color: @red;
window#waybar {
background: transparent;
color: #e78a4e;
}
#custom-shutdown {
margin-right: 5px;
.modules-left, .modules-center, .modules-right {
background: transparent;
margin-top: 0px;
border-radius: 0px;
font-family: "JetBrains Mono Nerd Font", monospace;
font-size: 15px;
font-weight: 500;
}
#battery.warning {
color: @yellow;
.modules-left {
margin-left: 6px;
}
#battery.critical {
color: @orange;
.modules-right {
margin-right: 6px;
}
#taskbar,
#tray,
#window {
padding: 0;
}
#taskbar button {
color: @lightblue;
padding: 5px 3px 1px 3px;
}
#taskbar button.active {
border: 1px solid @green;
}
#taskbar {
border: 1px solid transparent;
#mpd, #custom-mpd-song-scroll {
font-size: 12px;
font-weight: 700;
margin: 0;
padding: 0;
}
#tray,
#window {
padding: 5px 0px 5px 0px;
#mpd {
color: #464646;
margin-left: 5px;
}
#custom-mpd-song-scroll {
color: #bf6429;
margin-right: 50px;
}
#tags button {
color: #787878;
font-family: "Source Han Sans JP Heavy";
font-weight: 700;
padding: 0 3px;
margin: 0 2px;
min-width: 15px;
font-size: 17px;
border-radius: 0;
border: none;
transition: none;
}
#tags button.occupied {
color: inherit;
}
#tags button:hover {
color: #464646;
background: #787878;
box-shadow: none;
text-shadow: none;
transition: 0;
}
#tags button.focused {
color: #464646;
background: #e78a4e;
}
#tags button.urgent {
color: #ea6962;
}
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
tooltip {
background: #464646;
border-radius: 7px;
font-family: "JetBrains Mono Nerd Font", monospace;
font-weight: 500;
font-size: 15px;
padding: 10px;
animation-name: fadein;
animation-duration: 0.2s;
border: 2px solid #787878;
text-shadow: none;
color: #e78a4e;
}
tooltip label {
color: #e78a4e;
}
#tray menu {
background: #464646;
color: #e78a4e;
border-radius: 5px;
border: 2px solid #787878;
}

View File

@@ -0,0 +1,189 @@
// Angelo's Waybar config
// https://github.com/angelofallars/dotfiles
// Use Sass to compile this file down to CSS and restyle my bar.
// https://sass-lang.com/installhttps://sass-lang.com/install
// After downloading Sass, run this in this directory
// to compile your changes:
// $ sass --watch . --no-source-map
// NOTE: If the Japanese River workspace icons do not show up,
// you should install the Han Sans JP font.
// Arch Linux:
// $ sudo pacman -S adobe-source-han-sans-jp-fonts
@use 'colors';
// Distance of the entire bar from the sides
$screen-margin: 6px;
// Distance from the top of the screen
$top-margin: 0px;
// Margin/padding of individual modules
$module-margin: 3px;
$module-padding: 10px;
// Font config
$font: "JetBrains Mono Nerd Font";
$font-size: 15px;
$font-weight: 500;
// How far away should the box shadow effect be diagonally
$box-shadow-distance: 4px;
// Border radius. Turning this option up will also round the offset shadows.
$bar-border-radius: 0px;
// -------------------------
// Actual styling of the bar
// -------------------------
@mixin square-shadow {
box-shadow: $box-shadow-distance $box-shadow-distance 0 colors.$shadow;
margin-bottom: $box-shadow-distance;
margin-right: $box-shadow-distance;
}
@mixin single-module {
@include square-shadow;
margin-left: $module-margin;
margin-right: $module-margin + $box-shadow-distance;
padding-left: $module-padding;
padding-right: $module-padding;
background: colors.$bg;
border-radius: $bar-border-radius;
}
// !! If you add new custom modules, put their class name in here.
#backlight, #battery, #cpu, #disk, #idle_inhibitor, #keyboard-state,
#pulseaudio, #clock, #tags, #language, #memory, #network, #sndio,
#mode, #window, #workspaces, #temperature, #taskbar, #workspaces,
#custom-treefetch-downloads, #custom-update-count
{
@include single-module;
}
* {
min-height: 0;
}
#workspaces button {
color: colors.$yellow;
margin: 0;
padding: 1px 1px 0px 1px;
}
#workspaces button.focused {
border: 1px solid colors.$fg;
}
window#waybar {
background: transparent;
color: colors.$fg;
}
.modules-left, .modules-center, .modules-right {
background: transparent;
margin-top: $top-margin;
border-radius: $bar-border-radius;
font-family: $font, monospace;
font-size: $font-size;
font-weight: $font-weight;
}
.modules-left {
margin-left: $screen-margin;
}
.modules-right {
margin-right: $screen-margin;
}
#mpd, #custom-mpd-song-scroll {
font-size: 12.0px;
font-weight: 700;
margin: 0;
padding: 0;
}
#mpd {
color: colors.$accent-color-no-bg;
margin-left: $module-margin + 2px;
}
#custom-mpd-song-scroll {
color: colors.$fg-no-bg;
margin-right: 50px;
}
// River tags
#tags button {
color: colors.$fg-alt;
font-family: "Source Han Sans JP Heavy";
font-weight: 700;
padding: 0 3px;
margin: 0 2px;
min-width: 15px;
font-size: 17px;
border-radius: 0;
border: none;
transition: none;
}
#tags button.occupied {
color: inherit;
}
#tags button:hover {
color: colors.$bg;
background: colors.$fg-alt;
box-shadow: none;
text-shadow: none;
transition: 0;
}
#tags button.focused {
color: colors.$bg;
background: colors.$accent-color;
}
#tags button.urgent {
color: colors.$red;
}
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
tooltip {
background: colors.$bg;
border-radius: 7px;
font-family: $font, monospace;
font-weight: $font-weight;
font-size: $font-size;
padding: 10px;
animation-name: fadein;
animation-duration: 0.2s;
border: 2px solid colors.$fg-alt;
text-shadow: none;
color: colors.$fg;
}
tooltip label {
color: colors.$fg;
}
#tray menu {
background: colors.$bg;
color: colors.$fg;
border-radius: 5px;
border: 2px solid colors.$fg-alt;
}