first commit

This commit is contained in:
Zastian Pretorius
2021-12-08 19:57:06 +02:00
commit 3f96d7a788
821 changed files with 25657 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 vahnrr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,315 @@
# Rofi menus
A variety of convenient menus made mainly using [rofi](https://github.com/davatorium/rofi) and its dmenu emulation.
A video showcasing the menus in action is available [here](https://old.reddit.com/r/unixporn/comments/cvqc6s/oc_handy_menus_made_with_rofi/).
[Here is a showcase](https://gitlab.com/vahnrr/rofi-menus/blob/master/colorschemes.md) of the current colorschemes.
![menus-gallery](screenshots/menus-gallery.png)
**List of menus:**
- **Apps:** call rofi in its drun mode to start desktop programmes
- **i3 keybindings:** quick way to list out all the keybindings you defined for [i3wm](https://github.com/i3/i3)
- **i3 layout:** change the current layout of [i3wm](https://github.com/i3/i3)
- **MPD:** control the song you play through [mpd (the Music Player Daemon)](https://github.com/MusicPlayerDaemon/)
- **Network:** Network Manager menu (a themed version of [this original script](https://github.com/firecat53/networkmanager-dmenu))
- **Network Manager VPN:** manage your active vpn connection in a few keystrokes
- **Power:** a classic power menu
- **Screenshot:** take screenshots using either [scrot](https://github.com/dreamer/scrot) or [maim](https://github.com/naelstrof/maim)
- **Prompt:** a simple customisable prompt to ask for confirmation before executing some given instruction
1. [Requirements](https://gitlab.com/vahnrr/rofi-menus#requirements)
- [Fonts](https://gitlab.com/vahnrr/rofi-menus#fonts)
- [Packages](https://gitlab.com/vahnrr/rofi-menus#packages)
2. [Installation](https://gitlab.com/vahnrr/rofi-menus#installation)
- [Arch Linux](https://gitlab.com/vahnrr/rofi-menus#arch-linux)
- [Manual installation](https://gitlab.com/vahnrr/rofi-menus#manual-installation)
3. [Troubleshooting](https://gitlab.com/vahnrr/rofi-menus#troubleshooting)
4. [Tweaks](https://gitlab.com/vahnrr/rofi-menus#tweaks)
- [Simpler menu summoning](https://gitlab.com/vahnrr/rofi-menus#simpler-menu-summoning)
- [Change the colorscheme](https://gitlab.com/vahnrr/rofi-menus#change-the-colorscheme)
- [Monitor resolution](https://gitlab.com/vahnrr/rofi-menus#monitor-resolution)
- [Use in i3](https://gitlab.com/vahnrr/rofi-menus#use-in-i3)
- [Parsable keybindings in i3](https://gitlab.com/vahnrr/rofi-menus#parsable-keybindings-in-i3)
- [Transparent theme](https://gitlab.com/vahnrr/rofi-menus#transparent-theme)
5. [Contributing](https://gitlab.com/vahnrr/rofi-menus#contributing)
- [New resolutions](https://gitlab.com/vahnrr/rofi-menus#new-resolutions)
- [New colorschemes](https://gitlab.com/vahnrr/rofi-menus#new-colorschemes)
- [Things that could be improved](https://gitlab.com/vahnrr/rofi-menus#things-that-could-be-improved)
## Requirements
### Fonts
The menus uses 3 fonts:
- **Comfortaa** ([preview](https://www.dafont.com/comfortaa.font) and [source](https://www.deviantart.com/aajohan/art/Comfortaa-font-105395949)) used in appsmenu, mpdmenu, nmvpnmenu for the normal text
- **Hurmit Nerd Font Mono** ([preview](https://app.programmingfonts.org/#hermit) and [source](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Hermit)) used in all the menus for the icons
- **RobotoMono Nerd Font** ([preview](https://app.programmingfonts.org/#roboto) and [source](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/RobotoMono)) used in networkmenu for the monospace text
If you wish to change them dig in the resolution file you are using: `~/.config/rofi/themes/shared/resolutions/<your_resolution>.rasi`.
**Warning:** changing the `@icon-font` variable to another font has a high chance of messing most menus' layout.
### Packages
First of all make sure you have `rofi` installed:
``` bash
# Arch / Arch-based
pacman -S rofi
# Debian / Ubuntu
apt-get install rofi
# Fedora
dnf install rofi
```
These menus have been made on my machines (1366x768 and 1920x1080 resolutions) with rofi version **1.5.4**, they *might* not work on earlier version although it should be fine.
#### Dependencies for each menus
| Menu | Package(s) | Note(s) |
|----------------|--------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Apps | [Paper icon theme](https://github.com/snwh/paper-icon-theme) | Any icon theme would do the job, you can change this in *~/.config/rofi/config.rasi* |
| i3 keybindings | `i3` and `awk` | `awk` is used to parse the i3 config file |
| i3 layout | `i3` | - |
| MPD | `mpd` and `mpc` | `mpc` is used to interact with `mpd` |
| Network | `python` | This script comes from [here](https://github.com/firecat53/networkmanager-dmenu), so if you encounter problems, check the issues there |
| VPN | `nmcli`, `grep`, `sed` and `bash` >= 4 | The `mapfile` bash command is used, so `bash` >= 4 is necessary |
| Power | `systemctl`, `light-locker`, `mpc` | By default `systemctl` is used for most actions, `light-locker` is used for locking/sleeping, `i3-msg exit` is used to log out and `mpc`/`amixer` are used to pause and mute the music when going to sleep, you might want to change these commands to match your setup |
| Screenshot | `scrot` or `maim` (+ `xdotool` and `xclip`) | - |
## Installation
After installing please make sure you're using the right resolution, please see [this section](https://gitlab.com/vahnrr/rofi-menus#monitor-resolution).
### Arch Linux
The package is available in the Arch User Repository as [rofi-menus-git](https://aur.archlinux.org/packages/rofi-menus-git).
```
yay -S rofi-menus-git
```
You can then call the menus with these commands:
``` bash
rofi-appsmenu
rofi-i3layout
rofi-mpd
rofi-network
rofi-power
rofi-scrot
rofi-vpn
```
### Manual installation
``` bash
# 1. Go in rofi's config folder
cd ~/.config/rofi
# 2. Copy this repo
git clone https://gitlab.com/vahnrr/rofi-menus.git
# 3. Make sure the scripts are executables
cd rofi-menus && chmod +x scripts/*
# 4. Copy necessary files to the right location
cp -r scripts themes config.rasi ~/.config/rofi
cp -r networkmanager-dmenu ~/.config
# 5. Clean up rofi's config folder
cd .. && rm -r rofi-menus
# 6. Call the scripts (from the scripts folder)
cd scripts
./appsmenu.sh
# (or from anywhere)
. ~/.config/rofi/scripts/appsmenu.sh
```
**Note:** you might want to summon these menus simply by calling the `appsmenu` command, if so, please follow [these instructions](https://gitlab.com/vahnrr/rofi-menus#simpler-menu-summoning).
## Troubleshooting
**First,** check that you have everything (fonts and packages) you need for the menus you want to use in the [Requirements](https://gitlab.com/vahnrr/rofi-menus#requirements) section.
**Then** check your rofi version, I can confirm that it works well with rofi >= **1.5.4**, so make sure you have at least this version.
---
> Menus don't show or only show on part of the screen
Currently these menus only support the following resolutions:
- 1366x768
- 1920x1080
So make sure you're using the right resolution in *~/.config/rofi/themes/shared/settings.rasi*.
If you have a resolution that is not included in the above list, check [this section](https://gitlab.com/vahnrr/rofi-menus#New-resolutions).
---
Don't find any solution? If you checked all the above then consider opening an issue on this repository.
## Tweaks
### Simpler menu summoning
You can add your scripts folder to your `$PATH` variable so that entering `appsmenu` in the terminal (or executing this command) will summon the appsmenu.
The way I do it:
- I store a symlink to my scripts in *~/.local/bin*
- I then add this folder to my `$PATH` using the *~/.profile* file
``` bash
mkdir ~/.local/bin
# Creates the symlinks to the scripts
ln -s ~/.config/rofi/scripts/appsmenu.sh ~/.local/bin/appsmenu
ln -s ~/.config/rofi/scripts/i3keybindingsmenu.sh ~/.local/bin/i3keybindingsmenu
ln -s ~/.config/rofi/scripts/i3layoutmenu.sh ~/.local/bin/i3layoutmenu
ln -s ~/.config/rofi/scripts/maimmenu.sh ~/.local/bin/maimmenu
ln -s ~/.config/rofi/scripts/mpdmenu.sh ~/.local/bin/mpdmenu
ln -s ~/.config/rofi/scripts/networkmenu.py ~/.local/bin/networkmenu
ln -s ~/.config/rofi/scripts/nmvpnmenu.sh ~/.local/bin/nmvpnmenu
ln -s ~/.config/rofi/scripts/powermenu.sh ~/.local/bin/powermenu
ln -s ~/.config/rofi/scripts/promptmenu.sh ~/.local/bin/promptmenu
ln -s ~/.config/rofi/scripts/scrotmenu.sh ~/.local/bin/scrotmenu
# Add our folder to the $PATH variable
echo "PATH=$PATH:~/.local/bin" >> ~/.profile
```
**Note:** after doing this your `$PATH` variable won't be updated, so you will need to log out and then back in to be able to summon the menus this way.
By changing the second path given to `ls` you can change the command to type to summon the menu.
### Change the colorscheme
[Here is a showcase](https://gitlab.com/vahnrr/rofi-menus/blob/master/colorschemes.md) of the current colorschemes.
The files are stored in *~/.config/rofi/themes/shared/colorschemes*.
To change the active colorscheme simply change the import line in *~/.config/rofi/themes/shared/settings.rasi*.
If you wish to change the colorscheme for only one specific menu, you can add the line bellow to the *~/.config/rofi/themes/<menu-name>.rasi* file.
``` css
@import "shared/colorschemes/<colorscheme-name>.rasi"
```
**Note:** it needs to be added **after** the `@import "shared/settings.rasi"` otherwise it would not overwrite the theme from the settings file.
### Monitor resolution
**By default** the menus will use the 1920x1080 resolution.
The files are stored in *~/.config/rofi/themes/shared/resolutions*.
To change the active resolution simply change the import line in *~/.config/rofi/themes/shared/settings.rasi*.
If you don't find the resolution you are using, then please check [this section](https://gitlab.com/vahnrr/rofi-menus#new-resolutions).
### Use in i3
You can call the scripts by giving their fulls paths like *~/.config/rofi/scripts/<script-name>.sh* or follow [these instructions](https://gitlab.com/vahnrr/rofi-menus#simpler-menu-summoning) to call the menus in one word.
Then add these lines to your i3 config file:
```
set $mod Mod4
set $Alt Mod1
bindsym $mod+d exec --no-startup-id appsmenu
bindsym $mod+l exec --no-startup-id i3keybindingsmenu
bindsym $mod+l exec --no-startup-id i3layoutmenu
bindsym $mod+m exec --no-startup-id mpdmenu
bindsym $mod+n exec --no-startup-id networkmenu
bindsym $Alt+v exec --no-startup-id nmvpnmenu
bindsym $mod+p exec --no-startup-id powermenu
bindsym $mod+s exec --no-startup-id maimmenu
```
### Parsable keybindings in i3
The i3 keybindings menu parses your config file (the active one so you will need to restart i3 to get changes listed) using `awk`.
It has been designed to parse my config file, but you may write yours a different way, which might means the parser won't do a great job.
The parser looks for a comment (line starting with `# `).
Then sees if the line after is a keybinding by checking if it starts with `bindsym `.
If it does then it will create an entry in the list.
---
If there is one comment and several keybindings lines following it.
The parser will create an entry for every keybinding but they will have the same description (the comment).
However if your comment contains `$num`, this word will be replaced by the number found in the keybinding, e.g.:
```
# Focus workspace $num
bindsym $Mod+1 workspace $ws1
bindsym $Mod+2 workspace $ws2
bindsym $Mod+3 workspace $ws3
```
Will create the following entries:
- **Mod+1** Focus workspace 1
- **Mod+2** Focus workspace 2
- **Mod+3** Focus workspace 3
**Note:** the \$ character is stripped from keybindings, so `$Mod` turns to **Mod**, `$Alt` to **Alt**, etc.
---
The parser also finds and lists i3's modes and their specific keybindings.
As long as your mode definition has this shape:
```
# Resize mode
bindsym $Mod+r mode "resize"
mode "resize" {
# Shrink the focused window's width
bindsym Left resize shrink width 4
# Grow the focused window's height
bindsym Down resize grow height 4
# Shrink the focused window's height
bindsym Up resize shrink height 4
# Grow the focused window's width
bindsym Right resize grow width 4
# Exit resize mode
bindsym Escape mode "default"
}
```
It will create the following entries:
- **Mod+r** Resize mode
- ` RESIZE ` **Left** Shrink the focused window's width
- ` RESIZE ` **Down** Grow the focused window's height
- ` RESIZE ` **Up** Shrink the focused window's height
- ` RESIZE ` **Right** Grow the focused window's width
- ` RESIZE ` **Escape** Exit the
### Transparent theme
Because the `background` variable in colorschemes is re-used in the `#horibox` and `#listview` you cannot achieve clean transparency without a few tweaks:
- In *~/.config/rofi/themes/shared/<chosen-colorscheme>.rasi* change the `background` variable to something like `#1c1c1caa`, the last 2 characters being the amount of transparency to use
- Then in *~/.config/rofi/themes/shared/option-menu.rasi* add `background-color: #00000000;` to the following entries: `#horibox` and `#listview`
## Contributing
### New resolutions
Copy one of the resolution file in *~/.config/rofi/themes/shared/resolutions* to the new one (i.e *1024x768.rasi*).
Then tweaks the values so that the menus display properly on your screen, the ones you'll most likely have to change are:
- `*-window-padding`: the whole canvas surounding the controls
- `*-element-padding`: the blank space around the icons/texts
### New colorschemes
These menus were initially published with 3 colorschemes, a fourth has been added after someone contributed his colorscheme file (*gruvbox.rasi*).
So if you have made your own and want to contribute, don't hesitate to open a merge request, including your *<colorscheme>.rasi* and screenshots (also added to *colorschemes.md*).
The colorschemes are located in the *~/.config/rofi/themes/shared/colorschemes* folder.
### Things that could be improved
**Universal resolution:** by using percentages instead of raw pixel values in the resolution files, it might be possible to create a universal resolution file.
---
Find a cleaner way to wait for the first `nmcli` command to be successful in *~/.config/rofi/scripts/nmvpnmenu.sh* as without the `sleep 1` it will throw an error.
But waiting 1 second is neither a safe nor a clean work around.
---
**Widget themes:** for now the menus are full screen, which does not suit everyone, there could be an option to call the scripts with (i.e `appsmenu --widget`).
This option would load an alternative resolution file (i.e *1920x1080-widget.rasi*) and would only display a little window for the menus.

View File

@@ -0,0 +1,3 @@
#!/bin/sh
rofi -no-lazy-grab -show drun -theme themes/appsmenu.rasi

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/i3keybindingsmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/i3layoutmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/maimmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/mpdmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
python ~/.config/rofi/scripts/networkmenu.py

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/nmvpnmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/powermenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/promptmenu.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
~/.config/rofi/scripts/scrotmenu.sh

View File

@@ -0,0 +1,166 @@
* {
active-background: #655C91;
active-foreground: @foreground;
normal-background: @background;
normal-foreground: @foreground;
urgent-background: #384D86;
urgent-foreground: @foreground;
alternate-active-background: @background;
alternate-active-foreground: @foreground;
alternate-normal-background: @background;
alternate-normal-foreground: @foreground;
alternate-urgent-background: @background;
alternate-urgent-foreground: @foreground;
selected-active-background: #384D86;
selected-active-foreground: @foreground;
selected-normal-background: #655C91;
selected-normal-foreground: @foreground;
selected-urgent-background: #9D6995;
selected-urgent-foreground: @foreground;
background-color: @background;
background: #040209;
foreground: #efcbed;
border-color: @background;
spacing: 2;
}
#window {
background-color: @background;
border: 0;
padding: 2.5ch;
}
#mainbox {
border: 0;
padding: 0;
}
#message {
border: 2px 0px 0px;
border-color: @border-color;
padding: 1px;
}
#textbox {
text-color: @foreground;
}
#inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
#textbox-prompt-colon {
expand: false;
str: ":";
margin: 0px 0.3em 0em 0em;
text-color: @normal-foreground;
}
#listview {
fixed-height: 0;
border: 2px 0px 0px;
border-color: @border-color;
spacing: 2px;
scrollbar: true;
padding: 2px 0px 0px;
}
#element {
border: 0;
padding: 1px;
}
#element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
#element.normal.normal {
background-color: @normal-background;
text-color: @normal-foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @active-foreground;
}
#element.selected.normal {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @selected-urgent-foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @selected-active-foreground;
}
#element.alternate.normal {
background-color: @alternate-normal-background;
text-color: @alternate-normal-foreground;
}
#element.alternate.urgent {
background-color: @alternate-urgent-background;
text-color: @alternate-urgent-foreground;
}
#element.alternate.active {
background-color: @alternate-active-background;
text-color: @alternate-active-foreground;
}
#scrollbar {
width: 4px;
border: 0;
handle-width: 8px;
padding: 0;
}
#sidebar {
border: 2px 0px 0px;
border-color: @border-color;
}
#button {
text-color: @normal-foreground;
}
#button.selected {
background-color: @selected-normal-background;
text-color: @selected-normal-foreground;
}
#inputbar {
spacing: 0;
text-color: @normal-foreground;
padding: 1px;
}
#case-indicator {
spacing: 0;
text-color: @normal-foreground;
}
#entry {
spacing: 0;
text-color: @normal-foreground;
}
#prompt {
spacing: 0;
text-color: @normal-foreground;
}

View File

@@ -0,0 +1,170 @@
# Colorschemes showcase
## dark-amber.rasi
### Apps menu
![appsmenu](screenshots/dark-amber/appsmenu.png)
### i3 keybindings menu
![i3keybindingsmenu](screenshots/dark-amber/i3keybindingsmenu.png)
### i3 layout menu
![i3layoutmenu](screenshots/dark-amber/i3layoutmenu.png)
### MPD menu
![mpdmenu](screenshots/dark-amber/mpdmenu.png)
### Network menu
![networkmenu](screenshots/dark-amber/networkmenu.png)
### Network Manager VPN menu
![nmvpnmenu_connected](screenshots/dark-amber/nmvpnmenu_connected.png)
![nmvpnmenu_disconnected](screenshots/dark-amber/nmvpnmenu_disconnected.png)
### Power menu
![powermenu](screenshots/dark-amber/powermenu.png)
### Prompt menu
![promptmenu_yes_selected](screenshots/dark-amber/promptmenu_yes_selected.png)
![promptmenu_no_selected](screenshots/dark-amber/promptmenu_no_selected.png)
### Scrot menu / Maim menu
![scrotmenu](screenshots/dark-amber/scrotmenu.png)
## dark-steel-blue.rasi
### Apps menu
![appsmenu](screenshots/dark-steel-blue/appsmenu.png)
### i3 keybindings menu
![i3keybindingsmenu](screenshots/dark-steel-blue/i3keybindingsmenu.png)
### i3 layout menu
![i3layoutmenu](screenshots/dark-steel-blue/i3layoutmenu.png)
### MPD menu
![mpdmenu](screenshots/dark-steel-blue/mpdmenu.png)
### Network menu
![networkmenu](screenshots/dark-steel-blue/networkmenu.png)
### Network Manager VPN menu
![nmvpnmenu_connected](screenshots/dark-steel-blue/nmvpnmenu_connected.png)
![nmvpnmenu_disconnected](screenshots/dark-steel-blue/nmvpnmenu_disconnected.png)
### Power menu
![powermenu](screenshots/dark-steel-blue/powermenu.png)
### Prompt menu
![promptmenu_yes_selected](screenshots/dark-steel-blue/promptmenu_yes_selected.png)
![promptmenu_no_selected](screenshots/dark-steel-blue/promptmenu_no_selected.png)
### Scrot menu / Maim menu
![scrotmenu](screenshots/dark-steel-blue/scrotmenu.png)
## gruvbox.rasi
### Apps menu
![appsmenu](screenshots/gruvbox/appsmenu.png)
### i3 keybindings menu
![i3keybindingsmenu](screenshots/gruvbox/i3keybindingsmenu.png)
### i3 layout menu
![i3layoutmenu](screenshots/gruvbox/i3layoutmenu.png)
### MPD menu
![mpdmenu](screenshots/gruvbox/mpdmenu.png)
### Network menu
![networkmenu](screenshots/gruvbox/networkmenu.png)
### Network Manager VPN menu
![nmvpnmenu_connected](screenshots/gruvbox/nmvpnmenu_connected.png)
![nmvpnmenu_disconnected](screenshots/gruvbox/nmvpnmenu_disconnected.png)
### Power menu
![powermenu](screenshots/gruvbox/powermenu.png)
### Prompt menu
![promptmenu_yes_selected](screenshots/gruvbox/promptmenu_yes_selected.png)
![promptmenu_no_selected](screenshots/gruvbox/promptmenu_no_selected.png)
### Scrot menu / Maim menu
![scrotmenu](screenshots/gruvbox/scrotmenu.png)
## light-blue.rasi
### Apps menu
![appsmenu](screenshots/light-blue/appsmenu.png)
### i3 keybindings menu
![i3keybindingsmenu](screenshots/light-blue/i3keybindingsmenu.png)
### i3 layout menu
![i3layoutmenu](screenshots/light-blue/i3layoutmenu.png)
### MPD menu
![mpdmenu](screenshots/light-blue/mpdmenu.png)
### Network menu
![networkmenu](screenshots/light-blue/networkmenu.png)
### Network Manager VPN menu
![nmvpnmenu_connected](screenshots/light-blue/nmvpnmenu_connected.png)
![nmvpnmenu_disconnected](screenshots/light-blue/nmvpnmenu_disconnected.png)
### Power menu
![powermenu](screenshots/light-blue/powermenu.png)
### Prompt menu
![promptmenu_yes_selected](screenshots/light-blue/promptmenu_yes_selected.png)
![promptmenu_no_selected](screenshots/light-blue/promptmenu_no_selected.png)
### Scrot menu / Maim menu
![scrotmenu](screenshots/light-blue/scrotmenu.png)

View File

@@ -0,0 +1,10 @@
configuration {
show-icons: true;
icon-theme: "Paper";
cycle: true;
hide-scrollbar: true;
disable-history: false;
modi: "drun";
display-drun: "apps";
columns: 2;
}

View File

@@ -0,0 +1,28 @@
[dmenu]
dmenu_command = rofi -dmenu -theme themes/networkmenu.rasi
# # Note that dmenu_command can contain arguments as well like `rofi -width 30`
# # Rofi and dmenu are set to case insensitive by default `-i`
# l = number of lines to display, defaults to number of total network options
# fn = font string
# nb = normal background (name, #RGB, or #RRGGBB)
# nf = normal foreground
# sb = selected background
# sf = selected foreground
# b = (just set to empty value and menu will appear at the bottom
# m = number of monitor to display on
# p = Custom Prompt for the networks menu
# pinentry = Pinentry command
# rofi_highlight = <True or False> # (Default: False) use rofi highlighting instead of '**'
# # override normal foreground and background colors (dmenu) or use the
# # -password option (rofi) to obscure passphrase entry
# [dmenu_passphrase]
# nf = #222222
# nb = #222222
# rofi_obscure = True
[editor]
terminal = xfce4-terminal
gui_if_available = True
# terminal = <name of terminal program>
# gui_if_available = <True or False>

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@@ -0,0 +1,4 @@
#!/bin/sh
rofi -no-lazy-grab -show drun -theme /home/mrfluffy/rofi-menus/themes/appsmenu.rasi

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env sh
if [[ -z "${XDG_CONFIG_HOME}" ]]; then
CONFIG_HOME=$HOME/.config
else
CONFIG_HOME=$XDG_CONFIG_HOME
fi
theme_file=$(awk '
/^@import "colorschemes/ {
split($2, arr, "/");
print substr(arr[2], 0, length(arr[2])-1);
}' $CONFIG_HOME/rofi/themes/shared/settings.rasi)
# 0 - accent
# 1 - background-focus
# 2 - foreground
colors=($(awk '
function print_hex_color(text) {
print substr(text, 1, length(text)-1);
}
/^\s+accent:/ {
print_hex_color($2);
}
/^\s+background-focus:/ {
print_hex_color($2);
}
/^\s+foreground:/ {
print_hex_color($2);
}' $CONFIG_HOME/rofi/themes/shared/colorschemes/$theme_file))
list=$(i3-msg -t get_config \
| awk -v pre_mode="<span bgcolor='${colors[1]}' fgcolor='${colors[2]}' weight='heavy'> " \
-v post_mode=" </span> " \
-v pre_keybinding="<span fgcolor='${colors[0]}' weight='heavy'>" \
-v post_keybinding="</span>" \
-v separator=" " '
$1 == "#" {
# Strip down the indent characters
gsub(/^\s+/, "", $0);
comment = substr($0, 3);
}
match($0, /^[^\s]+mode ".+"/) != 0 {
mode = pre_mode toupper(substr($2, 2, length($2)-2)) post_mode;
}
match($0, /^}/) != 0 {
mode = "";
}
$1 == "bindsym" {
# Strip down the $ character from variables such as $Mod
gsub(/\$/, "", $2)
line = pre_keybinding $2 post_keybinding separator comment;
# Replace $num in the comment by the number found in the keybinding
if (index(comment, "$num")) {
gsub(/\$num/, substr($2, match($2, /([[:digit:]]+)$/), length($2)), line);
}
print mode line;
}')
echo "$list" \
| rofi -dmenu \
-markup-rows \
-i \
-p "i3 Keybindings" \
-theme themes/i3keybindingsmenu.rasi &> /dev/null

View File

@@ -0,0 +1,24 @@
#!/bin/bash
rofi_command="rofi -theme themes/i3layoutmenu.rasi"
### Options ###
stacked=""
tabbed="ﬓ"
split="﬿"
# Variable passed to rofi
options="$stacked\n$tabbed\n$split"
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 1)"
case $chosen in
$stacked)
i3-msg layout stacked
;;
$tabbed)
i3-msg layout tabbed
;;
$split)
i3-msg layout toggle split
;;
esac

View File

@@ -0,0 +1,69 @@
#!/bin/bash
rofi_command="rofi -theme themes/mpdmenu.rasi"
### Options ###
# Gets the current status of mpd (for us to parse it later on)
status="$(mpc status)"
# Defines the Play / Pause option content
if [[ $status == *"[playing]"* ]]; then
play_pause=""
else
play_pause=""
fi
active=""
urgent=""
# Display if repeat mode is on / off
tog_repeat="凌"
if [[ $status == *"repeat: on"* ]]; then
active="-a 4"
elif [[ $status == *"repeat: off"* ]]; then
urgent="-u 4"
else
tog_repeat=" Parsing error"
fi
# Display if random mode is on / off
tog_random=""
if [[ $status == *"random: on"* ]]; then
[ -n "$active" ] && active+=",5" || active="-a 5"
elif [[ $status == *"random: off"* ]]; then
[ -n "$urgent" ] && urgent+=",5" || urgent="-u 5"
else
tog_random=" Parsing error"
fi
stop=""
next=""
previous=""
# Variable passed to rofi
options="$previous\n$play_pause\n$stop\n$next\n$tog_repeat\n$tog_random"
# Get the current playing song
current=$(mpc current)
# If mpd isn't running it will return an empty string, we don't want to display that
if [[ -z "$current" ]]; then
current="-"
fi
# Spawn the mpd menu with the "Play / Pause" entry selected by default
chosen="$(echo -e "$options" | $rofi_command -p "$current" -dmenu $active $urgent -selected-row 1)"
case $chosen in
$previous)
mpc -q prev
;;
$play_pause)
mpc -q toggle
;;
$stop)
mpc -q stop
;;
$next)
mpc -q next
;;
$tog_repeat)
mpc -q repeat
;;
$tog_random)
mpc -q random
;;
esac

View File

@@ -0,0 +1,693 @@
#!/usr/bin/env python
# encoding:utf8
"""NetworkManager command line dmenu script.
To add new connections or enable/disable networking requires policykit
permissions setup per:
https://wiki.archlinux.org/index.php/NetworkManager#Set_up_PolicyKit_permissions
OR running the script as root
Add dmenu formatting options and default terminal if desired to
~/.config/networkmanager-dmenu/config.ini
"""
import itertools
import locale
import os
from os.path import expanduser
import shlex
import sys
import uuid
from subprocess import Popen, PIPE
import gi
gi.require_version('NM', '1.0')
from gi.repository import GLib, NM # pylint: disable=wrong-import-position
try:
import configparser as configparser
except ImportError:
import ConfigParser as configparser
ENV = os.environ.copy()
ENV['LC_ALL'] = 'C'
ENC = locale.getpreferredencoding()
CLIENT = NM.Client.new(None)
LOOP = GLib.MainLoop()
CONNS = CLIENT.get_connections()
if sys.version_info.major < 3:
str = unicode
def dmenu_cmd(num_lines, prompt="Networks", active_lines=None): # pylint: disable=too-many-branches
"""Parse config.ini if it exists and add options to the dmenu command
Args: args - num_lines: number of lines to display
prompt: prompt to show
Returns: command invocation (as a list of strings) for
dmenu -l <num_lines> -p <prompt> -i ...
"""
dmenu_command = "dmenu"
conf = configparser.ConfigParser()
conf.read(expanduser("~/.config/networkmanager-dmenu/config.ini"))
if not conf.sections():
res = [dmenu_command, "-i", "-l", str(num_lines), "-p", str(prompt)]
res.extend(sys.argv[1:])
return res
if conf.has_section('dmenu'):
args = conf.items('dmenu')
args_dict = dict(args)
dmenu_args = []
if "dmenu_command" in args_dict:
command = shlex.split(args_dict["dmenu_command"])
dmenu_command = command[0]
dmenu_args = command[1:]
del args_dict["dmenu_command"]
if "p" in args_dict and prompt == "Networks":
prompt = args_dict["p"]
del args_dict["p"]
elif "p" in args_dict:
del args_dict["p"]
if "rofi" in dmenu_command:
lines = "-i -dmenu -lines"
# rofi doesn't support 0 length line, it requires at least -lines=1
# see https://github.com/DaveDavenport/rofi/issues/252
num_lines = num_lines or 1
else:
lines = "-i -l"
if "l" in args_dict:
# rofi doesn't support 0 length line, it requires at least -lines=1
# see https://github.com/DaveDavenport/rofi/issues/252
if "rofi" in dmenu_command:
args_dict['l'] = min(num_lines, int(args_dict['l'])) or 1
lines = "{} {}".format(lines, args_dict['l'])
del args_dict['l']
else:
lines = "{} {}".format(lines, num_lines)
if "pinentry" in args_dict:
del args_dict["pinentry"]
if conf.has_option('dmenu', 'rofi_highlight'):
rofi_highlight = conf.getboolean('dmenu', 'rofi_highlight')
del args_dict["rofi_highlight"]
else:
rofi_highlight = False
if rofi_highlight is True and "rofi" in dmenu_command:
if active_lines:
dmenu_args.extend(["-a", ",".join([str(num)
for num in active_lines])])
if prompt == "Passphrase":
if conf.has_section('dmenu_passphrase'):
args = conf.items('dmenu_passphrase')
args_dict.update(args)
rofi_obscure = True
if conf.has_option('dmenu_passphrase', 'rofi_obscure'):
rofi_obscure = conf.getboolean('dmenu_passphrase', 'rofi_obscure')
del args_dict["rofi_obscure"]
if rofi_obscure is True and "rofi" in dmenu_command:
dmenu_args.extend(["-password"])
extras = (["-" + str(k), str(v)] for (k, v) in args_dict.items())
res = [dmenu_command, "-p", str(prompt)]
res.extend(dmenu_args)
res += list(itertools.chain.from_iterable(extras))
res[1:1] = lines.split()
res = list(filter(None, res)) # Remove empty list elements
res.extend(sys.argv[1:])
return res
def choose_adapter(client):
"""If there is more than one wifi adapter installed, ask which one to use
"""
devices = client.get_devices()
devices = [i for i in devices if i.get_device_type() == NM.DeviceType.WIFI]
if not devices:
return None
elif devices:
return devices[0]
device_names = "\n".join([d.get_iface() for d in devices]).encode(ENC)
sel = Popen(dmenu_cmd(len(devices), "CHOOSE ADAPTER:"),
stdin=PIPE,
stdout=PIPE,
env=ENV).communicate(input=device_names)[0].decode(ENC)
if not sel.strip():
sys.exit()
devices = [i for i in devices if i.get_iface() == sel.strip()]
assert len(devices) == 1
return devices[0]
def is_modemmanager_installed():
"""Check if ModemManager is installed"""
devnull = open(os.devnull)
try:
Popen(["ModemManager"], stdout=devnull, stderr=devnull).communicate()
except OSError:
return False
return True
def create_other_actions(client):
"""Return list of other actions that can be taken
"""
networking_enabled = client.networking_get_enabled()
networking_action = "Disable" if networking_enabled else "Enable"
wifi_enabled = client.wireless_get_enabled()
wifi_action = "Disable" if wifi_enabled else "Enable"
actions = [Action("{} Wifi".format(wifi_action), toggle_wifi,
not wifi_enabled),
Action("{} Networking".format(networking_action),
toggle_networking, not networking_enabled),
Action("Launch Connection Manager", launch_connection_editor),
Action("Delete a Connection", delete_connection)]
if wifi_enabled:
actions.append(Action("Rescan Wifi Networks", rescan_wifi))
return actions
def rescan_wifi():
"""
Rescan Wifi Access Points
"""
for dev in CLIENT.get_devices():
if gi.repository.NM.DeviceWifi == type(dev):
try:
dev.request_scan()
except gi.repository.GLib.Error as err:
# Too frequent rescan error
if not err.code == 6: # pylint: disable=no-member
raise err
def ssid_to_utf8(nm_ap):
""" Convert binary ssid to utf-8 """
ssid = nm_ap.get_ssid()
if not ssid:
return ""
ret = NM.utils_ssid_to_utf8(ssid.get_data())
if sys.version_info.major < 3:
return ret.decode(ENC)
return ret
def ap_security(nm_ap):
"""Parse the security flags to return a string with 'WPA2', etc. """
flags = nm_ap.get_flags()
wpa_flags = nm_ap.get_wpa_flags()
rsn_flags = nm_ap.get_rsn_flags()
sec_str = ""
if ((flags & getattr(NM, '80211ApFlags').PRIVACY) and
(wpa_flags == 0) and (rsn_flags == 0)):
sec_str += " WEP"
if wpa_flags != 0:
sec_str += " WPA1"
if rsn_flags != 0:
sec_str += " WPA2"
if ((wpa_flags & getattr(NM, '80211ApSecurityFlags').KEY_MGMT_802_1X) or
(rsn_flags & getattr(NM, '80211ApSecurityFlags').KEY_MGMT_802_1X)):
sec_str += " 802.1X"
# If there is no security use "--"
if sec_str == "":
sec_str = "--"
return sec_str.lstrip()
class Action(object): # pylint: disable=too-few-public-methods
"""Helper class to execute functions from a string variable"""
def __init__(self,
name,
func,
args=None,
active=False,
):
self.name = name
self.func = func
self.is_active = active
if args is None:
self.args = None
elif isinstance(args, list):
self.args = args
else:
self.args = [args]
def __str__(self):
if sys.version_info.major < 3 and \
isinstance(self.name, unicode) is False:
return self.name.decode(ENC)
return self.name
def __call__(self):
if self.args is None:
self.func()
else:
self.func(*self.args)
def process_ap(nm_ap, is_active, adapter):
"""Activate/Deactivate a connection and get password if required"""
if is_active:
CLIENT.deactivate_connection_async(nm_ap)
else:
conns_cur = [i for i in CONNS if
i.get_setting_wireless() is not None and
i.get_setting_wireless().get_mac_address() ==
adapter.get_permanent_hw_address()]
con = nm_ap.filter_connections(conns_cur)
if len(con) > 1:
raise ValueError("There are multiple connections possible")
if len(con) == 1:
CLIENT.activate_connection_async(con[0])
else:
if ap_security(nm_ap) != "--":
password = get_passphrase()
else:
password = ""
set_new_connection(nm_ap, password, adapter)
def process_vpngsm(con, activate):
"""Activate/deactive VPN or GSM connections"""
if activate:
CLIENT.activate_connection_async(con)
else:
CLIENT.deactivate_connection_async(con)
def create_ap_actions(aps, active_ap, active_connection, adapter): # pylint: disable=too-many-locals
"""For each AP in a list, create the string and its attached function
(activate/deactivate)
"""
active_ap_bssid = active_ap.get_bssid() if active_ap is not None else ""
names = [ssid_to_utf8(ap) for ap in aps]
max_len_name = max([len(name) for name in names]) if names else 0
secs = [ap_security(ap) for ap in aps]
max_len_sec = max([len(sec) for sec in secs]) if secs else 0
ap_actions = []
for nm_ap, name, sec in zip(aps, names, secs):
bars = NM.utils_wifi_strength_bars(nm_ap.get_strength())
is_active = nm_ap.get_bssid() == active_ap_bssid
action_name = u"{:<{}s} {:<{}s} {}".format(name, max_len_name, sec,
max_len_sec, bars)
if is_active:
ap_actions.append(Action(action_name, process_ap,
[active_connection, True, adapter],
active=True))
else:
ap_actions.append(Action(action_name, process_ap,
[nm_ap, False, adapter]))
return ap_actions
def create_vpn_actions(vpns, active):
"""Create the list of strings to display with associated function
(activate/deactivate) for VPN connections.
"""
active_vpns = [i for i in active if i.get_vpn()]
return _create_vpngsm_actions(vpns, active_vpns, "VPN")
def create_eth_actions(eths, active):
"""Create the list of strings to display with associated function
(activate/deactivate) for Ethernet connections.
"""
active_eths = [i for i in active if 'ethernet' in i.get_connection_type()]
return _create_vpngsm_actions(eths, active_eths, "Eth")
def create_gsm_actions(gsms, active):
"""Create the list of strings to display with associated function
(activate/deactivate) GSM connections."""
active_gsms = [i for i in active if
i.get_connection() is not None and
i.get_connection().is_type(NM.SETTING_GSM_SETTING_NAME)]
return _create_vpngsm_actions(gsms, active_gsms, "GSM")
def create_blue_actions(blues, active):
"""Create the list of strings to display with associated function
(activate/deactivate) Bluetooth connections."""
active_blues = [i for i in active if
i.get_connection() is not None and
i.get_connection().is_type(NM.SETTING_BLUETOOTH_SETTING_NAME)]
return _create_vpngsm_actions(blues, active_blues, "Bluetooth")
def _create_vpngsm_actions(cons, active_cons, label):
active_con_ids = [a.get_id() for a in active_cons]
actions = []
for con in cons:
is_active = con.get_id() in active_con_ids
action_name = u"{}:{}".format(con.get_id(), label)
if is_active:
active_connection = [a for a in active_cons
if a.get_id() == con.get_id()]
if len(active_connection) != 1:
raise ValueError(u"Multiple active connections match"
" the connection: {}".format(con.get_id()))
active_connection = active_connection[0]
actions.append(Action(action_name, process_vpngsm,
[active_connection, False], active=True))
else:
actions.append(Action(action_name, process_vpngsm,
[con, True]))
return actions
def create_wwan_actions(client):
"""Create WWWAN actions
"""
wwan_enabled = client.wwan_get_enabled()
wwan_action = "Disable" if wwan_enabled else "Enable"
return [Action("{} WWAN".format(wwan_action), toggle_wwan, not wwan_enabled)]
def get_selection(eths, aps, vpns, gsms, blues, wwan, others):
"""Combine the arg lists and send to dmenu for selection.
Also executes the associated action.
Args: args - eths: list of Actions
aps: list of Actions
vpns: list of Actions
gsms: list of Actions
blues: list of Actions
wwan: list of Actions
others: list of Actions
"""
conf = configparser.ConfigParser()
conf.read(expanduser("~/.config/networkmanager-dmenu/config.ini"))
rofi_highlight = False
if conf.has_option('dmenu', 'rofi_highlight'):
rofi_highlight = conf.getboolean('dmenu', 'rofi_highlight')
inp = []
empty_action = [Action('', None)]
all_actions = []
all_actions += eths + empty_action if eths else []
all_actions += aps + empty_action if aps else []
all_actions += vpns + empty_action if vpns else []
all_actions += gsms + empty_action if (gsms and wwan) else []
all_actions += blues + empty_action if blues else []
all_actions += wwan + empty_action if wwan else []
all_actions += others
if rofi_highlight is True:
inp = [str(action) for action in all_actions]
else:
inp = [('** ' if action.is_active else ' ') + str(action)
for action in all_actions]
active_lines = [index for index, action in enumerate(all_actions)
if action.is_active]
inp_bytes = "\n".join([i for i in inp]).encode(ENC)
command = dmenu_cmd(len(inp), active_lines=active_lines)
sel = Popen(command, stdin=PIPE, stdout=PIPE,
env=ENV).communicate(input=inp_bytes)[0].decode(ENC)
if not sel.rstrip():
sys.exit()
if rofi_highlight is False:
action = [i for i in eths + aps + vpns + gsms + blues + wwan + others
if ((str(i).strip() == str(sel.strip())
and not i.is_active) or
('** ' + str(i) == str(sel.rstrip('\n'))
and i.is_active))]
else:
action = [i for i in eths + aps + vpns + gsms + blues + wwan + others
if str(i).strip() == sel.strip()]
assert len(action) == 1, \
u"Selection was ambiguous: '{}'".format(str(sel.strip()))
return action[0]
def toggle_networking(enable):
"""Enable/disable networking
Args: enable - boolean
"""
CLIENT.networking_set_enabled(enable)
def toggle_wifi(enable):
"""Enable/disable Wifi
Args: enable - boolean
"""
CLIENT.wireless_set_enabled(enable)
def toggle_wwan(enable):
"""Enable/disable WWAN
Args: enable - boolean
"""
CLIENT.wwan_set_enabled(enable)
def launch_connection_editor():
"""Launch nmtui or the gui nm-connection-editor
"""
conf = configparser.ConfigParser()
conf.read(expanduser("~/.config/networkmanager-dmenu/config.ini"))
if conf.has_option("editor", "terminal"):
terminal = conf.get("editor", "terminal")
else:
terminal = "xterm"
if conf.has_option("editor", "gui_if_available"):
gui_if_available = conf.get("editor", "gui_if_available")
else:
gui_if_available = "True"
if gui_if_available == "True":
try:
Popen(["nm-connection-editor"]).communicate()
except OSError:
Popen([terminal, "-e", "nmtui"]).communicate()
else:
Popen([terminal, "-e", "nmtui"]).communicate()
def get_passphrase():
"""Get a password
Returns: string
"""
conf = configparser.ConfigParser()
conf.read(expanduser("~/.config/networkmanager-dmenu/config.ini"))
pinentry = None
if conf.has_option("dmenu", "pinentry"):
pinentry = conf.get("dmenu", "pinentry")
if pinentry:
pin = ""
out = Popen(pinentry,
stdout=PIPE,
stdin=PIPE).communicate( \
input=b'setdesc Get network password\ngetpin\n')[0]
if out:
res = out.decode(ENC).split("\n")[2]
if res.startswith("D "):
pin = res.split("D ")[1]
return pin
else:
return Popen(dmenu_cmd(0, "Passphrase"),
stdin=PIPE, stdout=PIPE).communicate()[0].decode(ENC)
def delete_connection():
"""Display list of NM connections and delete the selected one
"""
conn_acts = [Action(i.get_id(), i.delete) for i in CONNS]
conn_names = "\n".join([str(i) for i in conn_acts]).encode(ENC)
sel = Popen(dmenu_cmd(len(conn_acts), "CHOOSE CONNECTION TO DELETE:"),
stdin=PIPE,
stdout=PIPE,
env=ENV).communicate(input=conn_names)[0].decode(ENC)
if not sel.strip():
sys.exit()
action = [i for i in conn_acts if str(i) == sel.rstrip("\n")]
assert len(action) == 1, u"Selection was ambiguous: {}".format(str(sel))
action[0]()
def set_new_connection(nm_ap, nm_pw, adapter):
"""Setup a new NetworkManager connection
Args: ap - NM.AccessPoint
pw - string
"""
nm_pw = str(nm_pw).strip()
profile = create_wifi_profile(nm_ap, nm_pw, adapter)
CLIENT.add_and_activate_connection_async(profile, adapter, nm_ap.get_path(),
None, verify_conn, profile)
LOOP.run()
def create_wifi_profile(nm_ap, password, adapter):
# pylint: disable=C0301
# From https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/gi/add_connection.py
# and https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/dbus/add-wifi-psk-connection.py
# pylint: enable=C0301
"""Create the NM profile given the AP and passphrase"""
ap_sec = ap_security(nm_ap)
profile = NM.SimpleConnection.new()
s_con = NM.SettingConnection.new()
s_con.set_property(NM.SETTING_CONNECTION_ID, ssid_to_utf8(nm_ap))
s_con.set_property(NM.SETTING_CONNECTION_UUID, str(uuid.uuid4()))
s_con.set_property(NM.SETTING_CONNECTION_TYPE, "802-11-wireless")
profile.add_setting(s_con)
s_wifi = NM.SettingWireless.new()
s_wifi.set_property(NM.SETTING_WIRELESS_SSID, nm_ap.get_ssid())
s_wifi.set_property(NM.SETTING_WIRELESS_MODE, 'infrastructure')
s_wifi.set_property(NM.SETTING_WIRELESS_MAC_ADDRESS, adapter.get_permanent_hw_address())
profile.add_setting(s_wifi)
s_ip4 = NM.SettingIP4Config.new()
s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, "auto")
profile.add_setting(s_ip4)
s_ip6 = NM.SettingIP6Config.new()
s_ip6.set_property(NM.SETTING_IP_CONFIG_METHOD, "auto")
profile.add_setting(s_ip6)
if ap_sec != "--":
s_wifi_sec = NM.SettingWirelessSecurity.new()
if "WPA" in ap_sec:
s_wifi_sec.set_property(NM.SETTING_WIRELESS_SECURITY_KEY_MGMT,
"wpa-psk")
s_wifi_sec.set_property(NM.SETTING_WIRELESS_SECURITY_AUTH_ALG,
"open")
s_wifi_sec.set_property(NM.SETTING_WIRELESS_SECURITY_PSK, password)
elif "WEP" in ap_sec:
s_wifi_sec.set_property(NM.SETTING_WIRELESS_SECURITY_KEY_MGMT,
"None")
s_wifi_sec.set_property(NM.SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE,
NM.WepKeyType.PASSPHRASE)
s_wifi_sec.set_wep_key(0, password)
profile.add_setting(s_wifi_sec)
return profile
def verify_conn(client, result, data):
"""Callback function for add_and_activate_connection_async
Check if connection completes successfully. Delete the connection if there
is an error.
"""
try:
act_conn = client.add_and_activate_connection_finish(result)
conn = act_conn.get_connection()
conn.verify()
conn.verify_secrets()
data.verify()
data.verify_secrets()
except GLib.Error: # pylint: disable=catching-non-exception
try:
conn.delete()
except UnboundLocalError:
pass
finally:
LOOP.quit()
def create_ap_list(adapter, active_connections):
"""Generate list of access points. Remove duplicate APs , keeping strongest
ones and the active AP
Args: adapter
active_connections - list of all active connections
Returns: aps - list of access points
active_ap - active AP
active_ap_con - active Connection
adapter
"""
aps = []
ap_names = []
active_ap = adapter.get_active_access_point()
aps_all = sorted(adapter.get_access_points(),
key=lambda a: a.get_strength(), reverse=True)
conns_cur = [i for i in CONNS if
i.get_setting_wireless() is not None and
i.get_setting_wireless().get_mac_address() ==
adapter.get_permanent_hw_address()]
try:
ap_conns = active_ap.filter_connections(conns_cur)
active_ap_name = ssid_to_utf8(active_ap)
active_ap_con = [active_conn for active_conn in active_connections
if active_conn.get_connection() in ap_conns]
except AttributeError:
active_ap_name = None
active_ap_con = []
if len(active_ap_con) > 1:
raise ValueError("Multiple connection profiles match"
" the wireless AP")
active_ap_con = active_ap_con[0] if active_ap_con else None
for nm_ap in aps_all:
ap_name = ssid_to_utf8(nm_ap)
if nm_ap != active_ap and ap_name == active_ap_name:
# Skip adding AP if it's not active but same name as active AP
continue
if ap_name not in ap_names:
ap_names.append(ap_name)
aps.append(nm_ap)
return aps, active_ap, active_ap_con, adapter
def run():
"""Main script entrypoint"""
active = CLIENT.get_active_connections()
adapter = choose_adapter(CLIENT)
if adapter:
ap_actions = create_ap_actions(*create_ap_list(adapter, active))
else:
ap_actions = []
vpns = [i for i in CONNS if i.is_type(NM.SETTING_VPN_SETTING_NAME)]
eths = [i for i in CONNS if i.is_type(NM.SETTING_WIRED_SETTING_NAME)]
blues = [i for i in CONNS if i.is_type(NM.SETTING_BLUETOOTH_SETTING_NAME)]
vpn_actions = create_vpn_actions(vpns, active)
eth_actions = create_eth_actions(eths, active)
blue_actions = create_blue_actions(blues, active)
other_actions = create_other_actions(CLIENT)
wwan_installed = is_modemmanager_installed()
if wwan_installed:
gsms = [i for i in CONNS if i.is_type(NM.SETTING_GSM_SETTING_NAME)]
gsm_actions = create_gsm_actions(gsms, active)
wwan_actions = create_wwan_actions(CLIENT)
else:
gsm_actions = []
wwan_actions = []
sel = get_selection(eth_actions, ap_actions, vpn_actions, gsm_actions,
blue_actions, wwan_actions, other_actions)
sel()
if __name__ == '__main__':
run()
# vim: set et ts=4 sw=4 :

View File

@@ -0,0 +1,64 @@
#!/bin/bash
disconnect() {
nmcli con down id "$active" && notify-send "Network Manager" "Disconnected from <b>$active</b>" || notify-send "Network Manager" "Error disconnecting from <b>$active</b>!"
}
connect() {
nmcli con up id "$chosen" && notify-send "Network Manager" "Now connected to <b>$chosen</b>" || notify-send "Network Manager" "Error connecting to <b>$chosen</b>!"
}
# Get the active vpn connection if there's one
active="$(nmcli -g name,type con show --active | grep vpn | sed -e 's#:vpn$##')"
# Get the list of vpns
mapfile -t list < <(nmcli -g name,type con | grep vpn | sed -e 's#:vpn$##')
# A vpn is active
if [ -n "$active" ]; then
status=" Connected"
status_style="#prompt { background-color: @on; }"
special="-a 0 -selected-row 1"
# Variable passed to rofi
options="$active"
for i in "${!list[@]}"; do
[ "${list[i]}" == "$active" ] && unset "list[i]" || options+="\n${list[i]}"
done
# No vpn is active
else
status=" Disconnected"
status_style="#prompt { background-color: @off; }"
special=""
# Variable passed to rofi
options=""
for i in "${!list[@]}"; do
options+="${list[i]}\n"
done
options=${options::-2}
fi
chosen=$(echo -e "$options" | rofi -theme themes/nmvpnmenu.rasi -theme-str "$status_style" -p "$status" -dmenu -i $special)
if [ "$chosen" == "$active" ]; then
# Disconnect the active vpn
disconnect
else
take_action=false
# Check if the chosen option is in the list, to avoid taking action
# on the user pressing Escape for example
for i in "${!list[@]}"; do
[ "${list[i]}" == "$chosen" ] && { take_action=true; break; }
done
if $take_action; then
# A vpn is active
if [ -n "$active" ]; then
# Disconnect the active vpn
disconnect
wait
sleep 1
# Connect to the chosen one
connect
# No vpn is active
else
# Connect to the chosen one
connect
fi
fi
fi

View File

@@ -0,0 +1,34 @@
#!/bin/bash
rofi_command="rofi -theme themes/powermenu.rasi"
### Options ###
power_off=""
reboot=""
lock=""
suspend="鈴"
log_out=""
# Variable passed to rofi
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)"
case $chosen in
$power_off)
promptmenu --yes-command "systemctl poweroff" --query "Shutdown?"
;;
$reboot)
promptmenu --yes-command "systemctl reboot" --query "Reboot?"
;;
$lock)
light-locker-command -l
;;
$suspend)
mpc -q pause
amixer set Master mute
systemctl suspend
;;
$log_out)
i3-msg exit
;;
esac

View File

@@ -0,0 +1,58 @@
#!/bin/bash
rofi_command="rofi -theme themes/promptmenu.rasi"
### Options ###
yes_text="Confirm"
no_text="Cancel"
query="Are you sure?"
# Parse the args
if [[ $# -eq 0 ]]; then
echo -e "Usage: \e[100m \e[32mpromptmenu\e[39;100m -y <command> \e[0m"
echo -e "All the options:\n" \
"\e[34mOPTIONNAL \e[39;100m [ -o | --yes-text ] <text> \e[0m\n" \
"\e[34mOPTIONNAL \e[39;100m [ -c | --no-text ] <text> \e[0m\n" \
"\e[35mREQUIRED \e[39;100m [ -y | --yes-command ] <command> \e[0m\n" \
"\e[34mOPTIONNAL \e[39;100m [ -n | --no-command ] <command> \e[0m\n" \
"\e[34mOPTIONNAL \e[39;100m [ -q | --query ] txt \e[0m"
exit 1
else
while [ $# -ne 0 ]; do
case "$1" in
-o | --yes-text) # Optionnal
[ -n "$2" ] && yes_text="$2" || yes_text=""
shift
;;
-c | --no-text) # Optionnal
[ -n "$2" ] && no_text="$2" || no_text=""
shift
;;
-y | --yes-command) # Required
[ -n "$2" ] && yes_command="$2"
shift
;;
-n | --no-command) # Optionnal
[ -n "$2" ] && no_command="$2"
shift
;;
-q | --query) # Optionnal
[ -n "$2" ] && query="$2"
shift
;;
esac
shift
done
fi
# Variable passed to rofi
options="$yes_text\n$no_text"
chosen="$(echo -e "$options" | $rofi_command -p "$query" -dmenu -a 0 -u 1 -selected-row 1)"
case $chosen in
$yes_text)
eval "$yes_command"
;;
$no_text)
eval "$no_command"
;;
esac

View File

@@ -0,0 +1,24 @@
#!/bin/bash
rofi_command="rofi -theme themes/scrotmenu.rasi"
### Options ###
screen=""
area=""
window=""
# Variable passed to rofi
options="$screen\n$area\n$window"
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 1)"
case $chosen in
$screen)
sleep 1; scrot
;;
$area)
scrot -s
;;
$window)
sleep 1; scrot -u
;;
esac

