Improve README

- Better instructions
- Moved redundant stuff to wiki
- Fewer images for faster loading of the page


Former-commit-id: 16d89f3b1255c98bb8713237b6f6e938afd4f3b6
Former-commit-id: e3361613939d41819617793c1e1acd2c51dbd3c6
Former-commit-id: fb00355c668a0dcdab533a508282d2a802a55e71
Former-commit-id: c412a1e8c298469f51485efd142eeae1790f6157
This commit is contained in:
elenapan 2020-03-07 16:29:04 +02:00
parent 3c425f6565
commit a0b70f80da
4 changed files with 237 additions and 225 deletions

BIN
.assets/gallery.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
.assets/setup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
.assets/wiki.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

462
README.md
View file

@ -1,274 +1,286 @@
# dotfiles
## Some details
<p align="center">
<img width="25%" src="https://github.com/elenapan.png" />
</p>
<p align="center">
<b>🎀 Elena's configuration files 🎀</b>
</p>
<p align="center">
<a href="#setup"><img width="150px" style="padding: 0 10px;" src=".assets/setup.png"></a>
<a href="https://github.com/elenapan/dotfiles/wiki"><img width="150px" style="padding: 0 10px;" src=".assets/wiki.png"></a>
<a href="https://github.com/elenapan/dotfiles/wiki/Gallery"><img width="150px" style="padding: 0 10px;" src=".assets/gallery.png"></a>
</p>
### Thanks for dropping by!
<img src="https://i.redd.it/glzrkk83f4621.png" alt="img" align="right" width="290px">
This is my personal collection of configuration files.
You are probably here for my AwesomeWM configuration.
The [setup section](#setup) will guide you through the installation process.
Here are some details about my setup:
+ **WM**: [AwesomeWM](https://github.com/awesomeWM/awesome/)
+ **OS**: Ubuntu 18.04
+ **WM**: AwesomeWM
+ **Terminal**: Kitty
+ **File Manager**: Nemo for GUI, Ranger for terminal
+ **Launcher**: Rofi
+ **Editor**: Vim
+ **Org editor**: [Remacs](https://github.com/remacs/remacs)
+ **Shell**: [zsh](https://wiki.archlinux.org/index.php/Zsh)
+ **Terminal**: [kitty](https://github.com/kovidgoyal/kitty/)
+ **Editor**: [Neovim](https://github.com/neovim/neovim/)
+ **Org editor**: [Doom Emacs](https://github.com/hlissner/doom-emacs/)
+ **File Manager**: [Thunar](https://git.xfce.org/xfce/thunar/)
+ **Launcher**: [rofi](https://github.com/davatorium/rofi/)
+ **Browser**: Firefox
## New features
| Anti-aliased rounded corners | App drawer | Lock screen - [See it in action here](https://streamable.com/d2t8f) |
| Anti-aliased rounded corners | App drawer | Lock screen - [See it in action](https://streamable.com/d2t8f) |
| --- | --- | --- |
| ![Screenshot](https://i.imgur.com/PXwQc87.png) | ![Screenshot](https://i.imgur.com/Z5rYUvI.png) | ![Screenshot](https://i.imgur.com/BL0USAH.png) |
## Dependencies
Here is a complete list of dependencies needed for making these themes work.
If you install all of them you will have a (mostly) smooth out of the box experience.
Of course, not all of them actually do something useful (see `fortune-mod` dependency).
Also if you are willing to edit a few configuration files, **which you will have to do** at some point, most of these dependencies can be replaced. For example you can replace `rofi` with `dmenu`,`maim` with `scrot`.
## Setup
If you notice that something is missing, please open an issue so I can add the dependency to this table.
Here are the instructions you should follow to replicate my AwesomeWM setup.
| Dependency | Description | Why/Where is it needed? |
| --- | --- | --- |
| `awesome` (git `master` branch) | Window manager | (explains itself) |
| `rofi` | Window switcher, application launcher and dmenu replacement | (explains itself) |
| `light` | Gets/Sets screen brightness | Brightness keybinds |
| `lm_sensors` | CPU temperature sensor | CPU temperature widgets |
| `upower` | Abstraction for enumerating power devices, listening to device events and more | Battery widgets |
| `acpid` | Daemon for delivering ACPI events | Charger notifications |
| `pulseaudio`, `libpulse` | Sound system **(Installed by default on most distros)** | Volume widgets and keybinds |
| `jq` | Parses `json` output | Weather widgets |
| `fortune-mod` | Displays random quotations (fortune cookies) | Fortune widget |
| `redshift` | Controls screen temperature | Night mode command |
| `mpd` | Server-side application for playing music | Music widgets |
| `mpc` | Minimalist command line interface to MPD | Music widgets |
| `maim` | Takes screenshots (improved `scrot`) | Screenshot keybinds |
| `feh` | Image viewer and wallpaper setter | Screenshot previews, wallpapers |
| [openweathermap](https://openweathermap.org/) key | Provides weather data | Weather widgets |
1. Install the [git version of AwesomeWM](https://github.com/awesomeWM/awesome/).
### Fonts
##### Icon fonts
+ **Typicons**
+ **Material Icons**
+ **Icomoon** - [download](https://www.dropbox.com/s/hrkub2yo9iapljz/icomoon.zip?dl=0)
+ **Nerd Fonts**
##### Monospace
+ **Iosevka** - [download my custom build](https://www.dropbox.com/s/nqyurzy8wcupkkz/myosevka.zip?dl=0)
+ **Anka/Coder**
##### Fancy
+ **Scriptina**
##### Sans
+ **Google Sans**
+ **Roboto Condensed**
+ **San Francisco Display**
Build instructions [here](https://github.com/awesomeWM/awesome/#building-and-installation).
## Things to do after you set up dependencies
+ Backup your current `~/.config/awesome` directory if you have one and copy this repo's `config/awesome` directory in its place.
**Arch users** can use the [awesome-git AUR package](https://aur.archlinux.org/packages/awesome-git/).
```shell
yay -S awesome-git
```
+ Configure user preferences
2. Install needed software
In `rc.lua` there is a *User variables and preferences* section where user preferences and default applications are defined. There include the terminal, editor, file manager, screenshot directory, weather widget configuration and more.
You should change those to your liking.
*If you are curious, [click here](https://github.com/elenapan/dotfiles/wiki/Detailed-dependency-table) to see a table of dependencies and why they are needed.*
+ Configure autostart applications in `autostart.sh`
- **Ubuntu** 18.04 or newer (and all Ubuntu-based distributions)
The commands in `autostart.sh` will run every time AwesomeWM restarts. If you would like to run something only once on login, I suggest you create the file `~/.xprofile`, make it executable and put the commands you want there.
```shell
sudo apt install rofi lm-sensors upower acpid jq fortune-mod redshift mpd mpc maim feh pulseaudio inotify-tools
+ *(Optional)* Load any `Xresources` colorscheme (`xrdb -merge <colorscheme file>`). In the [.xfiles](.xfiles) directory I provide you with a few of my own colorschemes, but you can also use your favorite one. All of my AwesomeWM themes take their colors from `xrdb`.
# install light, which is not in the official ubuntu repositories
wget https://github.com/haikarainen/light/releases/download/v1.2/light_1.2_amd64.deb
sudo dpkg -i light_1.2_amd64.deb
```
+ Have a general idea of what my keybinds do
- **Arch Linux** (and all Arch-based distributions)
My keybinds will most probably not suit you, but on your first login you might need to know how to navigate the desktop.
*Assuming your AUR helper is* `yay`
See the [Basic keybinds](#basic-keybinds) section for more details.
```shell
yay -S rofi lm_sensors upower acpid jq fortune-mod redshift mpd mpc maim feh light-git pulseaudio inotify-tools
```
3. Install needed fonts
You will need to install a few fonts (mainly icon fonts) in order for text and icons to be rendered properly.
**You are now ready to login with AwesomeWM!**
Necessary fonts:
+ **Typicons** - [github](https://github.com/fontello/typicons.font)
+ **Material Design Icons** - [dropbox](https://www.dropbox.com/s/4fevs095ho7xtf9/material-design-icons.ttf?dl=0)
+ **Icomoon** - [dropbox](https://www.dropbox.com/s/hrkub2yo9iapljz/icomoon.zip?dl=0)
+ **Nerd Fonts** - [website](https://www.nerdfonts.com/font-downloads)
(You only need to pick and download one Nerd Font. They all include the same icons)
+ **Scriptina** - [website](https://www.dafont.com/scriptina.font) - Handwritten font used in the lock screen
## Some recommended applications
+ **Terminals**: Termite / Kitty / urxvt / st
+ **File managers**: Nemo / Thunar
+ **Launchers**: Rofi / dmenu
+ **Browsers**: Firefox (with Vimium extension) / Qutebrowser
+ **Editors**: Vim / Sublime Text (with NeoVintageous plugin) / Spacemacs
+ **Music players**: mpd (with ncmpcpp)
Optional fonts:
+ **My custom Iosevka build** - [dropbox](https://www.dropbox.com/s/nqyurzy8wcupkkz/myosevka.zip?dl=0) - 💙 *my favorite monospace font*
+ **Anka/Coder**
+ **Google Sans** - 💙 *my favorite sans font*
+ **Roboto Condensed**
+ **San Francisco Display**
Once you download them and unpack them, place them into `~/.fonts` or `~/.local/share/fonts`.
- You will need to create the directory if it does not exist.
- It does not matter that the actual font files (`.ttf`) are deep inside multiple directories. They will be detected as long as they can be accessed from `~/.fonts` or `~/.local/share/fonts`.
Finally, run the following in order for your system to detect the newly installed fonts.
```shell
fc-cache -v
```
4. Install my AwesomeWM configuration files
```shell
git clone https://github.com/elenapan/dotfiles
cd dotfiles
[ -e ~/.config/awesome ] && mv ~/.config/awesome ~/.config/awesome-backup-"$(date +%Y.%m.%d-%H.%M.%S)" # Backup current configuration
cp -r config/awesome ~/.config/awesome
```
Optionally, you can take a look at [how my configuration is structured](#awesomewm-configuration-file-structure).
4. Configure stuff
The relevant files are inside your `~/.config/awesome` directory.
+ User preferences
In `rc.lua` there is a *User variables and preferences* section where user preferences and default applications are defined.
You should change those to your liking. Probably the most important change you can make is to set your `terminal`.
Note: For the weather widgets to work, you will also need to create an account on [openweathermap](https://openweathermap.org), get your key, look for your city ID, and set `openweathermap_key` and `openweathermap_city_id` accordingly.
+ Have a general idea of what my keybinds do
My keybinds will most probably not suit you completely, but on your first login you might need to know how to navigate the desktop.
See the [keybinds](#keybinds) section for more details.
You can edit `keys.lua` to configure your keybinds.
5. Login with AwesomeWM 🎉
Congratulations, at this point you should be ready to log out of your current desktop and into AwesomeWM.
Your login screen should have a button that lets you change between available desktop sessions.
6. *(Optional)* Eye-candy
+ Set the wallpaper
```sh
feh --bg-fill /path/to/your/wallpaper
```
+ Load a colorscheme
```sh
xrdb -merge /path/to/colorscheme
```
Notes:
- To see the new colors you should restart AwesomeWM with <kbd>super+shift+r</kbd> or by right-clicking the desktop and clicking the gear icon (bottom-right).
- In the [.xfiles](.xfiles) directory of the repository I provide you with a few of my own colorschemes, but you can also use your favorite one.
- All of my AwesomeWM themes take their colors from `xrdb`. This also means that they play nice with tools like [pywal](https://github.com/dylanaraps/pywal).
### Eye-candy suggestions
- [bin/bunnyfetch](./bin/bunnyfetch) script - Display some system info
- `neofetch` - Display a ton of system info
- [even-better-ls](https://github.com/illinoisjackson/even-better-ls) - Icons for the `ls` command
- `cava` - Audio visualizer
## AwesomeWM configuration: File structure
I have split my `rc.lua` into multiple files for organization purposes.
+ The `noodle` directory contains widgets that usually take up more than 50 lines of code.
After setting up my AwesomeWM configuration, inside `~/.config/awesome` you will find the following:
I prefer not filling my files with a ton of widget configurations, but also not making a seperate file for every widget.
+ 🔧 `rc.lua`
+ The `evil` directory contains daemons (processes that run in the background) which emit system info.
The main configuration file which binds everything together.
This file allows you to set user preferences, choose themes, configure default layouts for each tag, window rules and more.
It is also responsible for initializing all necessary desktop components.
+ 🚀 `autostart.sh`
The commands in in this file will run every time AwesomeWM restarts.
If you would like to run something only **once on login**, I suggest you create the file `~/.xprofile`, make it executable and put the commands you want in it.
+ ⌨️ `keys.lua`
It initializes global and client keybinds.
In addition, it defines what mouse clicks do on windows, window titlebars or the desktop.
+ 🎮 `apps.lua`
Provides functions for *activating* various applications, meaning either spawning them, focusing them or toggling them depending on whether they are currently running or not.
+ 📚 `helpers.lua`
Provides various uncategorized helper functions to make our life easier and our code cleaner.
+ 🎨 `themes` directory
Here you can find a directory for each available theme.
Such a directory should include at least a `theme.lua` and optionally icons, wallpaper, and whatever asset you need that is theme-specific.
The `theme.lua` file usually sets colors, sizes and positions of various elements.
+ 🖼 `icons` directory
Here you can find a directory for each available icon theme and an `init.lua` file which initializes the `icons` variables.
For example, `icons.firefox` can be used to refer to your selected theme's Firefox icon instead of using the full path to the image. This makes it easy to switch between themes.
Note: Icon themes defined here have nothing to do with your system-wide icon theme.
+ 🎀 `decorations` directory
In this directoy you can find window decoration (titlebar) styles.
They affect the layout of the titlebar and the titlebar buttons (e.g. close, maximize, minimize).
<!-- TODO custom per-window decorations -->
+ 💎 `elemental` directory
Contains desktop components or *elements* such as bars, sidebars, lock screens and more.
Elements with multiple available themes have their own directory. For example:
+ In `elemental/bar` you can find a `.lua` file for each available bar or bar group.
Multiple bars can be created in one file.
Every bar theme provides the global functions `wibars_toggle()` and `tray_toggle()` which you can bind to any keys you want.
+ In `elemental/sidebar` you can find a `.lua` file for each available sidebar theme.
+ ... And so on.
+ 💬 `notifications` directory
This directory includes notification daemons that trigger notifications for various desktop events such as volume or brightness change.
Also it includes notification themes that define the layout of the notification.
+ 🍜 `noodle` directory: Contains widgets that usually take up more than 50 lines of code.
Widgets display information in visual form (text, images, progress bars).
Without them, all desktop elements would just be empty boxes.
They are used by the desktop components defined inside the `elemental` directory.
Widgets can be defined in any file but I prefer to separate a big widget (with a lot of logic) from the element I am using it in.
+ 😈 `evil` directory
Contains daemons (processes that run in the background) which emit system info.
They provide an easy way of writing widgets that rely on external information. All you need to do is subscribe to the signal a daemon provides.
No need to remember which shell command gives you the necessary info or bother about killing orphan processes. Evil takes care of everything.
+ In `themes` you can find a directory for each available theme.
## Keybinds
Such a directory should include at least a `theme.lua` and optionally icons, wallpaper, and whatever asset you need that is theme-specific.
+ In `bars` you can find a `.lua` file for each available bar or bar group.
Multiple bars can be created in one file.
Every bar theme provides the global functions `toggle_wibars()` and `toggle_tray()` which you can bind to any keys you want.
## Basic keybinds
I use `super` AKA Windows key as my main modifier.
I use <kbd>super</kbd> AKA Windows key as my main modifier.
#### Keyboard
+ `super + enter` - Spawn terminal
+ `super + shift + enter` - Spawn floating terminal
+ `super + d` - Launch rofi
+ `super + shift + q` - Close client
+ `super + control + space` - Toggle floating client
+ `super + [1-0]` - View tag AKA change workspace (for you i3 folks)
+ `super + shift + [1-0]` - Move focused client to tag
+ `super + s` - Tiling layout
+ `super + shift + s` - Floating layout
+ `super + w` - Maximized / Monocle layout
+ `super + [arrow keys] / [hjkl]` - Change focus by direction
+ `super + shift + [arrow keys] / [hjkl]` - Move client by direction. Move to edge if it is floating.
+ `super + control + [arrow keys] / [hjkl]` - Resize
+ `super + f` - Toggle fullscreen
+ `super + m` - Toggle maximize
+ `super + n` - Minimize
+ `super + shift + n` - Restore minimized
+ `super + c` - Center floating client
+ `super + u` - Jump to urgent client (or back to last tag if there is no such client)
+ `super + shift + b` - Toggle bar
+ `super + =` - Toggle tray
+ ... And many many more.
+ <kbd>super + enter</kbd> - Spawn terminal
+ <kbd>super + shift + enter</kbd> - Spawn floating terminal
+ <kbd>super + d</kbd> - Launch rofi
+ <kbd>super + shift + q</kbd> - Close client
+ <kbd>super + control + space</kbd> - Toggle floating client
+ <kbd>super + [1-0]</kbd> - View tag AKA change workspace (for you i3 folks)
+ <kbd>super + shift + [1-0]</kbd> - Move focused client to tag
+ <kbd>super + s</kbd> - Tiling layout
+ <kbd>super + shift + s</kbd> - Floating layout
+ <kbd>super + w</kbd> - Maximized / Monocle layout
+ <kbd>super + [arrow keys]</kbd> or <kbd>super + [hjkl]</kbd> - Change focus by direction
+ <kbd>super + shift + [arrow keys]</kbd> or <kbd>super + shift + [hjkl]</kbd> - Move client by direction. Move to edge if it is floating.
+ <kbd>super + control + [arrow keys]</kbd> or <kbd>super + control + [hjkl]</kbd> - Resize
+ <kbd>super + f</kbd> - Toggle fullscreen
+ <kbd>super + m</kbd> - Toggle maximize
+ <kbd>super + n</kbd> - Minimize
+ <kbd>super + shift + n</kbd> - Restore minimized
+ <kbd>super + c</kbd> - Center floating client
+ <kbd>super + u</kbd> - Jump to urgent client (or back to last tag if there is no such client)
+ <kbd>super + shift + b</kbd> - Toggle bar
+ <kbd>super + =</kbd> - Toggle tray
+ *... And many many more.*
#### Mouse on desktop
+ `left click` - Dismiss all notifications, close sidebar and main menu
+ `double left click` - Jump to urgent client (or back to last tag if there is no such client)
+ `right click` - App drawer
+ `middle click` - Start screen
+ `middle click` - Dashboard
+ `scroll up/down` - Cycle through tags
+ `move to left/right edge` - Show sidebar
+ ... And more.
#### Mouse on titlebars
+ `left click` - Focus and raise
+ `left click (drag)` - Move
+ `right click (drag)` - Resize
+ `middle click` - Close
+ ... And more.
## Anti-aliasing
AwesomeWM can anti-alias titlebars, but not the client content itself.
If `user.anti_aliasing` is enabled in the configuration, the top titlebar corners are antialiased and a small titlebar is also added at the bottom in order to round the bottom corners.
If it is disabled, the client shape will STILL be rounded, just without anti-aliasing, according to your theme's `border_radius` variable.
In some cases, (check `wants_equal_padding(c)` function in `titlebars.lua`) 4 titlebars are added instead of 2 in order to create equal padding around all client sides.
Anti-aliasing can be applied to any wibox by making its background color transparent and putting all its items in a shaped container with the desired background color.
Here is an example of an anti-aliased wibox.
```lua
-- Load these libraries (if you haven't already)
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
-- Create the box
local anti_aliased_wibox = wibox({visible = true, ontop = true, type = "normal", height = 100, width = 100})
-- Place it at the center of the screen
awful.placement.centered(anti_aliased_wibox)
-- Set transparent bg
anti_aliased_wibox.bg = "#00000000"
-- Put its items in a shaped container
anti_aliased_wibox:setup {
-- Container
{
-- Items go here
wibox.widget.textbox("Hello!"),
-- ...
layout = wibox.layout.fixed.vertical
},
-- The real background color
bg = "#111111",
-- The real, anti-aliased shape
shape = gears.shape.rounded_rect,
widget = wibox.container.background()
}
```
## Custom titlebars per class / name / whatever
+ For the custom titlebars to work your terminal or application needs to be able to set its own class or name
Example: For the mpd titlebar it needs to have class "music" or name "Music Terminal". You can change this in `titlebars.lua`.
You can find an example script that launches a terminal like this in `bin/music_terminal`
```shell
# Termite
termite --class music --exec ncmpcpp
# st / xst
st -c music -e ncmpcpp
# urxvt
urxvt -T "Music Terminal" -e ncmpcpp
```
+ Of course you can set your own custom titlebars for any application as long as you know its class, name, instance, whatever and then creating a custom titlebar setup in the existing if-else block in `titlebars.lua`. For example `if c.class == "Thunar" ...`
+ You can find details such as class, name, and others for any client with the `xprop` utility.
## More details about the start screen
+ Activate it with `super+F1`, or by middle clicking anywhere on the desktop.
+ Dismiss with `escape`, `q` or `F1` or `middle click`.
+ You can scroll on the calendar to switch to the previous / next month. Left click to reset.
+ The fortune box requires `fortune-mod`. Clicking it gives you a new fortune cookie :)
+ The brightness bar requires `light`.
+ The bell icon suspends / re-enables notifications on click.
+ The camera icon takes a screenshot instantly on left click and with a 5 second delay on right click. Requires "screenshot.sh" from my repo. Alternatively you can set your own screenshot command.
## More details about the sidebar
+ Can be toggled with `super+grave`.
+ Can be activated by moving the mouse to the edge of the screen and hidden by moving the mouse out of it (these settings can be easily enabled/disabled in your `user` preferences in rc.lua).
+ By default it is always above windows, and does not grab your keyboard (so you can have it open while doing something else, or just toggle it for a second to check your battery while you are watching something in fullscreen).
+ Most widgets (volume, search, exit, music...) are clickable.
+ Volume and music update only when they need to, as they are subscribed to pulse and mpd events respectively.
+ For the weather widget I modified this [polybar custom script](https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-simple). It uses the [openweathermap API](https://openweathermap.org/api). If you want this to work, you will need to create an account there, get your key, look for your city ID, and place them in `noodle/weather.lua`. (Same goes for `text_weather.lua`)
## More details about the exit screen
+ Activate it with `super+escape`, by clicking Exit on the sidebar, or in the right click menu (awesome -> quit)
+ Mouse controls: Click on any icon to execute the command, `right click` or `middle click` anywhere to cancel.
+ Keyboard controls:
+ `escape` or `q` or `x` to cancel
+ `p` to poweroff
+ `r` to reboot
+ `s` to suspend
+ `e` to exit (logout)
+ `l` to lock
## Tips / Notes
+ You can open an issue if you have any questions / problems.
Do not forget to search through old issues first. They could already contain an answer to your question.
Also make sure you have the latest version of the repo. Little fixes happen all the time.
+ If you are new to AwesomeWM...
I suggest you start from the default configuration and add pieces you like to it instead of trying to modify someone else's configuration.
Even if you feel really comfortable with that specific config, you will realize that you have no idea how anything works and how you can modify things to your own liking. Trust me, I've been there.
+ Don't forget to use the [API Documentation for AwesomeWM](https://awesomewm.org/apidoc/index.html).
It is well written and has plenty of examples.
+ You can also post your questions on [/r/awesomewm](https://www.reddit.com/r/awesomewm/)
## Older theme previews
| Theme | Preview | Reddit post |
| --- | --- | --- |
| Skyfall | ![Screenshot](https://i.redd.it/kobla5v7r5i21.png "Skyfall theme") | [Skyfall](https://www.reddit.com/r/unixporn/comments/atkn5b) |
| Lovelace | ![Screenshot](https://i.redd.it/glzrkk83f4621.png "Lovelace theme") | [Mechanical Love](https://www.reddit.com/comments/a900p7) |
| Manta | ![Screenshot](https://i.imgur.com/5pV3Xxa.png "Manta theme") | [Cake Day](https://www.reddit.com/r/unixporn/comments/9ji6uu/awesome_cake_day/) |
| Reasons | ![Screenshot](https://i.imgur.com/MdAN8jT.png "Reasons theme") | [25 reasons why you need a tiling WM](https://www.reddit.com/r/unixporn/comments/8jxpxc) |