Updated dotfiles
|
@ -1,10 +0,0 @@
|
||||||
"=============================================================================
|
|
||||||
" init.vim --- Entry file for neovim
|
|
||||||
" Copyright (c) 2016-2021 Wang Shidong & Contributors
|
|
||||||
" Author: Wang Shidong < wsdjeg@outlook.com >
|
|
||||||
" URL: https://spacevim.org
|
|
||||||
" License: GPLv3
|
|
||||||
"=============================================================================
|
|
||||||
|
|
||||||
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/main.vim'
|
|
||||||
set guifont=mononoki\ Nerd\ Font:h9
|
|
59
.bashrc
|
@ -8,9 +8,7 @@
|
||||||
### EXPORT
|
### EXPORT
|
||||||
export TERM="xterm-256color" # getting proper colors
|
export TERM="xterm-256color" # getting proper colors
|
||||||
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
|
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
|
||||||
export ALTERNATE_EDITOR="" # setting for emacsclient
|
export EDITOR="nvim" # $EDITOR use neovim
|
||||||
export EDITOR="emacsclient -t -a ''" # $EDITOR use Emacs in terminal
|
|
||||||
export VISUAL="emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
|
|
||||||
|
|
||||||
### SET MANPAGER
|
### SET MANPAGER
|
||||||
### "bat" as manpager
|
### "bat" as manpager
|
||||||
|
@ -71,14 +69,8 @@ alias .5='cd ../../../../..'
|
||||||
# bat as cat
|
# bat as cat
|
||||||
alias cat='bat'
|
alias cat='bat'
|
||||||
|
|
||||||
# vim and DOOM emacs
|
# neovim as vim
|
||||||
alias vim='nvim'
|
alias vim='nvim'
|
||||||
alias doom-sync="~/.emacs.d/bin/doom sync"
|
|
||||||
alias doom-doctor="~/.emacs.d/bin/doom doctor"
|
|
||||||
alias doom-upgrade="~/.emacs.d/bin/doom upgrade"
|
|
||||||
alias doom-purge="~/.emacs.d/bin/doom purge"
|
|
||||||
alias em='/usr/bin/emacs -nw'
|
|
||||||
alias emacs="emacsclient -c -a 'emacs'"
|
|
||||||
|
|
||||||
# Changing "ls" to "exa"
|
# Changing "ls" to "exa"
|
||||||
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
||||||
|
@ -87,24 +79,13 @@ alias ll='exa -l --color=always --group-directories-first' # long format
|
||||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
||||||
alias l.='exa -a | egrep "^\."'
|
alias l.='exa -a | egrep "^\."'
|
||||||
|
|
||||||
# pacman and yay
|
# xbps
|
||||||
alias pac-up='sudo pacman -Syyu' # update the whole system
|
alias xb-up='sudo xbps-install -Su' # update the whole system
|
||||||
alias pac-get='sudo pacman -S --needed' # install a program
|
alias xb-get='sudo xbps-install -S' # install a program
|
||||||
alias pac-qry-sync='sudo pacman -Ss' # query details about a program
|
alias xb-qry='sudo xbps-query' # query details about a program
|
||||||
alias pac-qry='sudo pacman -Q' # query details about a program
|
alias xb-rmv='sudo xbps-remove -R' # remove a package with all its dependencies (it may brake something)
|
||||||
alias pac-rmv='sudo pacman -Rcns' # remove a package with all its dependencies (it may brake something)
|
alias xb-rmv-sec='sudo xbps-remove' # remove a package with all its dependencies (secure way)
|
||||||
alias pac-rmv-sec='sudo pacman -Runs' # remove a package with all its dependencies (secure way)
|
alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove unnecesary packages and clean cache
|
||||||
alias pac-cln='sudo pacman -Rns (pacman -Qtdq)' # remove unnecesary packages
|
|
||||||
alias pac-unlock='sudo rm /var/lib/pacman/db.lck' # remove pacman lock
|
|
||||||
alias yay-up='yay -Sua --noconfirm' # update only AUR pkgs (yay)
|
|
||||||
alias yay-get='yay -S' # install a program for the AUR
|
|
||||||
alias pac-cln-cache='yay -Scc' # clean package cache
|
|
||||||
|
|
||||||
# get fastest mirrors
|
|
||||||
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
|
|
||||||
|
|
||||||
# Colorize grep output (good for log files)
|
# Colorize grep output (good for log files)
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
|
@ -117,21 +98,18 @@ alias mv='mv -i'
|
||||||
alias cp='cp -i'
|
alias cp='cp -i'
|
||||||
|
|
||||||
# git
|
# git
|
||||||
alias gt-cl='git clone'
|
alias git-clone='git clone'
|
||||||
|
|
||||||
# ani-cli
|
# ani-cli
|
||||||
alias ani='ani-cli'
|
alias ani='ani-cli'
|
||||||
alias ani-q='ani-cli -q' # to select video quality
|
alias ani-q='ani-cli -q' # to select video quality
|
||||||
|
|
||||||
# ytfzf
|
# ytfzf
|
||||||
alias yt='ytfzf -f'
|
alias yt='ytfzf -f -t'
|
||||||
|
|
||||||
# notflix
|
# notflix
|
||||||
alias nt='notflix'
|
alias nt='notflix'
|
||||||
|
|
||||||
# tty-clock
|
|
||||||
alias clock='tty-clock'
|
|
||||||
|
|
||||||
# mount and unmount drives
|
# mount and unmount drives
|
||||||
alias mnt='sudo mount'
|
alias mnt='sudo mount'
|
||||||
alias umnt='sudo umount'
|
alias umnt='sudo umount'
|
||||||
|
@ -143,13 +121,10 @@ alias amx='alsamixer'
|
||||||
# music player
|
# music player
|
||||||
alias mk='musikcube'
|
alias mk='musikcube'
|
||||||
|
|
||||||
# battery (just for laptops)
|
|
||||||
alias bt='acpi'
|
|
||||||
|
|
||||||
# power management
|
# power management
|
||||||
alias po='systemctl poweroff'
|
alias po='loginctl poweroff'
|
||||||
alias sp='systemctl suspend'
|
alias sp='loginctl suspend'
|
||||||
alias rb='systemctl reboot'
|
alias rb='loginctl reboot'
|
||||||
|
|
||||||
# file manager
|
# file manager
|
||||||
alias fm='/home/drk/.config/vifm/scripts/./vifmrun'
|
alias fm='/home/drk/.config/vifm/scripts/./vifmrun'
|
||||||
|
@ -181,12 +156,6 @@ alias wfi-on='nmcli radio wifi on'
|
||||||
alias wfi-off='nmcli radio wifi off'
|
alias wfi-off='nmcli radio wifi off'
|
||||||
alias blt='bluetoothctl'
|
alias blt='bluetoothctl'
|
||||||
|
|
||||||
# cd to diferent directories
|
|
||||||
alias games='cd /run/media/Storage/multimedia/games/linux && ls'
|
|
||||||
alias anime='cd /run/media/Storage/multimedia/videos/anime/ && ls'
|
|
||||||
alias manga='cd /run/media/Storage/multimedia/manga/ && ls'
|
|
||||||
alias videos='cd /run/media/Storage/multimedia/videos/ && ls'
|
|
||||||
|
|
||||||
# the terminal rickroll
|
# the terminal rickroll
|
||||||
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
|
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ font:
|
||||||
style: Bold Italic
|
style: Bold Italic
|
||||||
|
|
||||||
# Point size
|
# Point size
|
||||||
size: 9.0
|
size: 8.5
|
||||||
|
|
||||||
# Offset is the extra space around each character. `offset.y` can be thought of
|
# Offset is the extra space around each character. `offset.y` can be thought of
|
||||||
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
|
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
# Battery widget
|
|
||||||
|
|
||||||
Simple and easy-to-install widget for Awesome Window Manager.
|
|
||||||
|
|
||||||
This widget consists of:
|
|
||||||
|
|
||||||
- an icon which shows the battery level:
|
|
||||||
![Battery Widget](./bat-wid-1.png)
|
|
||||||
- a pop-up window, which shows up when you hover over an icon:
|
|
||||||
![Battery Widget](./bat-wid-2.png)
|
|
||||||
Alternatively you can use a tooltip (check the code):
|
|
||||||
![Battery Widget](./bat-wid-22.png)
|
|
||||||
- a pop-up warning message which appears on bottom right corner when battery level is less that 15% (you can get the image [here](https://vk.com/images/stickers/1933/512.png)):
|
|
||||||
![Battery Widget](./bat-wid-3.png)
|
|
||||||
|
|
||||||
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
|
|
||||||
|
|
||||||
## Customization
|
|
||||||
|
|
||||||
It is possible to customize widget by providing a table with all or some of the following config parameters:
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `font` | Play 8 | Fond |
|
|
||||||
| `path_to_icons` | `/usr/share/icons/Arc/status/symbolic/` | Path to the folder with icons* |
|
|
||||||
| `show_current_level`| false | Show current charge level |
|
|
||||||
| `margin_right`|0| The right margin of the widget|
|
|
||||||
| `margin_left`|0| The left margin of the widget|
|
|
||||||
| `display_notification` | `false` | Display a notification on mouseover |
|
|
||||||
| `notification_position` | `top_right` | The notification position |
|
|
||||||
| `timeout` | 10 | How often in seconds the widget refreshes |
|
|
||||||
| `warning_msg_title` | _Huston, we have a problem_ | Title of the warning popup |
|
|
||||||
| `warning_msg_text` | _Battery is dying_ | Text of the warning popup |
|
|
||||||
| `warning_msg_position` | `bottom_right` | Position of the warning popup |
|
|
||||||
| `warning_msg_icon` | ~/.config/awesome/awesome-wm-widgets/battery-widget/spaceman.jpg | Icon of the warning popup |
|
|
||||||
| `enable_battery_warning` | `true` | Display low battery warning |
|
|
||||||
|
|
||||||
*Note: the widget expects following icons be present in the folder:
|
|
||||||
|
|
||||||
- battery-caution-charging-symbolic.svg
|
|
||||||
- battery-empty-charging-symbolic.svg
|
|
||||||
- battery-full-charged-symbolic.svg
|
|
||||||
- battery-full-symbolic.svg
|
|
||||||
- battery-good-symbolic.svg
|
|
||||||
- battery-low-symbolic.svg
|
|
||||||
- battery-caution-symbolic.svg
|
|
||||||
- battery-empty-symbolic.svg
|
|
||||||
- battery-full-charging-symbolic.svg
|
|
||||||
- battery-good-charging-symbolic.svg
|
|
||||||
- battery-low-charging-symbolic.svg
|
|
||||||
- battery-missing-symbolic.svg
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
This widget reads the output of acpi tool.
|
|
||||||
- install `acpi` and check the output:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ sudo apt-get install acpi
|
|
||||||
$ acpi
|
|
||||||
Battery 0: Discharging, 66%, 02:34:06 remaining
|
|
||||||
```
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
|
|
||||||
|
|
||||||
...
|
|
||||||
s.mytasklist, -- Middle widget
|
|
||||||
{ -- Right widgets
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
...
|
|
||||||
battery_widget(),
|
|
||||||
...
|
|
||||||
```
|
|
Before Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 14 KiB |
|
@ -1,93 +0,0 @@
|
||||||
# Brightness widget
|
|
||||||
|
|
||||||
This widget represents current brightness level, depending on config parameters could be an arcchart or icon with text: ![Brightness widget](./br-wid-1.png)
|
|
||||||
|
|
||||||
## Customization
|
|
||||||
|
|
||||||
It is possible to customize widget by providing a table with all or some of the following config parameters:
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `type`| `arc` | The widget type. Could be `arc` or `icon_and_text` |
|
|
||||||
| `program` | `light` | The program used to control the brightness, either `light`, `xbacklight`, or `brightnessctl`. |
|
|
||||||
| `step` | 5 | Step |
|
|
||||||
| `base` | 20 | Base level to set brightness to on left click. |
|
|
||||||
| `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon |
|
|
||||||
| `font` | `Play 9` | Font |
|
|
||||||
| `timeout` | 1 | How often in seconds the widget refreshes. Check the note below |
|
|
||||||
| `tooltip` | false | Display brightness level in a tooltip when the mouse cursor hovers the widget |
|
|
||||||
|
|
||||||
_Note:_ If brightness is controlled only by the widget (either by a mouse, or by a shortcut, then the `timeout` could be quite big, as there is no reason to synchronize the brightness level).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
To choose the right `program` argument, first you need to check which of them works better for you.
|
|
||||||
|
|
||||||
- using `xbacklight`:
|
|
||||||
|
|
||||||
Install (on Ubuntu it's available in the apt repository) it and check if it works by running:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
xbacklight -get
|
|
||||||
```
|
|
||||||
|
|
||||||
If there is no output it means that it doesn't work, you can either try to fix it, or try to use `light`.
|
|
||||||
|
|
||||||
- using `light` command:
|
|
||||||
|
|
||||||
Install (on Ubuntu it's available in the apt repository) from the repo: [github.com/haikarainen/light](https://github.com/haikarainen/light) and check if it works by running
|
|
||||||
|
|
||||||
```bash
|
|
||||||
light -G
|
|
||||||
49.18
|
|
||||||
light -A 5
|
|
||||||
```
|
|
||||||
If you're on Ubuntu/debian and if the brightness level doesn't change, try to do this: https://github.com/haikarainen/light/issues/113#issuecomment-632638436.
|
|
||||||
|
|
||||||
- using `brightnessctl`:
|
|
||||||
|
|
||||||
On Ubuntu it is available in the apt repository. Install and check the ouptut of the following command.
|
|
||||||
```bash
|
|
||||||
brightnessctl --list
|
|
||||||
```
|
|
||||||
|
|
||||||
Then clone this repo under **~/.config/awesome/**:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/awesome-wm-widgets
|
|
||||||
```
|
|
||||||
|
|
||||||
Require widget at the beginning of **rc.lua**:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
|
|
||||||
```
|
|
||||||
|
|
||||||
Add the widget to the tasklist:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
s.mytasklist, -- Middle widget
|
|
||||||
{ -- Right widgets
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
...
|
|
||||||
-- default
|
|
||||||
brightness_widget(),
|
|
||||||
-- or customized
|
|
||||||
brightness_widget{
|
|
||||||
type = 'icon_and_text',
|
|
||||||
program = 'xbacklight',
|
|
||||||
step = 2,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Controls
|
|
||||||
|
|
||||||
In order to change brightness by shortcuts you can add them to the `globalkeys` table in the **rc.lua**:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
awful.key({ modkey }, ";", function () brightness_widget:inc() end, {description = "increase brightness", group = "custom"}),
|
|
||||||
awful.key({ modkey, "Shift"}, ";", function () brightness_widget:dec() end, {description = "decrease brightness", group = "custom"}),
|
|
||||||
```
|
|
||||||
On a laptop you can use `XF86MonBrightnessUp` and `XF86MonBrightnessDown` keys.
|
|
Before Width: | Height: | Size: 4.8 KiB |
|
@ -1,45 +0,0 @@
|
||||||
# Logout Menu Widget
|
|
||||||
|
|
||||||
This widget shows a menu with options to log out from the current session, lock, reboot, suspend and power off the computer, similar to [logout-popup-widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-popup-widget):
|
|
||||||
|
|
||||||
![demo](./logout-menu.gif)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Clone this repo (if not cloned yet) **./.config/awesome/**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd ./.config/awesome/
|
|
||||||
git clone https://github.com/streetturtle/awesome-wm-widgets
|
|
||||||
```
|
|
||||||
Then add the widget to the wibar:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu")
|
|
||||||
|
|
||||||
s.mytasklist, -- Middle widget
|
|
||||||
{ -- Right widgets
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
...
|
|
||||||
-- default
|
|
||||||
logout_menu_widget(),
|
|
||||||
-- custom
|
|
||||||
logout_menu_widget{
|
|
||||||
font = 'Play 14',
|
|
||||||
onlock = function() awful.spawn.with_shell('i3lock-fancy') end
|
|
||||||
}
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customization
|
|
||||||
|
|
||||||
It is possible to customize the widget by providing a table with all or some of the following config parameters:
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `font` | `beautiful.font` | Font of the menu items |
|
|
||||||
| `onlogout` | `function() awesome.quit() end` | Function which is called when the logout item is clicked |
|
|
||||||
| `onlock` | `function() awful.spawn.with_shell("i3lock") end` | Function which is called when the lock item is clicked |
|
|
||||||
| `onreboot` | `function() awful.spawn.with_shell("reboot") end` | Function which is called when the reboot item is clicked |
|
|
||||||
| `onsuspend` | `function() awful.spawn.with_shell("systemctl suspend") end` | Function which is called when the suspend item is clicked |
|
|
||||||
| `onpoweroff` | `function() awful.spawn.with_shell("shutdown now") end` | Function which is called when the poweroff item is clicked |
|
|
Before Width: | Height: | Size: 46 KiB |
|
@ -53,9 +53,9 @@ local function worker(user_args)
|
||||||
|
|
||||||
local onlogout = args.onlogout or function () awesome.quit() end
|
local onlogout = args.onlogout or function () awesome.quit() end
|
||||||
local onlock = args.onlock or function() awful.spawn.with_shell("betterlockscreen -l") end
|
local onlock = args.onlock or function() awful.spawn.with_shell("betterlockscreen -l") end
|
||||||
local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end
|
local onreboot = args.onreboot or function() awful.spawn.with_shell("loginctl reboot") end
|
||||||
local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end
|
local onsuspend = args.onsuspend or function() awful.spawn.with_shell("loginctl suspend && betterlockscreen -l") end
|
||||||
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("poweroff") end
|
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("loginctl poweroff") end
|
||||||
|
|
||||||
local menu_items = {
|
local menu_items = {
|
||||||
{ name = 'Log out', icon_name = 'log-out.svg', command = onlogout },
|
{ name = 'Log out', icon_name = 'log-out.svg', command = onlogout },
|
||||||
|
|
|
@ -1,119 +0,0 @@
|
||||||
# Volume widget
|
|
||||||
|
|
||||||
Volume widget based on [amixer](https://linux.die.net/man/1/amixer) (is used for controlling the audio volume) and [pacmd](https://linux.die.net/man/1/pacmd) (is used for selecting a sink/source). Also, the widget provides an easy way to customize how it looks, following types are supported out-of-the-box:
|
|
||||||
|
|
||||||
![types](screenshots/variations.png)
|
|
||||||
|
|
||||||
From left to right: `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc`
|
|
||||||
|
|
||||||
A right-click on the widget opens a popup where you can choose a sink/source:
|
|
||||||
![sink-sources](screenshots/volume-sink-sources.png)
|
|
||||||
|
|
||||||
Left click toggles mute and middle click opens a mixer ([pavucontrol](https://freedesktop.org/software/pulseaudio/pavucontrol/) by default).
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
- switch between sinks/sources by right click on the widget;
|
|
||||||
- more responsive than previous versions of volume widget, which were refreshed once a second;
|
|
||||||
- 5 predefined customizable looks;
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Clone the repo under **~/.config/awesome/** and add widget in **rc.lua**:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
|
|
||||||
...
|
|
||||||
s.mytasklist, -- Middle widget
|
|
||||||
{ -- Right widgets
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
...
|
|
||||||
-- default
|
|
||||||
volume_widget(),
|
|
||||||
-- customized
|
|
||||||
volume_widget{
|
|
||||||
widget_type = 'arc'
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that widget uses following command the get the current volume: `amixer -D pulse sget Master`, so please make sure that it works for you, otherwise you need to set parameter `device = 'default'`.
|
|
||||||
|
|
||||||
### Shortcuts
|
|
||||||
|
|
||||||
To improve responsiveness of the widget when volume level is changed by a shortcut use corresponding methods of the widget:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
awful.key({ modkey }, "]", function() volume_widget:inc(5) end),
|
|
||||||
awful.key({ modkey }, "[", function() volume_widget:dec(5) end),
|
|
||||||
awful.key({ modkey }, "\\", function() volume_widget:toggle() end),
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customization
|
|
||||||
|
|
||||||
It is possible to customize the widget by providing a table with all or some of the following config parameters:
|
|
||||||
|
|
||||||
### Generic parameter
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `mixer_cmd` | `pavucontrol` | command to run on middle click (e.g. a mixer program) |
|
|
||||||
| `step` | `5` | How much the volume is raised or lowered at once (in %) |
|
|
||||||
| `widget_type`| `icon_and_text`| Widget type, one of `horizontal_bar`, `vertical_bar`, `icon`, `icon_and_text`, `arc` |
|
|
||||||
| `device` | `pulse` | Select the device name to control |
|
|
||||||
|
|
||||||
Depends on the chosen widget type add parameters from the corresponding section below:
|
|
||||||
|
|
||||||
#### `icon` parameters
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `icon_dir`| `./icons`| Path to the folder with icons |
|
|
||||||
|
|
||||||
_Note:_ if you are changing icons, the folder should contain following .svg images:
|
|
||||||
- audio-volume-high-symbolic
|
|
||||||
- audio-volume-medium-symbolic
|
|
||||||
- audio-volume-low-symbolic
|
|
||||||
- audio-volume-muted-symbolic
|
|
||||||
|
|
||||||
#### `icon_and_text` parameters
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `icon_dir`| `./icons`| Path to the folder with icons |
|
|
||||||
| `font` | `beautiful.font` | Font name and size, like `Play 12` |
|
|
||||||
|
|
||||||
#### `arc` parameters
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `thickness` | 2 | Thickness of the arc |
|
|
||||||
| `main_color` | `beautiful.fg_color` | Color of the arc |
|
|
||||||
| `bg_color` | `#ffffff11` | Color of the arc's background |
|
|
||||||
| `mute_color` | `beautiful.fg_urgent` | Color of the arc when mute |
|
|
||||||
| `size` | 18 | Size of the widget |
|
|
||||||
|
|
||||||
#### `horizontal_bar` parameters
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `main_color` | `beautiful.fg_normal` | Color of the bar |
|
|
||||||
| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute |
|
|
||||||
| `bg_color` | `'#ffffff11'` | Color of the bar's background |
|
|
||||||
| `width` | `50` | The bar width |
|
|
||||||
| `margins` | `10` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
|
|
||||||
| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
|
|
||||||
| `with_icon` | `true` | Show volume icon|
|
|
||||||
|
|
||||||
_Note:_ I didn't figure out how does the `forced_height` property of progressbar widget work (maybe it doesn't work at all), thus there is a workaround with margins.
|
|
||||||
|
|
||||||
#### `vertical_bar` parameters
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
|---|---|---|
|
|
||||||
| `main_color` | `beautiful.fg_normal` | Color of the bar |
|
|
||||||
| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute |
|
|
||||||
| `bg_color` | `'#ffffff11'` | Color of the bar's background |
|
|
||||||
| `width` | `10` | The bar width |
|
|
||||||
| `margins` | `20` | Top and bottom margins (if your wibar is 22 px high, bar will be 2 px = 22 - 2*10) |
|
|
||||||
| `shape` | `'bar'` | [gears.shape](https://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
|
|
||||||
| `with_icon` | `true` | Show volume icon|
|
|
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 72 KiB |
|
@ -1,668 +0,0 @@
|
||||||
#+TITLE: DRK's Awesome Config
|
|
||||||
#+AUTHOR: Clay Gomera (Drake)
|
|
||||||
#+DESCRIPTION: This my full awesome config for my laptop.
|
|
||||||
#+PROPERTY: header-args :tangle rc.lua
|
|
||||||
|
|
||||||
* TABLE OF CONTENTS :toc:
|
|
||||||
- [[#about-this-config][ABOUT THIS CONFIG]]
|
|
||||||
- [[#libraries][Libraries]]
|
|
||||||
- [[#handle-runtime-errors-after-startup][Handle runtime errors after startup]]
|
|
||||||
- [[#themes][Themes]]
|
|
||||||
- [[#layouts][Layouts]]
|
|
||||||
- [[#lain-layouts][Lain layouts]]
|
|
||||||
- [[#default-awesome-variables][Default Awesome variables]]
|
|
||||||
- [[#personal-variables][Personal Variables]]
|
|
||||||
- [[#tags][Tags]]
|
|
||||||
- [[#wibox-and-wallpaper-stuff][Wibox and wallpaper stuff]]
|
|
||||||
- [[#bindings][Bindings]]
|
|
||||||
- [[#rules][Rules]]
|
|
||||||
- [[#signals][Signals]]
|
|
||||||
- [[#mouse-client-focus][Mouse client focus]]
|
|
||||||
- [[#autorun][Autorun]]
|
|
||||||
|
|
||||||
* ABOUT THIS CONFIG
|
|
||||||
Awesome is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license. It is primarily targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on their graphical environment. This is the Awesome configuration of Clay Gomera (Drake) fully written in ORG mode inside EMACS. This is just a personal hobby that gives me all the freedom and posibilites to learn how to code and use text editors like Emacs.
|
|
||||||
|
|
||||||
#+CAPTION: An example screenshot
|
|
||||||
#+NAME: screenshot
|
|
||||||
#+attr_org: :width 750
|
|
||||||
[[./screenshot.png]]
|
|
||||||
|
|
||||||
* Libraries
|
|
||||||
This is where you put custom libraries like lain or awesome-wm-widgets.
|
|
||||||
#+begin_src lua
|
|
||||||
-- Standard awesome library
|
|
||||||
local gears = require("gears") --Utilities such as color parsing and objects
|
|
||||||
local awful = require("awful") --Everything related to window managment
|
|
||||||
require("awful.autofocus")
|
|
||||||
-- Custom libraries
|
|
||||||
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
|
|
||||||
local volume_widget = require('awesome-wm-widgets.volume-widget.volume')
|
|
||||||
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
|
|
||||||
local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu")
|
|
||||||
-- Widget and layout library
|
|
||||||
local wibox = require("wibox")
|
|
||||||
-- Theme handling library
|
|
||||||
local beautiful = require("beautiful")
|
|
||||||
-- Notification library
|
|
||||||
local naughty = require("naughty")
|
|
||||||
naughty.config.defaults['icon_size'] = 100
|
|
||||||
-- Lain library
|
|
||||||
local lain = require("lain")
|
|
||||||
-- Enable hotkeys help widget for VIM and other apps
|
|
||||||
-- when client with a matching name is opened:
|
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
|
||||||
require("awful.hotkeys_popup.keys")
|
|
||||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Handle runtime errors after startup
|
|
||||||
This section manages all the errors and error notifications.
|
|
||||||
#+begin_src lua
|
|
||||||
if awesome.startup_errors then
|
|
||||||
naughty.notify({ preset = naughty.config.presets.critical,
|
|
||||||
title = "Oops, there were errors during startup!",
|
|
||||||
text = awesome.startup_errors }) end
|
|
||||||
do
|
|
||||||
local in_error = false
|
|
||||||
awesome.connect_signal("debug::error", function (err)
|
|
||||||
-- Make sure we don't go into an endless error loop
|
|
||||||
if in_error then return end
|
|
||||||
in_error = true
|
|
||||||
naughty.notify({ preset = naughty.config.presets.critical,
|
|
||||||
title = "Oops, an error happened!",
|
|
||||||
text = tostring(err) })
|
|
||||||
in_error = false
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
local function run_once(cmd_arr)
|
|
||||||
for _, cmd in ipairs(cmd_arr) do
|
|
||||||
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Themes
|
|
||||||
Here you chose your theme, tipically you will use a lain theme like powerarrow or multicolor, my custom theme is a fork of the powerarrow_dark theme focused on the gruvbox color palette and functional integration with the awesome-wm-widgets library. To setup more themes you need to put them into the themes folder located here in the awesome .config folder, then you need to add them into that variable called "local theme = { "theme1", "theme2" }". All the themes are indentified with a number as you can see down there, so to chose a theme you need to edit the variable "local chosen_theme = themes[1,2,3,etc]" to specify the theme that you want.
|
|
||||||
#+begin_src lua
|
|
||||||
local themes = {
|
|
||||||
"gruvbox-dark" -- 1
|
|
||||||
}
|
|
||||||
local chosen_theme = themes[1]
|
|
||||||
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
|
||||||
beautiful.init(theme_path)
|
|
||||||
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Layouts
|
|
||||||
Here you can comment out the layouts that you don't want to use or put them in another order.
|
|
||||||
#+begin_src lua
|
|
||||||
awful.layout.suit.tile.left.mirror = true
|
|
||||||
awful.layout.layouts = {
|
|
||||||
awful.layout.suit.tile,
|
|
||||||
awful.layout.suit.tile.left,
|
|
||||||
awful.layout.suit.tile.bottom,
|
|
||||||
awful.layout.suit.tile.top,
|
|
||||||
--awful.layout.suit.fair,
|
|
||||||
--awful.layout.suit.fair.horizontal,
|
|
||||||
--awful.layout.suit.spiral,
|
|
||||||
--awful.layout.suit.spiral.dwindle,
|
|
||||||
awful.layout.suit.max,
|
|
||||||
--awful.layout.suit.max.fullscreen,
|
|
||||||
awful.layout.suit.magnifier,
|
|
||||||
awful.layout.suit.floating,
|
|
||||||
--awful.layout.suit.corner.nw,
|
|
||||||
--awful.layout.suit.corner.ne,
|
|
||||||
--awful.layout.suit.corner.sw,
|
|
||||||
--awful.layout.suit.corner.se,
|
|
||||||
--lain.layout.cascade,
|
|
||||||
--lain.layout.cascade.tile,
|
|
||||||
--lain.layout.centerwork,
|
|
||||||
--lain.layout.centerwork.horizontal,
|
|
||||||
--lain.layout.termfair,
|
|
||||||
--lain.layout.termfair.center,
|
|
||||||
}
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Lain layouts
|
|
||||||
These are the lain layouts, i don't know what is this yet.
|
|
||||||
#+begin_src lua
|
|
||||||
lain.layout.termfair.nmaster = 3
|
|
||||||
lain.layout.termfair.ncol = 1
|
|
||||||
lain.layout.termfair.center.nmaster = 3
|
|
||||||
lain.layout.termfair.center.ncol = 1
|
|
||||||
lain.layout.cascade.tile.offset_x = 2
|
|
||||||
lain.layout.cascade.tile.offset_y = 32
|
|
||||||
lain.layout.cascade.tile.extra_padding = 5
|
|
||||||
lain.layout.cascade.tile.nmaster = 5
|
|
||||||
lain.layout.cascade.tile.ncol = 2
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Default Awesome variables
|
|
||||||
Here are the defaults awesome variables, just the terminal.
|
|
||||||
#+begin_src lua
|
|
||||||
awful.util.terminal = terminal
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Personal Variables
|
|
||||||
Here are my personal variables.
|
|
||||||
#+begin_src lua
|
|
||||||
local emacs = "emacsclient -c -a 'emacs'"
|
|
||||||
local spacevim = os.getenv("EDITOR") or "neovide"
|
|
||||||
local terminal = "alacritty"
|
|
||||||
local filemanager = "alacritty -e ./.config/vifm/scripts/vifmrun"
|
|
||||||
local filemanagergui = "pcmanfm"
|
|
||||||
local audiomixer = "alacritty -e pulsemixer"
|
|
||||||
local audiomixer2 = "alacritty -e alsamixer"
|
|
||||||
local browser = "librewolf"
|
|
||||||
local browser2 = "qutebrowser"
|
|
||||||
local musicplayer = "alacritty -e musikcube"
|
|
||||||
local musicplayergui = "lollypop"
|
|
||||||
local emailclient = "thunderbird"
|
|
||||||
local chat1 = "element-desktop"
|
|
||||||
local chat2 = "whatsapp-for-linux"
|
|
||||||
local notes = "joplin-desktop"
|
|
||||||
local passwords = "bitwarden-desktop"
|
|
||||||
local screenlocker = "betterlockscreen -l"
|
|
||||||
|
|
||||||
-- Key bindings variables
|
|
||||||
local modkey = "Mod4"
|
|
||||||
local altkey = "Mod1"
|
|
||||||
local modkey1 = "Control"
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Tags
|
|
||||||
Here are the tagnames, you can edit them as you wish.
|
|
||||||
#+begin_src lua
|
|
||||||
awful.util.tagnames = { " CODE ", " WEB ", " MUSIC ", " CHAT ", " FILE ", " NOTES ", " WORK1 ", " WORK2 ", " GAME " }
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Wibox and wallpaper stuff
|
|
||||||
Just wibox and wallpaper stuff, i use nitrogen and tipically you will edit your wibox settings in the theme.lua file located in your theme's folder. So this isn't really useful to modify.
|
|
||||||
#+begin_src lua
|
|
||||||
awful.util.taglist_buttons = my_table.join(
|
|
||||||
awful.button({ }, 1, function(t) t:view_only() end),
|
|
||||||
awful.button({ modkey }, 1, function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:move_to_tag(t)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
|
||||||
awful.button({ modkey }, 3, function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:toggle_tag(t)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
|
|
||||||
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
|
|
||||||
)
|
|
||||||
awful.util.tasklist_buttons = my_table.join(
|
|
||||||
awful.button({ }, 1, function (c)
|
|
||||||
if c == client.focus then
|
|
||||||
c.minimized = true
|
|
||||||
else
|
|
||||||
c:emit_signal("request::activate", "tasklist", {raise = true})
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ }, 3, function ()
|
|
||||||
local instance = nil
|
|
||||||
|
|
||||||
return function ()
|
|
||||||
if instance and instance.wibox.visible then
|
|
||||||
instance:hide()
|
|
||||||
instance = nil
|
|
||||||
else
|
|
||||||
instance = awful.menu.clients({theme = {width = 250}})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
awful.button({ }, 4, function () awful.client.focus.byidx(1) end),
|
|
||||||
awful.button({ }, 5, function () awful.client.focus.byidx(-1) end)
|
|
||||||
)
|
|
||||||
screen.connect_signal("property::geometry", function(s)
|
|
||||||
if beautiful.wallpaper then
|
|
||||||
local wallpaper = beautiful.wallpaper
|
|
||||||
if type(wallpaper) == "function" then
|
|
||||||
wallpaper = wallpaper(s)
|
|
||||||
end
|
|
||||||
gears.wallpaper.maximized(wallpaper, s, true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Bindings
|
|
||||||
This sections is all about keyboard shortcuts or being more correct "bindings". This is the most important part of this config, all the tags are app centric, this means that they are there to host a specific application or type of applications.
|
|
||||||
|-----------+---------+-----+--------------------+----------------------------------------------------------------------------------------------|
|
|
||||||
| Tagnumber | Tagname | Key | Type | App |
|
|
||||||
|-----------+---------+-----+--------------------+----------------------------------------------------------------------------------------------|
|
|
||||||
| 1 | CODE | F1 | Text editors | Super + F1 = Emacs / Super + Shift + F1 = spacevim |
|
|
||||||
| 2 | WEB | F2 | Web browsers | Super + F2 = firefox / Super + Shift + F2 = qutebrowser |
|
|
||||||
| 3 | MUSIC | F3 | Music players | Super + F3 = musikcube / Super + Shift + F3 = lollypop |
|
|
||||||
| 4 | CHAT | F4 | Messaging apps | Super + F4 = element / Super + Shift + F4 = whatsapp |
|
|
||||||
| 5 | FILE | F5 | File managers | Super + F5 = vifm / Super + Shift + F5 = pcmanfm |
|
|
||||||
| 6 | NOTES | F6 | Note taking app | Super + F6 = joplin |
|
|
||||||
| 7 | WORK1 | XX | Work in progress 1 | Super + d = opens rofi to select a program |
|
|
||||||
| 8 | WORK2 | XX | Work in progress 2 | Super + d = opens rofi to select a program |
|
|
||||||
| 9 | GAME | F9 | Games | Super + F9 = retroarch |
|
|
||||||
|-----------+---------+-----+--------------------+----------------------------------------------------------------------------------------------|
|
|
||||||
| X | XXXX | XX | tag agnostic | Super + Shift + m = pulsemixer / Super + Alt + m = alsamixer / Super + Shift + p = bitwarden |
|
|
||||||
|-----------+---------+-----+--------------------+----------------------------------------------------------------------------------------------|
|
|
||||||
|
|
||||||
#+begin_src lua
|
|
||||||
-- Mouse bindings
|
|
||||||
root.buttons(gears.table.join(
|
|
||||||
awful.button({ }, 4, awful.tag.viewnext),
|
|
||||||
awful.button({ }, 5, awful.tag.viewprev)
|
|
||||||
))
|
|
||||||
|
|
||||||
-- Awesome things
|
|
||||||
globalkeys = my_table.join(
|
|
||||||
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
|
||||||
{description="show help", group="awesome"}),
|
|
||||||
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
|
||||||
{description = "reload awesome", group = "awesome"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
|
||||||
{description = "quit awesome", group = "awesome"}),
|
|
||||||
|
|
||||||
-- Tag browsing arrow keys and escape
|
|
||||||
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
|
||||||
{description = "view previous", group = "tag"}),
|
|
||||||
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
|
||||||
{description = "view next", group = "tag"}),
|
|
||||||
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
|
|
||||||
{description = "go back", group = "tag"}),
|
|
||||||
|
|
||||||
-- Tag browsing alt + tab
|
|
||||||
awful.key({ altkey, }, "Tab", awful.tag.viewnext,
|
|
||||||
{description = "view next", group = "tag"}),
|
|
||||||
awful.key({ altkey, "Shift" }, "Tab", awful.tag.viewprev,
|
|
||||||
{description = "view previous", group = "tag"}),
|
|
||||||
|
|
||||||
-- Copy primary to clipboard (terminals to gtk)
|
|
||||||
awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
|
|
||||||
{description = "copy terminal to gtk", group = "hotkeys"}),
|
|
||||||
|
|
||||||
-- Copy clipboard to primary (gtk to terminals)
|
|
||||||
awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
|
|
||||||
{description = "copy gtk to terminal", group = "hotkeys"}),
|
|
||||||
|
|
||||||
-- Client focus
|
|
||||||
awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end,
|
|
||||||
{description = "focus next by index", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end,
|
|
||||||
{description = "focus previous by index", group = "client"}),
|
|
||||||
|
|
||||||
-- Layout manipulation
|
|
||||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
|
||||||
{description = "swap with next client by index", group = "client"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
|
||||||
{description = "swap with previous client by index", group = "client"}),
|
|
||||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
|
||||||
{description = "focus the next screen", group = "screen"}),
|
|
||||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
|
||||||
{description = "focus the previous screen", group = "screen"}),
|
|
||||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
|
||||||
{description = "jump to urgent client", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "Tab",
|
|
||||||
function ()
|
|
||||||
awful.client.focus.history.previous()
|
|
||||||
if client.focus then
|
|
||||||
client.focus:raise()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{description = "go back", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
|
||||||
{description = "increase master width factor", group = "layout"}),
|
|
||||||
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
|
||||||
{description = "decrease master width factor", group = "layout"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
|
||||||
{description = "increase the number of master clients", group = "layout"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
|
||||||
{description = "decrease the number of master clients", group = "layout"}),
|
|
||||||
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
|
||||||
{description = "increase the number of columns", group = "layout"}),
|
|
||||||
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
|
||||||
{description = "decrease the number of columns", group = "layout"}),
|
|
||||||
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
|
||||||
{description = "select next", group = "layout"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
|
||||||
{description = "select previous", group = "layout"}),
|
|
||||||
|
|
||||||
-- Terminal
|
|
||||||
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
|
|
||||||
{description = "launch a terminal", group = "apps"}),
|
|
||||||
|
|
||||||
-- Rofi
|
|
||||||
awful.key({ modkey }, "d", function () awful.spawn(string.format("rofi -show drun", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
|
||||||
{description = "show rofi drun menu", group = "hotkeys"}),
|
|
||||||
awful.key({ modkey }, "r", function () awful.spawn(string.format("rofi -show run", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
|
||||||
{description = "show rofi run menu", group = "hotkeys"}),
|
|
||||||
awful.key({ modkey }, "Tab", function () awful.spawn(string.format("rofi -show window", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
|
||||||
{description = "show rofi window menu", group = "hotkeys"}),
|
|
||||||
awful.key({ modkey }, "w", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-wifi-menu.sh") end,
|
|
||||||
{description = "show rofi wifi menu", group = "hotkeys"}),
|
|
||||||
awful.key({ modkey, altkey }, "Delete", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-power-menu.sh") end,
|
|
||||||
{description = "show rofi power menu", group = "hotkeys"}),
|
|
||||||
awful.key({ modkey, altkey }, "Print", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-scrot-menu.sh") end,
|
|
||||||
{description = "show rofi scrot menu", group = "hotkeys"}),
|
|
||||||
|
|
||||||
-- Keyboard Layouts
|
|
||||||
awful.key({ modkey, "Shift" }, "e", function () awful.util.spawn("setxkbmap -layout es") end,
|
|
||||||
{description = "switch to es keyboard layout", group = "keyboard"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "u", function () awful.util.spawn("setxkbmap -layout us") end,
|
|
||||||
{description = "switch to us keyboard layout", group = "keyboard"}),
|
|
||||||
|
|
||||||
-- Apps
|
|
||||||
-- code
|
|
||||||
awful.key({ modkey }, "F1", function () awful.spawn(emacs) end,
|
|
||||||
{description = "launch emacs", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F1", function () awful.spawn(spacevim) end,
|
|
||||||
{description = "launch spacevim", group = "apps"}),
|
|
||||||
-- web
|
|
||||||
awful.key({ modkey }, "F2", function () awful.spawn(browser) end,
|
|
||||||
{description = "launch firefox", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F2", function () awful.spawn(browser2) end,
|
|
||||||
{description = "launch qutebrowser", group = "apps"}),
|
|
||||||
-- music
|
|
||||||
awful.key({ modkey }, "F3", function () awful.spawn(musicplayer) end,
|
|
||||||
{description = "launch musikcube", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F3", function () awful.spawn(musicplayergui) end,
|
|
||||||
{description = "launch lollypop", group = "apps"}),
|
|
||||||
-- chat
|
|
||||||
awful.key({ modkey }, "F4", function () awful.spawn(chat1) end,
|
|
||||||
{description = "launch element", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F4", function () awful.spawn(chat2) end,
|
|
||||||
{description = "launch whatsapp", group = "apps"}),
|
|
||||||
-- file
|
|
||||||
awful.key({ modkey }, "F5", function () awful.spawn(filemanager) end,
|
|
||||||
{description = "launch vifm", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F5", function () awful.spawn(filemanagergui) end,
|
|
||||||
{description = "launch pcmanfm", group = "apps"}),
|
|
||||||
-- notes
|
|
||||||
awful.key({ modkey }, "F6", function () awful.spawn(notes) end,
|
|
||||||
{description = "launch joplin", group = "apps"}),
|
|
||||||
-- tag agnostic
|
|
||||||
awful.key({ modkey, "Shift" }, "m", function () awful.spawn(audiomixer) end,
|
|
||||||
{description = "launch pulsemixer", group = "apps"}),
|
|
||||||
awful.key({ modkey, altkey }, "m", function () awful.spawn(audiomixer2) end,
|
|
||||||
{description = "launch alsamixer", group = "apps"}),
|
|
||||||
awful.key({ modkey, altkey }, "p", function () awful.spawn(passwords) end,
|
|
||||||
{description = "launch bitwarden", group = "apps"}),
|
|
||||||
-- game
|
|
||||||
awful.key({ modkey }, "F9", function () awful.util.spawn("retroarch") end,
|
|
||||||
{description = "launch retroarch", group = "apps"}),
|
|
||||||
|
|
||||||
-- Volume Control
|
|
||||||
awful.key({}, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end,
|
|
||||||
{description = "increase volume", group = "volume"}),
|
|
||||||
awful.key({}, "XF86AudioLowerVolume", function() volume_widget:dec(5) end,
|
|
||||||
{description = "decrease volume", group = "volume"}),
|
|
||||||
awful.key({}, "XF86AudioMute", function() volume_widget:toggle() end,
|
|
||||||
{description = "mute volume", group = "volume"}),
|
|
||||||
|
|
||||||
-- Screenshot
|
|
||||||
awful.key({}, "Print", function() awful.util.spawn("scrot") end,
|
|
||||||
{description = "take a complete screenshot", group = "screenshot"}),
|
|
||||||
awful.key({"Control"}, "Print", function() awful.util.spawn("scrot -s") end,
|
|
||||||
{description = "take an area screenshot", group = "screenshot"}),
|
|
||||||
|
|
||||||
-- Brightness
|
|
||||||
awful.key({}, "XF86MonBrightnessUp", function () brightness_widget:inc(5) end,
|
|
||||||
{description = "increase brightness", group = "brightness"}),
|
|
||||||
awful.key({}, "XF86MonBrightnessDown", function () brightness_widget:dec(5) end,
|
|
||||||
{description = "decrease brightness", group = "brightness"}),
|
|
||||||
|
|
||||||
-- Screen configuration
|
|
||||||
awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end,
|
|
||||||
{description = "launch screen configuration tool", group = ("screen")}),
|
|
||||||
|
|
||||||
-- Screen Lock
|
|
||||||
awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end,
|
|
||||||
{description = "lock the screen", group = "screen"}),
|
|
||||||
|
|
||||||
-- Show/Hide Wibox
|
|
||||||
awful.key({ modkey }, "b", function ()
|
|
||||||
for s in screen do
|
|
||||||
s.mywibox.visible = not s.mywibox.visible
|
|
||||||
if s.mybottomwibox then
|
|
||||||
s.mybottomwibox.visible = not s.mybottomwibox.visible
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{description = "toggle wibox", group = "awesome"}),
|
|
||||||
|
|
||||||
-- On the fly useless gaps change
|
|
||||||
awful.key({ altkey, "Control" }, "j", function () lain.util.useless_gaps_resize(1) end,
|
|
||||||
{description = "increment gaps", group = "tag"}),
|
|
||||||
awful.key({ altkey, "Control" }, "l", function () lain.util.useless_gaps_resize(-1) end,
|
|
||||||
{description = "decrement gaps", group = "tag"}),
|
|
||||||
|
|
||||||
-- Dynamic tagging
|
|
||||||
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end,
|
|
||||||
{description = "add new tag", group = "tag"}),
|
|
||||||
awful.key({ modkey, "Control" }, "r", function () lain.util.rename_tag() end,
|
|
||||||
{description = "rename tag", group = "tag"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end,
|
|
||||||
{description = "move tag to the left", group = "tag"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end,
|
|
||||||
{description = "move tag to the right", group = "tag"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end,
|
|
||||||
{description = "delete tag", group = "tag"}),
|
|
||||||
|
|
||||||
-- Minimize, maximize, moving clients, fullscreen, etc
|
|
||||||
awful.key({ modkey, "Control" }, "n",
|
|
||||||
function ()
|
|
||||||
local c = awful.client.restore()
|
|
||||||
-- Focus restored client
|
|
||||||
if c then
|
|
||||||
client.focus = c
|
|
||||||
c:raise()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
{description = "restore minimized", group = "client"})
|
|
||||||
)
|
|
||||||
clientkeys = gears.table.join(
|
|
||||||
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end,
|
|
||||||
{description = "toggle fullscreen", group = "client"}),
|
|
||||||
awful.key({ modkey }, "q", function (c) c:kill() end,
|
|
||||||
{description = "close", group = "client"}),
|
|
||||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
|
|
||||||
{description = "toggle floating", group = "client"}),
|
|
||||||
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
|
||||||
{description = "move to master", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
|
||||||
{description = "move to screen", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
|
||||||
{description = "toggle keep on top", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "n",
|
|
||||||
function (c)
|
|
||||||
c.minimized = true
|
|
||||||
end ,
|
|
||||||
{description = "minimize", group = "client"}),
|
|
||||||
awful.key({ modkey, }, "m",
|
|
||||||
function (c)
|
|
||||||
c.maximized = not c.maximized
|
|
||||||
c:raise()
|
|
||||||
end ,
|
|
||||||
{description = "(un)maximize", group = "client"}),
|
|
||||||
awful.key({ modkey, "Control" }, "m",
|
|
||||||
function (c)
|
|
||||||
c.maximized_vertical = not c.maximized_vertical
|
|
||||||
c:raise()
|
|
||||||
end ,
|
|
||||||
{description = "(un)maximize vertically", group = "client"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "m",
|
|
||||||
function (c)
|
|
||||||
c.maximized_horizontal = not c.maximized_horizontal
|
|
||||||
c:raise()
|
|
||||||
end ,
|
|
||||||
{description = "(un)maximize horizontally", group = "client"})
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Bind all key numbers to tags.
|
|
||||||
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
|
||||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
|
||||||
for i = 1, 9 do
|
|
||||||
-- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
|
|
||||||
local descr_view, descr_toggle, descr_move, descr_toggle_focus
|
|
||||||
if i == 1 or i == 9 then
|
|
||||||
descr_view = {description = "view tag #", group = "tag"}
|
|
||||||
descr_toggle = {description = "toggle tag #", group = "tag"}
|
|
||||||
descr_move = {description = "move focused client to tag #", group = "tag"}
|
|
||||||
descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"}
|
|
||||||
end
|
|
||||||
globalkeys = my_table.join(globalkeys,
|
|
||||||
-- View tag only.
|
|
||||||
awful.key({ modkey }, "#" .. i + 9,
|
|
||||||
function ()
|
|
||||||
local screen = awful.screen.focused()
|
|
||||||
local tag = screen.tags[i]
|
|
||||||
if tag then
|
|
||||||
tag:view_only()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
descr_view),
|
|
||||||
-- Toggle tag display.
|
|
||||||
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
|
||||||
function ()
|
|
||||||
local screen = awful.screen.focused()
|
|
||||||
local tag = screen.tags[i]
|
|
||||||
if tag then
|
|
||||||
awful.tag.viewtoggle(tag)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
descr_toggle),
|
|
||||||
-- Move client to tag.
|
|
||||||
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
|
||||||
function ()
|
|
||||||
if client.focus then
|
|
||||||
local tag = client.focus.screen.tags[i]
|
|
||||||
if tag then
|
|
||||||
client.focus:move_to_tag(tag)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
descr_move),
|
|
||||||
-- Toggle tag on focused client.
|
|
||||||
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
|
||||||
function ()
|
|
||||||
if client.focus then
|
|
||||||
local tag = client.focus.screen.tags[i]
|
|
||||||
if tag then
|
|
||||||
client.focus:toggle_tag(tag)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
descr_toggle_focus)
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Other mouse bindings
|
|
||||||
clientbuttons = gears.table.join(
|
|
||||||
awful.button({ }, 1, function (c)
|
|
||||||
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
||||||
end),
|
|
||||||
awful.button({ modkey }, 1, function (c)
|
|
||||||
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
||||||
awful.mouse.client.move(c)
|
|
||||||
end),
|
|
||||||
awful.button({ modkey }, 3, function (c)
|
|
||||||
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
||||||
awful.mouse.client.resize(c)
|
|
||||||
end)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Set keys
|
|
||||||
root.keys(globalkeys)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
#+RESULTS:
|
|
||||||
|
|
||||||
* Rules
|
|
||||||
Here are the rules, so basically here you can specify how you want Awesomewm to manage clients. I edited this to make sure that my master client always stays in its default position, for example in the master and stack layout or "tile layout", it wont matter how much apps i open, my main client will stay there in the main position. Also you can edit this to specify wich apps needs to open always in floating mode and a bunch of other things.
|
|
||||||
#+begin_src lua
|
|
||||||
-- Rules to apply to new clients (through the "manage" signal).
|
|
||||||
awful.rules.rules = {
|
|
||||||
-- All clients will match this rule.
|
|
||||||
{ rule = { },
|
|
||||||
properties = { border_width = beautiful.border_width,
|
|
||||||
border_color = beautiful.border_normal,
|
|
||||||
focus = awful.client.focus.filter,
|
|
||||||
raise = true,
|
|
||||||
keys = clientkeys,
|
|
||||||
buttons = clientbuttons,
|
|
||||||
screen = awful.screen.preferred,
|
|
||||||
placement = awful.placement.no_overlap+awful.placement.no_offscreen,
|
|
||||||
callback = awful.client.setslave
|
|
||||||
}
|
|
||||||
},
|
|
||||||
-- Floating clients.
|
|
||||||
{ rule_any = {
|
|
||||||
instance = {
|
|
||||||
"DTA", -- Firefox addon DownThemAll.
|
|
||||||
"copyq", -- Includes session name in class.
|
|
||||||
"pinentry",
|
|
||||||
},
|
|
||||||
class = {
|
|
||||||
"Arandr",
|
|
||||||
"Blueman-manager",
|
|
||||||
"Gpick",
|
|
||||||
"Kruler",
|
|
||||||
"MessageWin", -- kalarm.
|
|
||||||
-- "Sxiv",
|
|
||||||
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
|
||||||
"Wpa_gui",
|
|
||||||
"veromix",
|
|
||||||
"xtightvncviewer"},
|
|
||||||
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
|
||||||
-- and the name shown there might not match defined rules here.
|
|
||||||
name = {
|
|
||||||
"Event Tester", -- xev.
|
|
||||||
},
|
|
||||||
role = {
|
|
||||||
"AlarmWindow", -- Thunderbird's calendar.
|
|
||||||
"ConfigManager", -- Thunderbird's about:config.
|
|
||||||
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
|
||||||
}
|
|
||||||
}, properties = { floating = true }},
|
|
||||||
}
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Signals
|
|
||||||
These are the signals, they are related to the rules, i don't tipically edit them.
|
|
||||||
#+begin_src lua
|
|
||||||
-- Signal function to execute when a new client appears.
|
|
||||||
client.connect_signal("manage", function (c)
|
|
||||||
-- Set the windows at the slave,
|
|
||||||
-- i.e. put it at the end of others instead of setting it master.
|
|
||||||
-- if not awesome.startup then awful.client.setslave(c) end
|
|
||||||
if awesome.startup and
|
|
||||||
not c.size_hints.user_position
|
|
||||||
and not c.size_hints.program_position then
|
|
||||||
-- Prevent clients from being unreachable after screen count changes.
|
|
||||||
awful.placement.no_offscreen(c)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Mouse client focus
|
|
||||||
These are the mouse functions to whenever you hover a window with your mouse, it automatically focuses it.
|
|
||||||
#+begin_src lua
|
|
||||||
-- Enable sloppy focus, so that focus follows mouse.
|
|
||||||
client.connect_signal("mouse::enter", function(c)
|
|
||||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
|
||||||
end)
|
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Autorun
|
|
||||||
You know what is this, the things that will open with you sign in. Like setting up the wallpaper automatically, or the polkit to make sure that you will get the password prompt when a program needs it, the picom compositor and finally the emacs daemon.
|
|
||||||
#+begin_src lua
|
|
||||||
awful.util.spawn_with_shell("nitrogen --restore")
|
|
||||||
awful.util.spawn_with_shell("lxpolkit")
|
|
||||||
awful.util.spawn_with_shell("picom --experimental-backend --config ~/.config/picom.conf")
|
|
||||||
awful.util.spawn_with_shell("/usr/bin/emacs --daemon &")
|
|
||||||
#+end_src
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
-- ____ ____ _ __
|
||||||
|
-- | _ \| _ \| |/ /
|
||||||
|
-- | | | | |_) | ' / Clay Gomera (Drake)
|
||||||
|
-- | |_| | _ <| . \ This is my awesome config for my dekstop computer
|
||||||
|
-- |____/|_| \_\_|\_\
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- BEGINNING OF LIBRARIES --
|
||||||
-- Standard awesome library
|
-- Standard awesome library
|
||||||
local gears = require("gears") --Utilities such as color parsing and objects
|
local gears = require("gears") --Utilities such as color parsing and objects
|
||||||
local awful = require("awful") --Everything related to window managment
|
local awful = require("awful") --Everything related to window managment
|
||||||
|
@ -16,12 +25,17 @@ local naughty = require("naughty")
|
||||||
naughty.config.defaults['icon_size'] = 100
|
naughty.config.defaults['icon_size'] = 100
|
||||||
-- Lain library
|
-- Lain library
|
||||||
local lain = require("lain")
|
local lain = require("lain")
|
||||||
|
-- END OF LIBRARIES --
|
||||||
|
|
||||||
|
-- BEGINNING OF VIM HOTKEYS --
|
||||||
-- Enable hotkeys help widget for VIM and other apps
|
-- Enable hotkeys help widget for VIM and other apps
|
||||||
-- when client with a matching name is opened:
|
-- when client with a matching name is opened:
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
||||||
require("awful.hotkeys_popup.keys")
|
require("awful.hotkeys_popup.keys")
|
||||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||||
|
-- END OF VIM HOTKEYS --
|
||||||
|
|
||||||
|
-- BEGINNNG OF ERROR HANDLING --
|
||||||
if awesome.startup_errors then
|
if awesome.startup_errors then
|
||||||
naughty.notify({ preset = naughty.config.presets.critical,
|
naughty.notify({ preset = naughty.config.presets.critical,
|
||||||
title = "Oops, there were errors during startup!",
|
title = "Oops, there were errors during startup!",
|
||||||
|
@ -44,7 +58,9 @@ local function run_once(cmd_arr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
||||||
|
-- END OF ERROR HANDLING --
|
||||||
|
|
||||||
|
-- BEGINNIG OF THEMES --
|
||||||
local themes = {
|
local themes = {
|
||||||
"gruvbox-dark" -- 1
|
"gruvbox-dark" -- 1
|
||||||
}
|
}
|
||||||
|
@ -52,7 +68,9 @@ local chosen_theme = themes[1]
|
||||||
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
||||||
beautiful.init(theme_path)
|
beautiful.init(theme_path)
|
||||||
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
||||||
|
-- END OF THEMES --
|
||||||
|
|
||||||
|
-- BEGINNING OF LAYOUTS
|
||||||
awful.layout.suit.tile.left.mirror = true
|
awful.layout.suit.tile.left.mirror = true
|
||||||
awful.layout.layouts = {
|
awful.layout.layouts = {
|
||||||
awful.layout.suit.tile,
|
awful.layout.suit.tile,
|
||||||
|
@ -78,7 +96,6 @@ awful.layout.layouts = {
|
||||||
--lain.layout.termfair,
|
--lain.layout.termfair,
|
||||||
--lain.layout.termfair.center,
|
--lain.layout.termfair.center,
|
||||||
}
|
}
|
||||||
|
|
||||||
lain.layout.termfair.nmaster = 3
|
lain.layout.termfair.nmaster = 3
|
||||||
lain.layout.termfair.ncol = 1
|
lain.layout.termfair.ncol = 1
|
||||||
lain.layout.termfair.center.nmaster = 3
|
lain.layout.termfair.center.nmaster = 3
|
||||||
|
@ -88,34 +105,54 @@ lain.layout.cascade.tile.offset_y = 32
|
||||||
lain.layout.cascade.tile.extra_padding = 5
|
lain.layout.cascade.tile.extra_padding = 5
|
||||||
lain.layout.cascade.tile.nmaster = 5
|
lain.layout.cascade.tile.nmaster = 5
|
||||||
lain.layout.cascade.tile.ncol = 2
|
lain.layout.cascade.tile.ncol = 2
|
||||||
|
-- END OF LAYOUTS --
|
||||||
|
|
||||||
|
-- BEGINNING OF VARIABLES --
|
||||||
awful.util.terminal = terminal
|
awful.util.terminal = terminal
|
||||||
|
-- Terminal
|
||||||
local emacs = "emacsclient -c -a 'emacs'"
|
|
||||||
local spacevim = os.getenv("EDITOR") or "neovide"
|
|
||||||
local terminal = "alacritty"
|
local terminal = "alacritty"
|
||||||
local filemanager = "alacritty -e ./.config/vifm/scripts/vifmrun"
|
-- Standard Apps
|
||||||
local filemanagergui = "pcmanfm"
|
local code = "emacsclient -c -a emacs"
|
||||||
local audiomixer = "alacritty -e pulsemixer"
|
local file = "alacritty -e ./.config/vifm/scripts/vifmrun"
|
||||||
local audiomixer2 = "alacritty -e alsamixer"
|
local web = "firefox"
|
||||||
local browser = "librewolf"
|
local chat = "element-desktop"
|
||||||
local browser2 = "qutebrowser"
|
local music = "alacritty -e musikcube"
|
||||||
local musicplayer = "alacritty -e musikcube"
|
local notes = "zim"
|
||||||
local musicplayergui = "lollypop"
|
local games = "retroarch"
|
||||||
local emailclient = "thunderbird"
|
-- Specific Apps
|
||||||
local chat1 = "element-desktop"
|
local libreoffice = "libreoffice"
|
||||||
local chat2 = "whatsapp-for-linux"
|
local gimp = "gimp"
|
||||||
local notes = "joplin-desktop"
|
local inkscape = "inkscape"
|
||||||
local passwords = "bitwarden-desktop"
|
local krita = "krita"
|
||||||
local screenlocker = "betterlockscreen -l"
|
local audacity = "audacity"
|
||||||
|
local obs = "obs"
|
||||||
|
local thunderbird = "thunderbird"
|
||||||
|
local transmission = "transmission-gtk"
|
||||||
|
local pavucontrol = "pavucontrol"
|
||||||
-- Key bindings variables
|
-- Key bindings variables
|
||||||
local modkey = "Mod4"
|
local modkey = "Mod4"
|
||||||
local altkey = "Mod1"
|
local altkey = "Mod1"
|
||||||
local modkey1 = "Control"
|
local modkey1 = "Control"
|
||||||
|
-- screenlocker
|
||||||
|
local screenlocker = "betterlockscreen -l"
|
||||||
|
-- END OF VARIABLES --
|
||||||
|
|
||||||
awful.util.tagnames = { " CODE ", " WEB ", " MUSIC ", " CHAT ", " FILE ", " NOTES ", " WORK1 ", " WORK2 ", " GAME " }
|
-- BEGINNING OF TAG NAMES --
|
||||||
|
awful.util.tagnames =
|
||||||
|
{
|
||||||
|
" CODE ", -- F1
|
||||||
|
" FILE ", -- F2
|
||||||
|
" WEB ", -- F3
|
||||||
|
" CHAT ", -- F4
|
||||||
|
" MUSIC ", -- F5
|
||||||
|
" NOTES ", -- F6
|
||||||
|
" WORK ", -- XX
|
||||||
|
" EXTRA ", -- XX
|
||||||
|
" GAMES " -- F9
|
||||||
|
}
|
||||||
|
-- END OF TAG NAMES --
|
||||||
|
|
||||||
|
-- BEGINNIG OF WIBOX STUFF --
|
||||||
awful.util.taglist_buttons = my_table.join(
|
awful.util.taglist_buttons = my_table.join(
|
||||||
awful.button({ }, 1, function(t) t:view_only() end),
|
awful.button({ }, 1, function(t) t:view_only() end),
|
||||||
awful.button({ modkey }, 1, function(t)
|
awful.button({ modkey }, 1, function(t)
|
||||||
|
@ -165,61 +202,51 @@ screen.connect_signal("property::geometry", function(s)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
|
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
|
||||||
|
-- END OF WIBOX STUFF --
|
||||||
|
|
||||||
-- Mouse bindings
|
-- BEGINNIG OF BINDINGS --
|
||||||
root.buttons(gears.table.join(
|
|
||||||
awful.button({ }, 4, awful.tag.viewnext),
|
|
||||||
awful.button({ }, 5, awful.tag.viewprev)
|
|
||||||
))
|
|
||||||
|
|
||||||
-- Awesome things
|
-- Awesome things
|
||||||
globalkeys = my_table.join(
|
globalkeys = my_table.join(
|
||||||
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
||||||
{description="show help", group="awesome"}),
|
{description="Show this help menu", group="Quick Actions"}),
|
||||||
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
||||||
{description = "reload awesome", group = "awesome"}),
|
{description = "Reload WM", group = "Quick Actions"}),
|
||||||
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
||||||
{description = "quit awesome", group = "awesome"}),
|
{description = "Log Out", group = "Quick Actions"}),
|
||||||
|
|
||||||
-- Tag browsing arrow keys and escape
|
-- Tag browsing arrow keys and escape
|
||||||
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
||||||
{description = "view previous", group = "tag"}),
|
{description = "view previous", group = "Tag"}),
|
||||||
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
||||||
{description = "view next", group = "tag"}),
|
{description = "view next", group = "Tag"}),
|
||||||
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
|
||||||
{description = "go back", group = "tag"}),
|
{description = "go back", group = "Tag"}),
|
||||||
|
|
||||||
-- Tag browsing alt + tab
|
-- Tag browsing alt + tab
|
||||||
awful.key({ altkey, }, "Tab", awful.tag.viewnext,
|
awful.key({ altkey, }, "Tab", awful.tag.viewnext,
|
||||||
{description = "view next", group = "tag"}),
|
{description = "view next", group = "Tag"}),
|
||||||
awful.key({ altkey, "Shift" }, "Tab", awful.tag.viewprev,
|
awful.key({ altkey, "Shift" }, "Tab", awful.tag.viewprev,
|
||||||
{description = "view previous", group = "tag"}),
|
{description = "view previous", group = "Tag"}),
|
||||||
|
|
||||||
-- Copy primary to clipboard (terminals to gtk)
|
-- Copy primary to clipboard (terminals to gtk)
|
||||||
awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
|
awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
|
||||||
{description = "copy terminal to gtk", group = "hotkeys"}),
|
{description = "Copy terminal to gtk", group = "Hotkeys"}),
|
||||||
|
|
||||||
-- Copy clipboard to primary (gtk to terminals)
|
-- Copy clipboard to primary (gtk to terminals)
|
||||||
awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
|
awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
|
||||||
{description = "copy gtk to terminal", group = "hotkeys"}),
|
{description = "Copy gtk to terminal", group = "Hotkeys"}),
|
||||||
|
|
||||||
-- Client focus
|
-- Client focus
|
||||||
awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end,
|
awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end,
|
||||||
{description = "focus next by index", group = "client"}),
|
{description = "Focus next by index", group = "Client"}),
|
||||||
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end,
|
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end,
|
||||||
{description = "focus previous by index", group = "client"}),
|
{description = "Focus previous by index", group = "Client"}),
|
||||||
|
|
||||||
-- Layout manipulation
|
-- Layout manipulation
|
||||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
||||||
{description = "swap with next client by index", group = "client"}),
|
{description = "Swap with next client by index", group = "Client"}),
|
||||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
||||||
{description = "swap with previous client by index", group = "client"}),
|
{description = "Swap with previous client by index", group = "Client"}),
|
||||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
||||||
{description = "focus the next screen", group = "screen"}),
|
{description = "Focus the next screen", group = "Screen"}),
|
||||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
||||||
{description = "focus the previous screen", group = "screen"}),
|
{description = "Focus the previous screen", group = "Screen"}),
|
||||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
||||||
{description = "jump to urgent client", group = "client"}),
|
{description = "Jump to urgent client", group = "Cient"}),
|
||||||
awful.key({ modkey, }, "Tab",
|
awful.key({ modkey, }, "Tab",
|
||||||
function ()
|
function ()
|
||||||
awful.client.focus.history.previous()
|
awful.client.focus.history.previous()
|
||||||
|
@ -227,116 +254,117 @@ globalkeys = my_table.join(
|
||||||
client.focus:raise()
|
client.focus:raise()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{description = "go back", group = "client"}),
|
{description = "Go back", group = "client"}),
|
||||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
||||||
{description = "increase master width factor", group = "layout"}),
|
{description = "Increase master width factor", group = "Layout"}),
|
||||||
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
||||||
{description = "decrease master width factor", group = "layout"}),
|
{description = "Decrease master width factor", group = "Layout"}),
|
||||||
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
||||||
{description = "increase the number of master clients", group = "layout"}),
|
{description = "Increase the number of master clients", group = "Layout"}),
|
||||||
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
||||||
{description = "decrease the number of master clients", group = "layout"}),
|
{description = "Decrease the number of master clients", group = "Layout"}),
|
||||||
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
||||||
{description = "increase the number of columns", group = "layout"}),
|
{description = "Increase the number of columns", group = "Layout"}),
|
||||||
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
||||||
{description = "decrease the number of columns", group = "layout"}),
|
{description = "Decrease the number of columns", group = "Layout"}),
|
||||||
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
||||||
{description = "select next", group = "layout"}),
|
{description = "Select next", group = "Layout"}),
|
||||||
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
||||||
{description = "select previous", group = "layout"}),
|
{description = "Select previous", group = "Layout"}),
|
||||||
|
|
||||||
-- Terminal
|
-- Terminal
|
||||||
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
|
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
|
||||||
{description = "launch a terminal", group = "apps"}),
|
{description = "Launch a terminal", group = "Hotkeys"}),
|
||||||
|
-- Dmenu
|
||||||
-- Rofi
|
awful.key({ modkey }, "r", function () awful.util.spawn_with_shell("dmenu_run -l 10 -b -i -p Launch:") end,
|
||||||
awful.key({ modkey }, "d", function () awful.spawn(string.format("rofi -show drun", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
{description = "Show Run Launcher", group = "Hotkeys"}),
|
||||||
{description = "show rofi drun menu", group = "hotkeys"}),
|
awful.key({ modkey }, "d", function () awful.util.spawn_with_shell("sh $HOME/.config/scripts/dmenu-drun.sh") end,
|
||||||
awful.key({ modkey }, "r", function () awful.spawn(string.format("rofi -show run", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
{description = "Show App Launcher", group = "Hotkeys"}),
|
||||||
{description = "show rofi run menu", group = "hotkeys"}),
|
awful.key({ modkey }, "w", function () awful.util.spawn_with_shell("sh $HOME/.config/scripts/dmenu-wifi.sh") end,
|
||||||
awful.key({ modkey }, "Tab", function () awful.spawn(string.format("rofi -show window", beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus)) end,
|
{description = "Configure WiFi", group = "Hotkeys"}),
|
||||||
{description = "show rofi window menu", group = "hotkeys"}),
|
awful.key({ modkey, modkey1 }, "q", function () awful.util.spawn_with_shell("sh $HOME/.config/scripts/dmenu-power.sh") end,
|
||||||
awful.key({ modkey }, "w", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-wifi-menu.sh") end,
|
{description = "Show Logout menu", group = "Hotkeys"}),
|
||||||
{description = "show rofi wifi menu", group = "hotkeys"}),
|
awful.key({ modkey, modkey1 }, "w", function () awful.util.spawn_with_shell("sh $HOME/.config/scripts/dmenu-wall.sh") end,
|
||||||
awful.key({ modkey, altkey }, "Delete", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-power-menu.sh") end,
|
{description = "Show Logout menu", group = "Hotkeys"}),
|
||||||
{description = "show rofi power menu", group = "hotkeys"}),
|
awful.key({}, "Print", function () awful.util.spawn_with_shell("sh $HOME/.config/scripts/dmenu-scrot.sh") end,
|
||||||
awful.key({ modkey, altkey }, "Print", function () awful.util.spawn("/home/drk/.shell-scripts/./rofi-scrot-menu.sh") end,
|
{description = "Take screenshots", group = "Hotkeys"}),
|
||||||
{description = "show rofi scrot menu", group = "hotkeys"}),
|
|
||||||
|
|
||||||
-- Keyboard Layouts
|
-- Keyboard Layouts
|
||||||
awful.key({ modkey, "Shift" }, "e", function () awful.util.spawn("setxkbmap -layout es") end,
|
awful.key({ modkey, "Shift" }, "e", function () awful.util.spawn("setxkbmap -layout es") end,
|
||||||
{description = "switch to es keyboard layout", group = "keyboard"}),
|
{description = "Switch to ES keyboard layout", group = "Quick Actions"}),
|
||||||
awful.key({ modkey, "Shift" }, "u", function () awful.util.spawn("setxkbmap -layout us") end,
|
awful.key({ modkey, "Shift" }, "u", function () awful.util.spawn("setxkbmap -layout us") end,
|
||||||
{description = "switch to us keyboard layout", group = "keyboard"}),
|
{description = "Switch to US keyboard layout", group = "Quick Actions"}),
|
||||||
|
|
||||||
-- Apps
|
-- Apps
|
||||||
-- code
|
-- code
|
||||||
awful.key({ modkey }, "F1", function () awful.spawn(emacs) end,
|
awful.key({ modkey }, "F1", function () awful.spawn(code) end,
|
||||||
{description = "launch emacs", group = "apps"}),
|
{description = "Launch text editor", group = "Standard Apps"}),
|
||||||
awful.key({ modkey, "Shift" }, "F1", function () awful.spawn(spacevim) end,
|
|
||||||
{description = "launch spacevim", group = "apps"}),
|
|
||||||
-- web
|
|
||||||
awful.key({ modkey }, "F2", function () awful.spawn(browser) end,
|
|
||||||
{description = "launch firefox", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F2", function () awful.spawn(browser2) end,
|
|
||||||
{description = "launch qutebrowser", group = "apps"}),
|
|
||||||
-- music
|
|
||||||
awful.key({ modkey }, "F3", function () awful.spawn(musicplayer) end,
|
|
||||||
{description = "launch musikcube", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F3", function () awful.spawn(musicplayergui) end,
|
|
||||||
{description = "launch lollypop", group = "apps"}),
|
|
||||||
-- chat
|
|
||||||
awful.key({ modkey }, "F4", function () awful.spawn(chat1) end,
|
|
||||||
{description = "launch element", group = "apps"}),
|
|
||||||
awful.key({ modkey, "Shift" }, "F4", function () awful.spawn(chat2) end,
|
|
||||||
{description = "launch whatsapp", group = "apps"}),
|
|
||||||
-- file
|
-- file
|
||||||
awful.key({ modkey }, "F5", function () awful.spawn(filemanager) end,
|
awful.key({ modkey }, "F2", function () awful.spawn(file) end,
|
||||||
{description = "launch vifm", group = "apps"}),
|
{description = "Launch file manager", group = "Standard Apps"}),
|
||||||
awful.key({ modkey, "Shift" }, "F5", function () awful.spawn(filemanagergui) end,
|
-- web
|
||||||
{description = "launch pcmanfm", group = "apps"}),
|
awful.key({ modkey }, "F3", function () awful.spawn(web) end,
|
||||||
|
{description = "Launch web browser", group = "Standard Apps"}),
|
||||||
|
-- chat
|
||||||
|
awful.key({ modkey }, "F4", function () awful.spawn(chat) end,
|
||||||
|
{description = "Launch chat app", group = "Standard Apps"}),
|
||||||
|
-- music
|
||||||
|
awful.key({ modkey }, "F5", function () awful.spawn(music) end,
|
||||||
|
{description = "Launch music player", group = "Standard Apps"}),
|
||||||
-- notes
|
-- notes
|
||||||
awful.key({ modkey }, "F6", function () awful.spawn(notes) end,
|
awful.key({ modkey }, "F6", function () awful.spawn(notes) end,
|
||||||
{description = "launch joplin", group = "apps"}),
|
{description = "Launch note taking app", group = "Standard Apps"}),
|
||||||
-- tag agnostic
|
-- games
|
||||||
awful.key({ modkey, "Shift" }, "m", function () awful.spawn(audiomixer) end,
|
awful.key({ modkey }, "F9", function () awful.util.spawn(games) end,
|
||||||
{description = "launch pulsemixer", group = "apps"}),
|
{description = "Launch gaming app", group = "Standard Apps"}),
|
||||||
awful.key({ modkey, altkey }, "m", function () awful.spawn(audiomixer2) end,
|
-- Specific Apps
|
||||||
{description = "launch alsamixer", group = "apps"}),
|
-- libreoffice
|
||||||
awful.key({ modkey, altkey }, "p", function () awful.spawn(passwords) end,
|
awful.key({ modkey, modkey1 }, "F1", function () awful.spawn(libreoffice) end,
|
||||||
{description = "launch bitwarden", group = "apps"}),
|
{description = "Launch libreoffice", group = "Specific Apps"}),
|
||||||
-- game
|
-- gimp
|
||||||
awful.key({ modkey }, "F9", function () awful.util.spawn("retroarch") end,
|
awful.key({ modkey, modkey1 }, "F2", function () awful.spawn(gimp) end,
|
||||||
{description = "launch retroarch", group = "apps"}),
|
{description = "Launch gimp", group = "Specific Apps"}),
|
||||||
|
-- inkscape
|
||||||
-- Volume Control
|
awful.key({ modkey, modkey1 }, "F3", function () awful.spawn(inkscape) end,
|
||||||
|
{description = "Launch inkscape", group = "Specific Apps"}),
|
||||||
|
-- krita
|
||||||
|
awful.key({ modkey, modkey1 }, "F4", function () awful.spawn(krita) end,
|
||||||
|
{description = "Launch krita", group = "Specific Apps"}),
|
||||||
|
-- audacity
|
||||||
|
awful.key({ modkey, modkey1 }, "F5", function () awful.spawn(audacity) end,
|
||||||
|
{description = "Launch audacity", group = "Specific Apps"}),
|
||||||
|
-- obs
|
||||||
|
awful.key({ modkey, modkey1 }, "F6", function () awful.spawn(obs) end,
|
||||||
|
{description = "Launch obs", group = "Specific Apps"}),
|
||||||
|
-- sylpheed
|
||||||
|
awful.key({ modkey, modkey1 }, "F7", function () awful.spawn(thunderbird) end,
|
||||||
|
{description = "Launch sylpheed", group = "Specific Apps"}),
|
||||||
|
-- transmission
|
||||||
|
awful.key({ modkey, modkey1 }, "F8", function () awful.spawn(transmission) end,
|
||||||
|
{description = "Launch transmission", group = "Specific Apps"}),
|
||||||
|
-- pavucontrol
|
||||||
|
awful.key({ modkey, modkey1 }, "F9", function () awful.spawn(pavucontrol) end,
|
||||||
|
{description = "Launch pavucontrol", group = "Specific Apps"}),
|
||||||
|
-- Volume
|
||||||
awful.key({}, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end,
|
awful.key({}, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end,
|
||||||
{description = "increase volume", group = "volume"}),
|
{description = "Increase volume", group = "Quick Actions"}),
|
||||||
awful.key({}, "XF86AudioLowerVolume", function() volume_widget:dec(5) end,
|
awful.key({}, "XF86AudioLowerVolume", function() volume_widget:dec(5) end,
|
||||||
{description = "decrease volume", group = "volume"}),
|
{description = "Decrease volume", group = "Quick Actions"}),
|
||||||
awful.key({}, "XF86AudioMute", function() volume_widget:toggle() end,
|
awful.key({}, "XF86AudioMute", function() volume_widget:toggle() end,
|
||||||
{description = "mute volume", group = "volume"}),
|
{description = "Mute volume", group = "Quick Actions"}),
|
||||||
|
|
||||||
-- Screenshot
|
|
||||||
awful.key({}, "Print", function() awful.util.spawn("scrot") end,
|
|
||||||
{description = "take a complete screenshot", group = "screenshot"}),
|
|
||||||
awful.key({"Control"}, "Print", function() awful.util.spawn("scrot -s") end,
|
|
||||||
{description = "take an area screenshot", group = "screenshot"}),
|
|
||||||
|
|
||||||
-- Brightness
|
-- Brightness
|
||||||
awful.key({}, "XF86MonBrightnessUp", function () brightness_widget:inc(5) end,
|
awful.key({}, "XF86MonBrightnessUp", function () brightness_widget:inc(5) end,
|
||||||
{description = "increase brightness", group = "brightness"}),
|
{description = "Increase brightness", group = "Quick Actions"}),
|
||||||
awful.key({}, "XF86MonBrightnessDown", function () brightness_widget:dec(5) end,
|
awful.key({}, "XF86MonBrightnessDown", function () brightness_widget:dec(5) end,
|
||||||
{description = "decrease brightness", group = "brightness"}),
|
{description = "Decrease brightness", group = "Quick Actions"}),
|
||||||
|
-- Screenshots
|
||||||
-- Screen configuration
|
awful.key({ modkey }, "Print", function() awful.util.spawn("scrot") end,
|
||||||
|
{description = "Take a screenshot (Complete screen mode)", group = "Quick Actions"}),
|
||||||
|
awful.key({ modkey, modkey1 }, "Print", function() awful.util.spawn("scrot -s") end,
|
||||||
|
{description = "Take a screenshot (Area selection mode)", group = "Quick Actions"}),
|
||||||
|
-- Screen configuration tool
|
||||||
awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end,
|
awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end,
|
||||||
{description = "launch screen configuration tool", group = ("screen")}),
|
{description = "Launch screen configuration tool", group = ("Quick Actions")}),
|
||||||
|
-- Screenlocker
|
||||||
-- Screen Lock
|
|
||||||
awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end,
|
awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end,
|
||||||
{description = "lock the screen", group = "screen"}),
|
{description = "Lock the screen", group = "Quick Actions"}),
|
||||||
|
|
||||||
-- Show/Hide Wibox
|
-- Show/Hide Wibox
|
||||||
awful.key({ modkey }, "b", function ()
|
awful.key({ modkey }, "b", function ()
|
||||||
for s in screen do
|
for s in screen do
|
||||||
|
@ -346,26 +374,23 @@ globalkeys = my_table.join(
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{description = "toggle wibox", group = "awesome"}),
|
{description = "Toggle wibox", group = "Quick Actions"}),
|
||||||
|
|
||||||
-- On the fly useless gaps change
|
-- On the fly useless gaps change
|
||||||
awful.key({ altkey, "Control" }, "j", function () lain.util.useless_gaps_resize(1) end,
|
awful.key({ altkey, "Control" }, "j", function () lain.util.useless_gaps_resize(1) end,
|
||||||
{description = "increment gaps", group = "tag"}),
|
{description = "Increment gaps", group = "Tag"}),
|
||||||
awful.key({ altkey, "Control" }, "l", function () lain.util.useless_gaps_resize(-1) end,
|
awful.key({ altkey, "Control" }, "l", function () lain.util.useless_gaps_resize(-1) end,
|
||||||
{description = "decrement gaps", group = "tag"}),
|
{description = "Decrement gaps", group = "Tag"}),
|
||||||
|
|
||||||
-- Dynamic tagging
|
-- Dynamic tagging
|
||||||
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end,
|
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end,
|
||||||
{description = "add new tag", group = "tag"}),
|
{description = "Add new tag", group = "Tag"}),
|
||||||
awful.key({ modkey, "Control" }, "r", function () lain.util.rename_tag() end,
|
awful.key({ modkey, "Control" }, "r", function () lain.util.rename_tag() end,
|
||||||
{description = "rename tag", group = "tag"}),
|
{description = "Rename tag", group = "Tag"}),
|
||||||
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end,
|
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end,
|
||||||
{description = "move tag to the left", group = "tag"}),
|
{description = "Move tag to the left", group = "Tag"}),
|
||||||
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end,
|
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end,
|
||||||
{description = "move tag to the right", group = "tag"}),
|
{description = "Move tag to the right", group = "Tag"}),
|
||||||
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end,
|
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end,
|
||||||
{description = "delete tag", group = "tag"}),
|
{description = "Delete tag", group = "Tag"}),
|
||||||
|
|
||||||
-- Minimize, maximize, moving clients, fullscreen, etc
|
-- Minimize, maximize, moving clients, fullscreen, etc
|
||||||
awful.key({ modkey, "Control" }, "n",
|
awful.key({ modkey, "Control" }, "n",
|
||||||
function ()
|
function ()
|
||||||
|
@ -376,46 +401,45 @@ globalkeys = my_table.join(
|
||||||
c:raise()
|
c:raise()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{description = "restore minimized", group = "client"})
|
{description = "Restore minimized", group = "Client"})
|
||||||
)
|
)
|
||||||
clientkeys = gears.table.join(
|
clientkeys = gears.table.join(
|
||||||
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end,
|
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end,
|
||||||
{description = "toggle fullscreen", group = "client"}),
|
{description = "Toggle fullscreen", group = "Client"}),
|
||||||
awful.key({ modkey }, "q", function (c) c:kill() end,
|
awful.key({ modkey }, "q", function (c) c:kill() end,
|
||||||
{description = "close", group = "client"}),
|
{description = "Close window", group = "Client"}),
|
||||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
|
||||||
{description = "toggle floating", group = "client"}),
|
{description = "Toggle floating", group = "Client"}),
|
||||||
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
||||||
{description = "move to master", group = "client"}),
|
{description = "Move to master", group = "Client"}),
|
||||||
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
||||||
{description = "move to screen", group = "client"}),
|
{description = "Move to screen", group = "Client"}),
|
||||||
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
||||||
{description = "toggle keep on top", group = "client"}),
|
{description = "Toggle keep on top", group = "Client"}),
|
||||||
awful.key({ modkey, }, "n",
|
awful.key({ modkey, }, "n",
|
||||||
function (c)
|
function (c)
|
||||||
c.minimized = true
|
c.minimized = true
|
||||||
end ,
|
end ,
|
||||||
{description = "minimize", group = "client"}),
|
{description = "Minimize", group = "Client"}),
|
||||||
awful.key({ modkey, }, "m",
|
awful.key({ modkey, }, "m",
|
||||||
function (c)
|
function (c)
|
||||||
c.maximized = not c.maximized
|
c.maximized = not c.maximized
|
||||||
c:raise()
|
c:raise()
|
||||||
end ,
|
end ,
|
||||||
{description = "(un)maximize", group = "client"}),
|
{description = "(Un)maximize", group = "Client"}),
|
||||||
awful.key({ modkey, "Control" }, "m",
|
awful.key({ modkey, "Control" }, "m",
|
||||||
function (c)
|
function (c)
|
||||||
c.maximized_vertical = not c.maximized_vertical
|
c.maximized_vertical = not c.maximized_vertical
|
||||||
c:raise()
|
c:raise()
|
||||||
end ,
|
end ,
|
||||||
{description = "(un)maximize vertically", group = "client"}),
|
{description = "(Un)maximize vertically", group = "Client"}),
|
||||||
awful.key({ modkey, "Shift" }, "m",
|
awful.key({ modkey, "Shift" }, "m",
|
||||||
function (c)
|
function (c)
|
||||||
c.maximized_horizontal = not c.maximized_horizontal
|
c.maximized_horizontal = not c.maximized_horizontal
|
||||||
c:raise()
|
c:raise()
|
||||||
end ,
|
end ,
|
||||||
{description = "(un)maximize horizontally", group = "client"})
|
{description = "(Un)maximize horizontally", group = "Client"})
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Bind all key numbers to tags.
|
-- Bind all key numbers to tags.
|
||||||
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||||
|
@ -423,10 +447,10 @@ for i = 1, 9 do
|
||||||
-- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
|
-- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
|
||||||
local descr_view, descr_toggle, descr_move, descr_toggle_focus
|
local descr_view, descr_toggle, descr_move, descr_toggle_focus
|
||||||
if i == 1 or i == 9 then
|
if i == 1 or i == 9 then
|
||||||
descr_view = {description = "view tag #", group = "tag"}
|
descr_view = {description = "Wiew tag #", group = "Tag"}
|
||||||
descr_toggle = {description = "toggle tag #", group = "tag"}
|
descr_toggle = {description = "Toggle tag #", group = "Tag"}
|
||||||
descr_move = {description = "move focused client to tag #", group = "tag"}
|
descr_move = {description = "Move focused client to tag #", group = "Tag"}
|
||||||
descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"}
|
descr_toggle_focus = {description = "Toggle focused client on tag #", group = "Tag"}
|
||||||
end
|
end
|
||||||
globalkeys = my_table.join(globalkeys,
|
globalkeys = my_table.join(globalkeys,
|
||||||
-- View tag only.
|
-- View tag only.
|
||||||
|
@ -473,7 +497,6 @@ for i = 1, 9 do
|
||||||
descr_toggle_focus)
|
descr_toggle_focus)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Other mouse bindings
|
-- Other mouse bindings
|
||||||
clientbuttons = gears.table.join(
|
clientbuttons = gears.table.join(
|
||||||
awful.button({ }, 1, function (c)
|
awful.button({ }, 1, function (c)
|
||||||
|
@ -488,10 +511,11 @@ clientbuttons = gears.table.join(
|
||||||
awful.mouse.client.resize(c)
|
awful.mouse.client.resize(c)
|
||||||
end)
|
end)
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Set keys
|
-- Set keys
|
||||||
root.keys(globalkeys)
|
root.keys(globalkeys)
|
||||||
|
-- END OF BINDINGS --
|
||||||
|
|
||||||
|
-- BEGINNING OF RULES --
|
||||||
-- Rules to apply to new clients (through the "manage" signal).
|
-- Rules to apply to new clients (through the "manage" signal).
|
||||||
awful.rules.rules = {
|
awful.rules.rules = {
|
||||||
-- All clients will match this rule.
|
-- All clients will match this rule.
|
||||||
|
@ -537,7 +561,9 @@ awful.rules.rules = {
|
||||||
}
|
}
|
||||||
}, properties = { floating = true }},
|
}, properties = { floating = true }},
|
||||||
}
|
}
|
||||||
|
-- END OF RULES --
|
||||||
|
|
||||||
|
-- BEGINNING OF SIGNALS --
|
||||||
-- Signal function to execute when a new client appears.
|
-- Signal function to execute when a new client appears.
|
||||||
client.connect_signal("manage", function (c)
|
client.connect_signal("manage", function (c)
|
||||||
-- Set the windows at the slave,
|
-- Set the windows at the slave,
|
||||||
|
@ -550,15 +576,20 @@ client.connect_signal("manage", function (c)
|
||||||
awful.placement.no_offscreen(c)
|
awful.placement.no_offscreen(c)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
-- END OF SIGNALS --
|
||||||
|
|
||||||
|
-- BEGINNING OF MOUSE FOCUS SETTINGS --
|
||||||
-- Enable sloppy focus, so that focus follows mouse.
|
-- Enable sloppy focus, so that focus follows mouse.
|
||||||
client.connect_signal("mouse::enter", function(c)
|
client.connect_signal("mouse::enter", function(c)
|
||||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||||
end)
|
end)
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
-- END OF MOUSE FOCUS SETTINGS --
|
||||||
|
|
||||||
awful.util.spawn_with_shell("nitrogen --restore")
|
-- BEGINNING OF AUTOSTART --
|
||||||
awful.util.spawn_with_shell("lxpolkit")
|
awful.util.spawn_with_shell("sh $HOME/.fehbg &")
|
||||||
awful.util.spawn_with_shell("picom --experimental-backend --config ~/.config/picom.conf")
|
awful.util.spawn_with_shell("lxpolkit &")
|
||||||
|
awful.util.spawn_with_shell("picom --config ~/.config/picom.conf &")
|
||||||
awful.util.spawn_with_shell("/usr/bin/emacs --daemon &")
|
awful.util.spawn_with_shell("/usr/bin/emacs --daemon &")
|
||||||
|
-- END OF AUTOSTART --
|
||||||
|
|
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 1.3 MiB |
|
@ -102,7 +102,8 @@ Open the eshell (SPC e s)\
|
||||||
\nOpen dired file manager (SPC d d) \
|
\nOpen dired file manager (SPC d d) \
|
||||||
List of keybindings (SPC h b b)")
|
List of keybindings (SPC h b b)")
|
||||||
;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
|
;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
|
||||||
(setq dashboard-startup-banner "~/.doom.d/doom-emacs-dash.png") ;; use custom image as banner
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
||||||
|
(setq dashboard-startup-banner "~/.config/doom/emacs-dash.txt") ;; use custom image as banner
|
||||||
(setq dashboard-center-content nil) ;; set to 't' for centered content
|
(setq dashboard-center-content nil) ;; set to 't' for centered content
|
||||||
(setq dashboard-items '((recents . 5)
|
(setq dashboard-items '((recents . 5)
|
||||||
(agenda . 5 )
|
(agenda . 5 )
|
|
@ -224,7 +224,8 @@ Open the eshell (SPC e s)\
|
||||||
\nOpen dired file manager (SPC d d) \
|
\nOpen dired file manager (SPC d d) \
|
||||||
List of keybindings (SPC h b b)")
|
List of keybindings (SPC h b b)")
|
||||||
;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
|
;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
|
||||||
(setq dashboard-startup-banner "~/.doom.d/doom-emacs-dash.png") ;; use custom image as banner
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
||||||
|
(setq dashboard-startup-banner "~/.config/doom/emacs-dash.txt") ;; use custom image as banner
|
||||||
(setq dashboard-center-content nil) ;; set to 't' for centered content
|
(setq dashboard-center-content nil) ;; set to 't' for centered content
|
||||||
(setq dashboard-items '((recents . 5)
|
(setq dashboard-items '((recents . 5)
|
||||||
(agenda . 5 )
|
(agenda . 5 )
|
10
.config/doom/emacs-dash.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
__/\\\\\\\\\\\\_______/\\\\\\\\\______/\\\________/\\\_
|
||||||
|
_\/\\\////////\\\___/\\\///////\\\___\/\\\_____/\\\//__
|
||||||
|
_\/\\\______\//\\\_\/\\\_____\/\\\___\/\\\__/\\\//_____
|
||||||
|
_\/\\\_______\/\\\_\/\\\\\\\\\\\/____\/\\\\\\//\\\_____
|
||||||
|
_\/\\\_______\/\\\_\/\\\//////\\\____\/\\\//_\//\\\____ Darius Drake
|
||||||
|
_\/\\\_______\/\\\_\/\\\____\//\\\___\/\\\____\//\\\___
|
||||||
|
_\/\\\_______/\\\__\/\\\_____\//\\\__\/\\\_____\//\\\__
|
||||||
|
_\/\\\\\\\\\\\\/___\/\\\______\//\\\_\/\\\______\//\\\_
|
||||||
|
_\////////////_____\///________\///__\///________\///__
|
|
@ -42,12 +42,12 @@
|
||||||
neotree ; a project drawer, like NERDTree for vim
|
neotree ; a project drawer, like NERDTree for vim
|
||||||
ophints ; highlight the region an operation acts on
|
ophints ; highlight the region an operation acts on
|
||||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||||
tabs ; a tab bar for Emacs
|
;; tabs ; a tab bar for Emacs
|
||||||
;;treemacs ; a project drawer, like neotree but cooler
|
;; ;;treemacs ; a project drawer, like neotree but cooler
|
||||||
;;unicode ; extended unicode support for various languages
|
unicode ; extended unicode support for various languages
|
||||||
vc-gutter ; vcs diff in the fringe
|
vc-gutter ; vcs diff in the fringe
|
||||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
;;window-select ; visually switch windows
|
window-select ; visually switch windows
|
||||||
workspaces ; tab emulation, persistence & separate workspaces
|
workspaces ; tab emulation, persistence & separate workspaces
|
||||||
zen ; distraction-free coding or writing
|
zen ; distraction-free coding or writing
|
||||||
|
|
|
@ -11,8 +11,7 @@ end
|
||||||
|
|
||||||
### EXPORT
|
### EXPORT
|
||||||
set -U fish_greeting ""
|
set -U fish_greeting ""
|
||||||
set EDITOR "emacsclient -t -a ''" # $EDITOR use Emacs in terminal
|
set EDITOR "nvim" # $EDITOR use neovim
|
||||||
set VISUAL "emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
|
|
||||||
|
|
||||||
### ADDING TO THE PATH
|
### ADDING TO THE PATH
|
||||||
# First line removes the path; second line sets it. Without the first line,
|
# First line removes the path; second line sets it. Without the first line,
|
||||||
|
@ -47,14 +46,8 @@ alias .5='cd ../../../../..'
|
||||||
# bat as cat
|
# bat as cat
|
||||||
alias cat='bat'
|
alias cat='bat'
|
||||||
|
|
||||||
# vim and DOOM emacs
|
# neovim as vim
|
||||||
alias vim='nvim'
|
alias vim='nvim'
|
||||||
alias doom-sync="~/.emacs.d/bin/doom sync"
|
|
||||||
alias doom-doctor="~/.emacs.d/bin/doom doctor"
|
|
||||||
alias doom-upgrade="~/.emacs.d/bin/doom upgrade"
|
|
||||||
alias doom-purge="~/.emacs.d/bin/doom purge"
|
|
||||||
alias em='/usr/bin/emacs -nw'
|
|
||||||
alias emacs="emacsclient -c -a 'emacs'"
|
|
||||||
|
|
||||||
# Changing "ls" to "exa"
|
# Changing "ls" to "exa"
|
||||||
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
||||||
|
@ -63,24 +56,13 @@ alias ll='exa -l --color=always --group-directories-first' # long format
|
||||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
||||||
alias l.='exa -a | egrep "^\."'
|
alias l.='exa -a | egrep "^\."'
|
||||||
|
|
||||||
# pacman and yay
|
# xbps
|
||||||
alias pac-up='sudo pacman -Syyu' # update the whole system
|
alias xb-up='sudo xbps-install -Su' # update the whole system
|
||||||
alias pac-get='sudo pacman -S --needed' # install a program
|
alias xb-get='sudo xbps-install -S' # install a program
|
||||||
alias pac-qry-sync='sudo pacman -Ss' # query details about a program
|
alias xb-qry='sudo xbps-query' # query details about a program
|
||||||
alias pac-qry='sudo pacman -Q' # query details about a program
|
alias xb-rmv='sudo xbps-remove -R' # remove a package with all its dependencies (it may brake something)
|
||||||
alias pac-rmv='sudo pacman -Rcns' # remove a package with all its dependencies (it may brake something)
|
alias xb-rmv-sec='sudo xbps-remove' # remove a package with all its dependencies (secure way)
|
||||||
alias pac-rmv-sec='sudo pacman -Runs' # remove a package with all its dependencies (secure way)
|
alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove unnecesary packages and clean cache
|
||||||
alias pac-cln='sudo pacman -Rns (pacman -Qtdq)' # remove unnecesary packages
|
|
||||||
alias pac-unlock='sudo rm /var/lib/pacman/db.lck' # remove pacman lock
|
|
||||||
alias yay-up='yay -Sua --noconfirm' # update only AUR pkgs (yay)
|
|
||||||
alias yay-get='yay -S' # install a program for the AUR
|
|
||||||
alias pac-cln-cache='yay -Scc' # clean package cache
|
|
||||||
|
|
||||||
# get fastest mirrors
|
|
||||||
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
|
|
||||||
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
|
|
||||||
|
|
||||||
# Colorize grep output (good for log files)
|
# Colorize grep output (good for log files)
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
|
@ -93,21 +75,18 @@ alias mv='mv -i'
|
||||||
alias cp='cp -i'
|
alias cp='cp -i'
|
||||||
|
|
||||||
# git
|
# git
|
||||||
alias gt-cl='git clone'
|
alias git-clone='git clone'
|
||||||
|
|
||||||
# ani-cli
|
# ani-cli
|
||||||
alias ani='ani-cli'
|
alias ani='ani-cli'
|
||||||
alias ani-q='ani-cli -q' # to select video quality
|
alias ani-q='ani-cli -q' # to select video quality
|
||||||
|
|
||||||
# ytfzf
|
# ytfzf
|
||||||
alias yt='ytfzf -f'
|
alias yt='ytfzf -f -t'
|
||||||
|
|
||||||
# notflix
|
# notflix
|
||||||
alias nt='notflix'
|
alias nt='notflix'
|
||||||
|
|
||||||
# tty-clock
|
|
||||||
alias clock='tty-clock'
|
|
||||||
|
|
||||||
# mount and unmount drives
|
# mount and unmount drives
|
||||||
alias mnt='sudo mount'
|
alias mnt='sudo mount'
|
||||||
alias umnt='sudo umount'
|
alias umnt='sudo umount'
|
||||||
|
@ -119,13 +98,10 @@ alias amx='alsamixer'
|
||||||
# music player
|
# music player
|
||||||
alias mk='musikcube'
|
alias mk='musikcube'
|
||||||
|
|
||||||
# battery (just for laptops)
|
|
||||||
alias bt='acpi'
|
|
||||||
|
|
||||||
# power management
|
# power management
|
||||||
alias po='systemctl poweroff'
|
alias po='loginctl poweroff'
|
||||||
alias sp='systemctl suspend'
|
alias sp='loginctl suspend'
|
||||||
alias rb='systemctl reboot'
|
alias rb='loginctl reboot'
|
||||||
|
|
||||||
# file manager
|
# file manager
|
||||||
alias fm='/home/drk/.config/vifm/scripts/./vifmrun'
|
alias fm='/home/drk/.config/vifm/scripts/./vifmrun'
|
||||||
|
@ -157,12 +133,6 @@ alias wfi-on='nmcli radio wifi on'
|
||||||
alias wfi-off='nmcli radio wifi off'
|
alias wfi-off='nmcli radio wifi off'
|
||||||
alias blt='bluetoothctl'
|
alias blt='bluetoothctl'
|
||||||
|
|
||||||
# cd to diferent directories
|
|
||||||
alias games='cd /run/media/Storage/multimedia/games/linux && ls'
|
|
||||||
alias anime='cd /run/media/Storage/multimedia/videos/anime/ && ls'
|
|
||||||
alias manga='cd /run/media/Storage/multimedia/manga/ && ls'
|
|
||||||
alias videos='cd /run/media/Storage/multimedia/videos/ && ls'
|
|
||||||
|
|
||||||
# the terminal rickroll
|
# the terminal rickroll
|
||||||
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
|
alias rr='curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash'
|
||||||
|
|
||||||
|
|
15
.config/scripts/dmenu-drun.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# _____ ___ ___
|
||||||
|
# / /::\ / /\ /__/|
|
||||||
|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
|
||||||
|
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple desktop dmenu script
|
||||||
|
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: dmenu, j4-dmenu-desktop
|
||||||
|
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
|
||||||
|
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
|
||||||
|
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
|
||||||
|
# \ \::/ \ \:\ \ \:\
|
||||||
|
# \__\/ \ \:\ \ \:\
|
||||||
|
# \__\/ \__\/
|
||||||
|
|
||||||
|
DMENU="dmenu -l 10 -b -i -p Launch:"
|
||||||
|
j4-dmenu-desktop --dmenu "$DMENU" --no-generic
|
39
.config/scripts/dmenu-power.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# _____ ___ ___
|
||||||
|
# / /::\ / /\ /__/|
|
||||||
|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
|
||||||
|
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple power menu dmenu script
|
||||||
|
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: dmenu (Everything else can be changed)
|
||||||
|
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
|
||||||
|
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
|
||||||
|
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
|
||||||
|
# \ \::/ \ \:\ \ \:\
|
||||||
|
# \__\/ \ \:\ \ \:\
|
||||||
|
# \__\/ \__\/
|
||||||
|
|
||||||
|
option1=" Logout"
|
||||||
|
option2=" Reboot"
|
||||||
|
option3=" Power off"
|
||||||
|
option4="💤 Suspend"
|
||||||
|
option5="🔒lock"
|
||||||
|
option6="❌Cancel"
|
||||||
|
session=loginctl list | awk '$1 ~ "c" { print $1 }'
|
||||||
|
|
||||||
|
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
|
||||||
|
|
||||||
|
action=$(echo "$options" | dmenu -b -i -p " ")
|
||||||
|
|
||||||
|
case "$action" in
|
||||||
|
$option1)
|
||||||
|
loginctl kill-session "$session";;
|
||||||
|
$option2)
|
||||||
|
loginctl reboot;;
|
||||||
|
$option3)
|
||||||
|
loginctl poweroff;;
|
||||||
|
$option4)
|
||||||
|
loginctl suspend && betterlockscreen -l;;
|
||||||
|
$option5)
|
||||||
|
betterlockscreen -l;;
|
||||||
|
$option6)
|
||||||
|
exit 0
|
||||||
|
esac
|
45
.config/scripts/dmenu-scrot.sh
Executable file
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# _____ ___ ___
|
||||||
|
# / /::\ / /\ /__/|
|
||||||
|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
|
||||||
|
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple screenshot dmenu script
|
||||||
|
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: scrot, dmenu, notify-send
|
||||||
|
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
|
||||||
|
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
|
||||||
|
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
|
||||||
|
# \ \::/ \ \:\ \ \:\
|
||||||
|
# \__\/ \ \:\ \ \:\
|
||||||
|
# \__\/ \__\/
|
||||||
|
|
||||||
|
mkdir -p "$HOME/Pictures/Screenshots"
|
||||||
|
option1=" Entire screen"
|
||||||
|
option2=" Entire screen with delay"
|
||||||
|
option3=" Focused window"
|
||||||
|
option4=" Select area"
|
||||||
|
|
||||||
|
options="$option1\n$option2\n$option3\n$option4"
|
||||||
|
|
||||||
|
choice=$(echo "$options" | dmenu -b -i -p " ")
|
||||||
|
|
||||||
|
case $choice in
|
||||||
|
$option1)
|
||||||
|
scrot -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
$option2)
|
||||||
|
delayoption1="Take screenshot with 3 sec delay"
|
||||||
|
delayoption2="Take screenshot with 5 sec delay"
|
||||||
|
delayoption3="Take screenshot with 10 sec delay"
|
||||||
|
delayoptions="$delayoption1\n$delayoption2\n$delayoption3"
|
||||||
|
delay=$(echo "$delayoptions" | dmenu -b -i -p " ")
|
||||||
|
case $delay in
|
||||||
|
$delayoption1)
|
||||||
|
scrot -d 3 -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
$delayoption2)
|
||||||
|
scrot -d 5 -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
$delayoption3)
|
||||||
|
scrot -d 10 -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
esac ;;
|
||||||
|
$option3)
|
||||||
|
scrot -u -b -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
$option4)
|
||||||
|
scrot -s -e 'mv $f ~/Pictures/Screenshots/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
||||||
|
esac
|
53
.config/scripts/dmenu-wall.sh
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# _____ ___ ___
|
||||||
|
# / /::\ / /\ /__/|
|
||||||
|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
|
||||||
|
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple wallpaper changer script
|
||||||
|
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: dmenu, fd, feh
|
||||||
|
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
|
||||||
|
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
|
||||||
|
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
|
||||||
|
# \ \::/ \ \:\ \ \:\
|
||||||
|
# \__\/ \ \:\ \ \:\
|
||||||
|
# \__\/ \__\/
|
||||||
|
# This is a simple dmenus script to chose wallpapers on the go, using feh and fd. This is still in development
|
||||||
|
|
||||||
|
|
||||||
|
## MAIN VARIABLES AND COMMANDS ##
|
||||||
|
walldir="$HOME/Pictures/Wallpapers/" # wallpapers folder, change it to yours, make sure that it ends with a /
|
||||||
|
cd "$walldir" || exit
|
||||||
|
|
||||||
|
## SELECT PICTURE FUNCTION ##
|
||||||
|
selectpic() {
|
||||||
|
wallpaper=$(fd --full-path "$walldir" | dmenu -l 10 -b -i -p "Select a wallpaper:")
|
||||||
|
if [ "$wallpaper" ]; then
|
||||||
|
chosenwall=$wallpaper
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
selectpic
|
||||||
|
|
||||||
|
## WALLPAPER SETTING OPTIONS ##
|
||||||
|
option1="Fill"
|
||||||
|
option2="Center"
|
||||||
|
option3="Tile"
|
||||||
|
option4="Max"
|
||||||
|
option5="Scale"
|
||||||
|
options="$option1\n$option2\n$option3\n$option4\n$option5"
|
||||||
|
|
||||||
|
## MAIN ACTION ##
|
||||||
|
action=$(echo "$options" | dmenu -l 10 -b -i -p "Chose the format:")
|
||||||
|
case "$action" in
|
||||||
|
$option1*)
|
||||||
|
feh --bg-fill "$chosenwall";;
|
||||||
|
$option2*)
|
||||||
|
feh --bg-center "$chosenwall";;
|
||||||
|
$option3*)
|
||||||
|
feh --bg-tile "$chosenwall";;
|
||||||
|
$option4*)
|
||||||
|
feh --bg-max "$chosenwall";;
|
||||||
|
$option5*)
|
||||||
|
feh --bg-scale "$chosenwall";;
|
||||||
|
esac
|
||||||
|
exit 0
|
57
.config/scripts/dmenu-wifi.sh
Executable file
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# _____ ___ ___
|
||||||
|
# / /::\ / /\ /__/|
|
||||||
|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
|
||||||
|
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple wifi-menu dmenu script
|
||||||
|
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: dmenu, notify-send, NetworkManager, ping
|
||||||
|
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
|
||||||
|
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
|
||||||
|
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
|
||||||
|
# \ \::/ \ \:\ \ \:\
|
||||||
|
# \__\/ \ \:\ \ \:\
|
||||||
|
# \__\/ \__\/
|
||||||
|
|
||||||
|
# Dmenu variables
|
||||||
|
DMENU1="dmenu -l 10 -b -i -p"
|
||||||
|
DMENU2="dmenu -b -i -p"
|
||||||
|
|
||||||
|
# Scanning Networks and notification
|
||||||
|
notify-send "Scanning Networks"
|
||||||
|
nmcli -t d wifi rescan
|
||||||
|
scan=$(nmcli --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 1d | sed -E "s/WPA*.?\S/~~/g" | sed "s/~~ ~~/~~/g;s/802\.1X//g;s/--/~~/g;s/ *~/~/g;s/~ */~/g;s/_/ /g" | column -t -s '~')
|
||||||
|
|
||||||
|
# Selecting Network
|
||||||
|
selectnet() {
|
||||||
|
bssid=$(echo "$scan" | uniq -u | $DMENU1 "Select Wifi :" | cut -d' ' -f1)
|
||||||
|
if [ "$bssid" ]; then
|
||||||
|
query=$bssid
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
selectnet
|
||||||
|
|
||||||
|
# Typing password
|
||||||
|
selectpass() {
|
||||||
|
pass=$($DMENU2 "Enter Password :")
|
||||||
|
if [ "$pass" ]; then
|
||||||
|
passqry=$pass
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
selectpass
|
||||||
|
|
||||||
|
# Main connection command
|
||||||
|
nmcli device wifi connect "$query" password "$passqry" || nmcli device wifi connect "$query"
|
||||||
|
|
||||||
|
# Check notification
|
||||||
|
notify-send "Checking if the connection was successful"
|
||||||
|
|
||||||
|
# Check process
|
||||||
|
sleep 10
|
||||||
|
if ping -q -c 2 -W 2 google.com >/dev/null; then
|
||||||
|
notify-send "Your internet is working :)"
|
||||||
|
else
|
||||||
|
notify-send "Your internet is not working :("
|
||||||
|
fi
|
8
.config/scripts/feh.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This is my script to set my wallpaper with feh
|
||||||
|
|
||||||
|
# Wallpapers directory and chosen wallpaper here
|
||||||
|
walldir="$HOME/Pictures/Wallpapers/"
|
||||||
|
wallpaper="gruvbox_solaris.png"
|
||||||
|
# Main command
|
||||||
|
feh --bg-fill "$walldir/$wallpaper"
|
3
.config/scripts/lockscreen.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
betterlockscreen -l && loginctl suspend
|
Before Width: | Height: | Size: 44 KiB |
|
@ -1,24 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
option1=" lock"
|
|
||||||
option2=" logout"
|
|
||||||
option3=" reboot"
|
|
||||||
option4=" power off"
|
|
||||||
option5=" suspend"
|
|
||||||
|
|
||||||
options="$option1\n$option2\n$option3\n$option4\n$option5"
|
|
||||||
|
|
||||||
choice=$(echo -e "$options" | rofi -dmenu -i -no-show-icons -lines 5 -width 20 -p " ")
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
$option1)
|
|
||||||
betterlockscreen -l ;;
|
|
||||||
$option2)
|
|
||||||
killall awesome;;
|
|
||||||
$option3)
|
|
||||||
systemctl reboot ;;
|
|
||||||
$option4)
|
|
||||||
systemctl poweroff ;;
|
|
||||||
$option5)
|
|
||||||
systemctl suspend ;;
|
|
||||||
esac
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This script requires scrot
|
|
||||||
mkdir -p $HOME/Pictures/Scrot
|
|
||||||
option1=" Entire screen"
|
|
||||||
option2=" Entire screen with delay"
|
|
||||||
option3=" Focused window"
|
|
||||||
option4=" Select area"
|
|
||||||
|
|
||||||
options="$option1\n$option2\n$option3\n$option4"
|
|
||||||
|
|
||||||
choice=$(echo -e "$options" | rofi -i -dmenu -no-show-icons -no-sidebar-mode -lines 4 -width 20 -p " ")
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
$option1)
|
|
||||||
scrot -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
$option2)
|
|
||||||
delayoption1="Take screenshot with 3 sec delay"
|
|
||||||
delayoption2="Take screenshot with 5 sec delay"
|
|
||||||
delayoption3="Take screenshot with 10 sec delay"
|
|
||||||
delayoptions="$delayoption1\n$delayoption2\n$delayoption3"
|
|
||||||
delay=$(echo -e "$delayoptions" | rofi -i -dmenu -no-show-icons -no-sidebar-mode -lines 3 -width 20 -p " ")
|
|
||||||
|
|
||||||
case $delay in
|
|
||||||
|
|
||||||
$delayoption1)
|
|
||||||
scrot -d 3 -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
$delayoption2)
|
|
||||||
scrot -d 5 -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
$delayoption3)
|
|
||||||
scrot -d 10 -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
esac ;;
|
|
||||||
|
|
||||||
$option3)
|
|
||||||
scrot -u -b -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
$option4)
|
|
||||||
scrot -s -e 'mv $f ~/Pictures/Scrot/' && notify-send -a 'Scrot' 'Screenshot saved.' -i 'dialog-information' -t 2000 ;;
|
|
||||||
|
|
||||||
esac
|
|
|
@ -1,50 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
notify-send "Getting list of available Wi-Fi networks..."
|
|
||||||
nmcli -t d wifi rescan
|
|
||||||
# Get a list of available wifi connections and morph it into a nice-looking list
|
|
||||||
LIST=$(nmcli --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 1d | sed -E "s/WPA*.?\S/~~/g" | sed "s/~~ ~~/~~/g;s/802\.1X//g;s/--/~~/g;s/ *~/~/g;s/~ */~/g;s/_/ /g" | column -t -s '~')
|
|
||||||
|
|
||||||
# get current connection status
|
|
||||||
CONSTATE=$(nmcli -fields WIFI g)
|
|
||||||
if [[ "$CONSTATE" =~ "enabled" ]]; then
|
|
||||||
TOGGLE="Disable WiFi 睊"
|
|
||||||
elif [[ "$CONSTATE" =~ "disabled" ]]; then
|
|
||||||
TOGGLE="Enable WiFi 直"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use rofi to select wifi network
|
|
||||||
CHENTRY=$(echo -e "$TOGGLE\n$LIST" | uniq -u | rofi -dmenu -selected-row 1 -p "Wi-Fi SSID: ")
|
|
||||||
# Get name of connection
|
|
||||||
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $1}')
|
|
||||||
|
|
||||||
if [ "$CHENTRY" = "" ]; then
|
|
||||||
exit
|
|
||||||
elif [ "$CHENTRY" = "Enable WiFi 直" ]; then
|
|
||||||
nmcli radio wifi on
|
|
||||||
elif [ "$CHENTRY" = "Disable WiFi 睊" ]; then
|
|
||||||
nmcli radio wifi off
|
|
||||||
else
|
|
||||||
# get list of known connections
|
|
||||||
KNOWNCON=$(nmcli connection show)
|
|
||||||
|
|
||||||
# If the connection is already in use, then this will still be able to get the SSID
|
|
||||||
if [ "$CHSSID" = "*" ]; then
|
|
||||||
CHSSID=$(echo "$CHENTRY" | sed 's/\s\{2,\}/\|/g' | awk -F "|" '{print $3}')
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Parses the list of preconfigured connections to see if it already contains the chosen SSID. This speeds up the connection process
|
|
||||||
if [[ $(echo "$KNOWNCON" | grep "$CHSSID") = "$CHSSID" ]]; then
|
|
||||||
nmcli con up "$CHSSID"
|
|
||||||
else
|
|
||||||
if [[ "$CHENTRY" =~ "" ]]; then
|
|
||||||
WIFIPASS=$(echo " Press Enter if network is saved" | rofi -dmenu -p " WiFi Password: " -lines 1 )
|
|
||||||
fi
|
|
||||||
if nmcli dev wifi con "$CHSSID" password "$WIFIPASS"
|
|
||||||
then
|
|
||||||
notify-send 'Connection successful'
|
|
||||||
else
|
|
||||||
notify-send 'Connection failed'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|