View File

@@ -0,0 +1,49 @@
/**
* This theme is intended for a 8x2 items list menu with a headerbar.
*/
@import "shared/settings.rasi"
* {
background-color: @background;
text-color: @foreground-list;
font: @text-font;
}
#window {
padding: @list-8-window-padding;
}
inputbar,
prompt,
textbox-prompt-colon,
entry {
background-color: @background-light;
}
#inputbar {
children: [ prompt, textbox-prompt-colon, entry ];
margin: @inputbar-margin;
}
#prompt {
padding: @prompt-padding;
background-color: @accent;
text-color: @background;
}
#textbox-prompt-colon {
expand: false;
str: " : : ";
padding: @apps-textbox-prompt-colon-padding;
}
#entry {
text-color: @accent;
padding: @entry-padding;
}
#element {
padding: @list-element-padding;
margin: @list-element-margin;
border: @list-element-border;
background-color: @background-light;
border-color: @background-light;
}
#element.selected {
background-color: @background-focus;
text-color: @accent;
border-color: @accent;
}

View File

@@ -0,0 +1,55 @@
/**
* This theme is intended for a 8 items list menu with a headerbar.
*/
configuration {
show-icons: false;
columns: 1;
}
@import "shared/settings.rasi"
* {
background-color: @background;
text-color: @foreground-list;
font: @text-font-mono;
}
#window {
padding: @list-8-window-padding;
}
inputbar,
prompt,
textbox-prompt-colon,
entry {
background-color: @background-light;
}
#inputbar {
children: [ prompt, textbox-prompt-colon, entry ];
margin: @inputbar-margin;
}
#prompt {
padding: @prompt-padding;
background-color: @accent;
text-color: @background;
}
#textbox-prompt-colon {
expand: false;
str: "  ";
text-color: @accent;
padding: @i3keybindings-textbox-prompt-colon-padding;
font: @icon-font-small;
}
#entry {
text-color: @accent;
padding: @entry-padding;
}
#element {
padding: @list-element-padding;
margin: @list-element-margin;
border: @list-element-border;
background-color: @background-light;
border-color: @background-light;
}
#element.selected {
background-color: @background-focus;
text-color: @accent;
border-color: @accent;
}

View File

@@ -0,0 +1,12 @@
/**
* This theme is intended for a 3 items option menu.
*/
@import "shared/option-menu.rasi"
#window {
padding: @option-3-window-padding;
}
#listview {
spacing: @option-3-listview-spacing;
lines: 3;
}

View File

@@ -0,0 +1 @@
scrotmenu.rasi

View File

@@ -0,0 +1,67 @@
/**
* This theme is intended for a 6 items option menu with a headerbar.
*/
@import "shared/option-menu.rasi"
* {
font: @text-font;
}
#window {
padding: @mpd-window-padding;
children: [ inputbar, horibox ];
}
#inputbar {
children: [ textbox-prompt-colon, prompt ];
margin: @mpd-inputbar-margin;
}
prompt,
textbox-prompt-colon {
padding: @mpd-prompt-padding;
border: 2px;
border-color: @accent;
}
#prompt {
margin: @mpd-prompt-margin;
background-color: @background-light;
text-color: @accent;
}
#textbox-prompt-colon {
expand: false;
str: "mpd";
background-color: @accent;
text-color: @background;
}
#horibox {
padding: 0px;
}
#listview {
spacing: @option-6-listview-spacing;
lines: 6;
}
#element {
font: @icon-font;
border: @mpd-element-border;
padding: @mpd-element-padding;
border-color: @background-light;
}
#element.selected {
border-color: @accent;
}
element.active,
element.selected.urgent {
background-color: @on;
text-color: @background;
border-color: @on;
}
element.selected.urgent {
border-color: @accent;
}
element.urgent,
element.selected.active {
background-color: @off;
text-color: @background;
border-color: @off;
}
element.selected.active {
border-color: @accent;
}

View File

@@ -0,0 +1,55 @@
/**
* This theme is intended for a 8 items list menu with a headerbar.
*/
configuration {
show-icons: false;
columns: 1;
}
@import "shared/settings.rasi"
* {
background-color: @background;
text-color: @foreground-list;
font: @text-font-mono;
}
#window {
padding: @list-8-window-padding;
}
inputbar,
prompt,
textbox-prompt-colon,
entry {
background-color: @background-light;
}
#inputbar {
children: [ prompt, textbox-prompt-colon, entry ];
margin: @inputbar-margin;
}
#prompt {
padding: @prompt-padding;
background-color: @accent;
text-color: @background;
}
#textbox-prompt-colon {
expand: false;
str: " 直 ";
text-color: @accent;
padding: @network-textbox-prompt-colon-padding;
font: @icon-font-small;
}
#entry {
text-color: @accent;
padding: @entry-padding;
}
#element {
padding: @list-element-padding;
margin: @list-element-margin;
border: @list-element-border;
background-color: @background-light;
border-color: @background-light;
}
#element.selected {
background-color: @background-focus;
text-color: @accent;
border-color: @accent;
}

View File

@@ -0,0 +1,61 @@
/**
* This theme is intended for a 8 items list on a 1920x1080 pixels resolution.
* You may have to tweak values such as the window padding if you have a different resolution.
*/
@import "shared/settings.rasi"
* {
background-color: @background;
text-color: @foreground-list;
font: @text-font;
}
#window {
padding: @list-8-window-padding;
}
inputbar,
prompt,
textbox-prompt-colon,
entry {
background-color: @background-light;
}
#inputbar {
children: [ prompt, textbox-prompt-colon, entry ];
margin: @inputbar-margin;
}
#prompt {
padding: @prompt-padding;
text-color: @background;
}
#textbox-prompt-colon {
expand: false;
str: " 﫸 ";
text-color: @accent;
padding: @nmvpn-textbox-prompt-colon-padding;
font: @icon-font-small;
}
#entry {
text-color: @accent;
padding: @entry-padding;
}
#element {
padding: @list-element-padding;
margin: @list-element-margin;
border: @list-element-border;
background-color: @background-light;
border-color: @background-light;
}
#element.selected {
background-color: @background-focus;
text-color: @accent;
border-color: @accent;
}
#element.active {
background-color: @on;
text-color: @background;
border-color: @on;
}
#element.selected.active {
background-color: @off;
text-color: @background;
border-color: @accent;
}

View File

@@ -0,0 +1,13 @@
/**
* This theme is intended for a 5 items wide menu on a 1920x1080 pixels resolution.
* You may have to tweak values such as the window padding if you have a different resolution.
*/
@import "shared/option-menu.rasi"
#window {
padding: @option-5-window-padding;
}
#listview {
spacing: @option-5-listview-spacing;
lines: 5;
}

View File

@@ -0,0 +1,41 @@
/**
* This theme is intended for a 2 items option menu with a headerbar.
*/
@import "shared/option-menu.rasi"
* {
font: @text-font;
}
#window {
height: @confirm-window-height;
width: @confirm-window-width;
children: [ inputbar, horibox ];
border: @confirm-window-border;
border-color: @accent;
}
#inputbar {
children: [ prompt ];
}
#prompt {
padding: @confirm-prompt-padding;
margin: @confirm-prompt-margin;
background-color: @accent;
text-color: @background-light;
}
#listview {
padding: @confirm-listview-padding;
spacing: @option-5-listview-spacing;
lines: 2;
}
#element {
font: @confirm-text-font;
padding: @confirm-element-padding;
}
element.selected.urgent {
background-color: @off;
text-color: @background;
}
element.selected.active {
background-color: @on;
text-color: @background;
}

View File

@@ -0,0 +1,13 @@
/**
* This theme is intended for a 3 items wide menu on a 1920x1080 pixels resolution.
* You may have to tweak values such as the window padding if you have a different resolution.
*/
@import "shared/option-menu.rasi"
#window {
padding: @option-3-window-padding;
}
#listview {
spacing: @option-3-listview-spacing;
lines: 3;
}

View File

@@ -0,0 +1,10 @@
* {
accent: #ffbf00;
background: #1c1c1c;
background-light: #1f1f1f;
background-focus: #282828;
foreground: #888888;
foreground-list: #bbbbbb;
on: #44ad4d;
off: #e34039;
}

View File

@@ -0,0 +1,10 @@
* {
accent: #963ad0;
background: #1c1c1c;
background-light: #1f1f1f;
background-focus: #282828;
foreground: #888888;
foreground-list: #bbbbbb;
on: #44ad4d;
off: #e34039;
}

View File

@@ -0,0 +1,10 @@
* {
accent: #83a598;
background: #282828;
background-light: #282828;
background-focus: #1d2021;
foreground: #ebdbb2;
foreground-list: #ebdbb2;
on: #83a598;
off: #fb4934;
}

View File

@@ -0,0 +1,10 @@
* {
accent: #6699ff;
background: #f2f2f2;
background-light: #e2e2e2;
background-focus: #d2d2d2;
foreground: #333333;
foreground-list: #222222;
on: #44ad4d;
off: #e34039;
}

View File

@@ -0,0 +1,10 @@
* {
accent: #81a1c1;
background: #2e3440;
background-light: #3b4252;
background-focus: #4c566a;
foreground: #eceff4;
foreground-list: #d8dee9;
on: #a3be8c;
off: #bf616a;
}

View File

@@ -0,0 +1,31 @@
/**
* Settings used in every rofi option menu:
* - i3layoutmenu
* - mpdmenu
* - powermenu
* - scrotmenu
*/
@import "settings.rasi"
* {
background-color: @background;
text-color: @foreground;
font: @icon-font;
}
#window {
children: [ horibox ];
}
#horibox {
children: [ listview ];
}
#listview {
layout: horizontal;
}
#element {
padding: @option-element-padding;
background-color: @background-light;
}
#element.selected {
background-color: @accent;
text-color: @background;
}

View File

@@ -0,0 +1,54 @@
* {
/* General */
prompt-text-font: "Hurmit Nerd Font Mono 18";
text-font: "Comfortaa Bold 14";
text-font-mono: "RobotoMono Nerd Font Regular 14";
icon-font: "Hurmit Nerd Font Mono 50";
icon-font-small: "Hurmit Nerd Font Mono 24";
inputbar-margin: 4px 4px;
prompt-padding: 14px 18px;
entry-padding: 16px 14px 14px 0px;
/* promptmenu */
prompt-window-height: 300px;
prompt-window-width: 600px;
prompt-window-border: 2px;
prompt-prompt-padding: 20px 30px;
prompt-prompt-margin: 8px;
prompt-listview-padding: 60px 114px 0px 114px;
/* Values bellow are 'no-padding' ones for a size 18 (@prompt-text-font) font, played around using this character: ■
* We then add add 30 actual padding around the text.
* -4px -1px -6px -28px */
prompt-element-padding: 26px 29px 24px 2px;
/* list menus: appsmenu, networkmenu and nmvpnmenu */
list-element-padding: 13px;
list-element-margin: @inputbar-margin;
list-element-border: 0px 0px 0px 8px;
list-8-window-padding: 120px 100px;
/* option menus: i3layoutmenu, mpdmenu, powermenu and scrotmenu */
/**
* Values bellow are 'no-padding' ones for a size 50 (@icon-font) font, played around using this character: ■
* We then add add 70 actual padding around the icons.
* -10px 0px -15px -79px */
option-element-padding: 60px 70px 55px -9px;
option-3-window-padding: 293px 271px;
option-3-listview-spacing: 140px;
option-5-window-padding: 293px 130px;
option-5-listview-spacing: 50px;
option-6-listview-spacing: 30px;
/* appsmenu */
apps-textbox-prompt-colon-padding: 16px;
/* mpdmenu */
mpd-window-padding: 257px 64px;
mpd-inputbar-margin: 10px 0px;
mpd-prompt-padding: 14px 20px 10px 20px;
mpd-prompt-margin: 0px 0px 0px -2px;
mpd-element-border: 12px;
/* Every @option-element-padding minus @mpd-element-border */
mpd-element-padding: 48px 58px 43px -21px;
/* networkmenu */
network-textbox-prompt-colon-padding: 12px 10px 8px 10px;
/* nmvpnmenu */
nmvpn-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding;
/* i3keybindings */
i3keybindings-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding;
}

View File

@@ -0,0 +1,54 @@
* {
/* General */
confirm-text-font: "Hurmit Nerd Font Mono 18";
text-font: "Comfortaa Bold 14";
text-font-mono: "RobotoMono Nerd Font Regular 14";
icon-font: "Hurmit Nerd Font Mono 60";
icon-font-small: "Hurmit Nerd Font Mono 24";
inputbar-margin: 4px 4px;
prompt-padding: 16px 20px;
entry-padding: 18px 16px 16px 0px;
/* confirmmenu */
confirm-window-height: 300px;
confirm-window-width: 627px;
confirm-window-border: 2px;
confirm-prompt-padding: 20px 30px;
confirm-prompt-margin: 8px;
confirm-listview-padding: 60px 114px 0px 114px;
/* Values bellow are 'no-padding' ones for a size 18 (@confirm-text-font) font, played around using this character: ■
* We then add add 30 actual padding around the text.
* -4px -1px -6px -28px */
confirm-element-padding: 26px 29px 24px 2px;
/* list menus: appsmenu, networkmenu and nmvpnmenu */
list-element-padding: 20px;
list-element-margin: @inputbar-margin;
list-element-border: 0px 0px 0px 8px;
list-8-window-padding: 219px 360px;
/* option menus: i3layoutmenu, mpdmenu, powermenu and scrotmenu */
/**
* Values bellow are 'no-padding' ones for a size 60 (@icon-font) font, played around using this character: ■
* We then add add 100 actual padding around the icons.
* -12px 0px -19px -96px */
option-element-padding: 88px 100px 81px 4px;
option-3-window-padding: 415px 446px;
option-3-listview-spacing: 140px;
option-5-window-padding: 415px 183px;
option-5-listview-spacing: 77px;
option-6-listview-spacing: 50px;
/* appsmenu */
apps-textbox-prompt-colon-padding: 16px;
/* mpdmenu */
mpd-window-padding: 379px 111px;
mpd-inputbar-margin: 10px 0px;
mpd-prompt-padding: 14px 20px 10px 20px;
mpd-prompt-margin: 0px 0px 0px -2px;
mpd-element-border: 12px;
/* Every @option-element-padding minus @mpd-element-border */
mpd-element-padding: 76px 88px 69px -16px;
/* networkmenu */
network-textbox-prompt-colon-padding: 14px 10px 10px 10px;
/* nmvpnmenu */
nmvpn-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding;
/* i3keybindings */
i3keybindings-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding;
}

View File

@@ -0,0 +1,11 @@
/**
* Allows to change the settings of every menu simply by editing this file
*/
@import "colorschemes/dark-steel-blue.rasi"
@import "resolutions/1920x1080.rasi"
#window {
width: 100%;
height: 100%;
}