Add dialog styles, update sway and waybar

This commit is contained in:
Dejvino 2021-01-10 19:44:05 +01:00
parent 7a1efb8737
commit dbac2f1ba5
4 changed files with 555 additions and 80 deletions

View File

@ -15,6 +15,7 @@ Linux UI customized to resemble a Fallout Pip-Boy. To be used with the PINE64 Pi
- mako: Notifications daemon
- mpd: Music player daemon
- xfmpc: Music player client
- mplayer: Sound effects player
## Dependencies
- [Sway on PinePhone](https://github.com/Dejvino/pinephone-sway-poc)
@ -31,6 +32,14 @@ cd PinePhoneBoyOS
...
```
### Virtual Keyboard (Squeekboard)
Terminal layout replaces (default) English layout:
```bash
mkdir -p ~/.local/share/squeekboard/keyboards/
wget https://source.puri.sm/Librem5/squeekboard/-/raw/master/data/keyboards/terminal_wide.yaml -O ~/.local/share/squeekboard/keyboards/us_wide.yaml
```
Source: [puri.sm](https://developer.puri.sm/projects/squeekboard/tutorial.html)
### Theme
```bash
git clone https://github.com/i-mint/midnight
@ -61,7 +70,15 @@ gsettings set org.gnome.desktop.interface icon-theme "Abyss-ENVY"
# reboot to see it during the next startup
```
### Radio - MPD
### DATA - Epiphany
Source: [ArchWiki](https://wiki.archlinux.org/index.php/GNOME/Web)
#### Ad blocking
```bash
gsettings set org.gnome.Epiphany adblock-filters "['https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', 'https://easylist.to/easylist/fanboy-annoyance.txt', 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext', 'https://www.malwaredomainlist.com/hostslist/hosts.txt', 'https://mirror.cedia.org.ec/malwaredomains/justdomains']"
```
### RADIO - MPD
Packages: mpd xfmpc mpc
```bash
mkdir -p ~/.config/mpd/playlists

144
config/.dialogrc Normal file
View File

@ -0,0 +1,144 @@
#
# Run-time configuration file for dialog
#
# Automatically generated by "dialog --create-rc <file>"
#
#
# Types of values:
#
# Number - <number>
# String - "string"
# Boolean - <ON|OFF>
# Attribute - (foreground,background,highlight?,underline?,reverse?)
# Set aspect-ration.
aspect = 0
# Set separator (for multiple widgets output).
separate_widget = ""
# Set tab-length (for textbox tab-conversion).
tab_len = 0
# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF
# Shadow dialog boxes? This also turns on color.
use_shadow = OFF
# Turn color support ON or OFF
use_colors = ON
# Screen color
screen_color = (GREEN,BLACK,OFF)
# Shadow color
shadow_color = (BLACK,BLACK,OFF)
# Dialog box color
dialog_color = (GREEN,BLACK,OFF)
# Dialog box title color
title_color = (GREEN,BLACK,OFF)
# Dialog box border color
border_color = (GREEN,BLACK,OFF)
# Active button color
button_active_color = (BLACK,GREEN,ON)
# Inactive button color
button_inactive_color = dialog_color
# Active button key color
button_key_active_color = button_active_color
# Inactive button key color
button_key_inactive_color = (GREEN,BLACK,ON)
# Active button label color
button_label_active_color = (BLACK,GREEN,ON)
# Inactive button label color
button_label_inactive_color = (GREEN,BLACK,ON)
# Input box color
inputbox_color = dialog_color
# Input box border color
inputbox_border_color = dialog_color
# Search box color
searchbox_color = dialog_color
# Search box title color
searchbox_title_color = title_color
# Search box border color
searchbox_border_color = border_color
# File position indicator color
position_indicator_color = title_color
# Menu box color
menubox_color = dialog_color
# Menu box border color
menubox_border_color = border_color
# Item color
item_color = dialog_color
# Selected item color
item_selected_color = button_active_color
# Tag color
tag_color = title_color
# Selected tag color
tag_selected_color = button_label_active_color
# Tag key color
tag_key_color = button_key_inactive_color
# Selected tag key color
tag_key_selected_color = (BLACK,GREEN,ON)
# Check box color
check_color = dialog_color
# Selected check box color
check_selected_color = button_active_color
# Up arrow color
uarrow_color = (BLACK,GREEN,ON)
# Down arrow color
darrow_color = uarrow_color
# Item help-text color
itemhelp_color = (GREEN,BLACK,OFF)
# Active form text color
form_active_text_color = button_active_color
# Form text color
form_text_color = (GREEN,BLACK,ON)
# Readonly form item color
form_item_readonly_color = (CYAN,WHITE,ON)
# Dialog box gauge color
gauge_color = title_color
# Dialog box border2 color
border2_color = dialog_color
# Input box border2 color
inputbox_border2_color = dialog_color
# Search box border2 color
searchbox_border2_color = dialog_color
# Menu box border2 color
menubox_border2_color = dialog_color

View File

@ -1,3 +1,25 @@
# Read `man 5 sway` for a complete reference.
### Variables
#
# Mod4 = Logo key. Mod1 = Alt.
# Using Mod1 for now since nothing better is available on the virtual keyboard.
set $mod Mod1
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term termite
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
set $menu bemenu-run -n -p RUN | xargs swaymsg exec --
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
@ -11,6 +33,90 @@ set $BLACK "#000000FF"
client.focused $GREEN $BLACK $GREEN $LGREEN $DGREEN
client.unfocused $DGREEN $BLACK $DGREEN $DGREEN $DGREEN
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' \
# resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+q kill
# Start your launcher
bindsym $mod+d exec $menu
# Drag floating windows by holding down $mod and left mouse button.
# Resize them with right mouse button + $mod.
# Despite the name, also works for non-floating windows.
# Change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# Reload the configuration file
bindsym $mod+Ctrl+c reload
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
@ -30,6 +136,13 @@ client.unfocused $DGREEN $BLACK $DGREEN $DGREEN $DGREEN
set $WMAP $W4
set $WRADIO $W5
set $DSI1 "DSI-1"
workspace $WSTAT output $DSI1
workspace $WINV output $DSI1
workspace $WDATA output $DSI1
workspace $WMAP output $DSI1
workspace $WRADIO output $DSI1
# Switch to workspace
bindsym $mod+1 workspace $W1
bindsym $mod+2 workspace $W2
@ -54,6 +167,68 @@ client.unfocused $DGREEN $BLACK $DGREEN $DGREEN $DGREEN
bindsym $mod+Shift+0 move container to workspace $W10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Move focus to the parent container
bindsym $mod+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Power Button
@ -61,19 +236,26 @@ client.unfocused $DGREEN $BLACK $DGREEN $DGREEN $DGREEN
set $pplock 'swayphone_power_sleep'
set $ppunlock 'swayphone_power_wakeup'
set $lockapp swaylock
set $lock '$lockapp -f -c 000000'
set $lock '$lockapp -f -c 005500'
set $unlock 'killall $lockapp'
## wish this worked...
#bindsym XF86PowerOff exec $lock
#bindsym --locked XF86PowerOff exec $unlock
# alternative:
bindcode 124 exec $lock; exec $pplock
bindcode --locked 124 exec $unlock; exec $ppunlock
#bindcode 124 exec $lock; exec $pplock
#bindcode --locked 124 exec $ppunlock
bindcode 124 exec '$lock ; swayphone_power_presleep'
bindcode --locked 124 exec '$unlock ; swayphone_power_wakeup'
exec swayidle -w \
timeout 15 'swaymsg exec $lock; $pplock' \
resume 'swaymsg exec $unlock; $ppunlock' \
before-sleep 'swaymsg exec $lock; $pplock'
timeout 30 'pptk-backlight set_percent 10' \
resume 'swayphone_power_wakeup' \
timeout 60 'swayphone_power_rest' \
resume 'swayphone_power_wakeup' \
timeout 120 'swayphone_power_sleep' \
before-sleep 'swayphone_power_presleep' \
after-resume 'killall swaylock; swayphone_power_wakeup' \
unlock 'killall swaylock'
# Scale the touchscreen LCD UI
output DSI-1 scale 2
@ -84,23 +266,59 @@ input 1046:4097:Goodix_Capacitive_TouchScreen map_to_output DSI-1
#output DSI-1 transform 90
output DSI-1 transform 270
# Display rotation daemon
#exec 'rot8 --display DSI-1 --threshold 0.97 --x-file /sys/bus/iio/devices/iio:device2/in_accel_y_raw --y-file /sys/bus/iio/devices/iio:device2/in_accel_x_raw --y-invert --on-change swayphone_rotated'
# Keyboard
exec "squeekboard"
# Gesture detection
#exec lisgd \
# -g "1,l,r, false" \
# -g "1,r,l, false" \
# -g "1,u,d, false" \
# -g "1,d,u, false" \
# -g "2,l,r, swaymsg workspace prev" \
# -g "2,r,l, swaymsg workspace next" \
# -g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
# -g "2,d,u, swaymsg exec swayphone_keyboard_show" \
# -g "2,l,u, swaymsg fullscreen" \
# -g "2,r,d, swaymsg kill" \
# -g "3,l,r, swaymsg focus right" \
# -g "3,r,l, swaymsg focus left" \
# -g "3,u,d, swaymsg focus down" \
# -g "3,d,u, swaymsg focus up" \
# -g "4,l,r, swaymsg move right" \
# -g "4,r,l, swaymsg move left" \
# -g "4,u,d, swaymsg move down" \
# -g "4,d,u, swaymsg move up"
# Status Bar
exec "waybar -c ~/.config/waybar/config -b side"
exec "waybar -c ~/.config/waybar/config_left -b side_left"
# side
exec "rm /tmp/sway_rotation"
exec "waybar -c ~/.config/waybar/config"
#exec "waybar -c ~/.config/waybar/config_left -b side_left"
#exec "sleep 2 ; kill -10 `pgrep -f 'waybar.*-b side'`"
#exec "waybar -c ~/.config/waybar/config_0 -b top"
#exec "waybar -c ~/.config/waybar/config_1 -b bottom"
# Restore backlight
exec 'swayphone_power_wakeup'
# STAT
# ??
# INV
exec "portfolio-fm"
for_window [app_id="portfolio-fm"] move workspace $WINV; border none
for_window [app_id="portfolio-fm"] move workspace $WINV
# DATA
exec "epiphany"
for_window [app_id="epiphany"] move workspace $WDATA; border none
for_window [app_id="epiphany"] move workspace $WDATA
# MAP
exec "gnome-maps"
for_window [app_id="org.gnome.Maps"] move workspace $WMAP; border none
# RADIO
exec "killall mpd ; mpd"
@ -111,3 +329,6 @@ for_window [app_id="xfmpc"] move workspace $WRADIO; border none
exec "mako" # notify daemon
exec "sleep 2; notify-send 'Welcome!' 'Your Pip-Boy is ready to be used.' --icon=dialog-information"
# Sounds
exec "killall workspace_sounds_daemon ; killall mplayer ; workspace_sounds_daemon"

View File

@ -1,37 +1,25 @@
[
// TOUCHSCREEN > RIGHT PANEL
{
//GLOBAL
"layer": "top",
"position": "right", // or "left"
"position": "right",
"width": 100,
"output": "DSI-1",
"modules-left": [
"clock#time",
"clock#date",
//"battery", // broken for some reason...
"sway/workspaces"
"sway/workspaces",
"tray"
],
"modules-center": [
],
"modules-right": [
// "cpu",
// "memory",
// "disk",
// "network",
// "backlight",
// "pulseaudio",
"custom/terminal",
"custom/kill",
"tray"
"custom/kill"
],
//MODULES
"clock#time": {
"interval": 10,
"locale": "C",
@ -41,7 +29,6 @@
"on-click": "termite -e swayphone_menuselect"
},
"clock#date": {
"interval": 20,
"locale": "C",
@ -52,50 +39,11 @@
"on-click": "termite -e swayphone_menuselect"
},
"battery": {
"interval": 1,
"states": {
"warning": 30,
"critical": 15
},
/*
// Connected to AC
"format": " {capacity}%", // Icon: bolt
// Not connected to AC
"format-discharging": " {capacity}%",
"format-icons": [
"", // Icon: battery-full
"", // Icon: battery-three-quarters
"", // Icon: battery-half
"", // Icon: battery-quarter
"" // Icon: battery-empty
],
*/
// Connected to AC
"format": "CH {capacity}%", // Icon: bolt
// Not connected to AC
"format-discharging": "D {capacity}%",
"format-icons": [
"4/4", // Icon: battery-full
"3/4", // Icon: battery-three-quarters
"2/4", // Icon: battery-half
"1/4", // Icon: battery-quarter
"0/4" // Icon: battery-empty
],
"tooltip": false,
// "bat": "axp20x-battery",
// "adapter": "axp20x-usb",
"on-click": "termite -e \"~/battery.sh ; sleep 5\""
},
"sway/mode": {
"format": "<span style=\"italic\"> {}</span>",
"tooltip": true
},
"sway/workspaces": {
"all-outputs": false,
"disable-scroll": true,
@ -119,7 +67,7 @@
"custom/kill": {
"on-click": "swaymsg kill",
"format": "💀"
"format": ""
},
"custom/terminal": {
@ -127,6 +75,74 @@
"format": "#>_"
},
"network": {
"interval": 5,
"format-wifi": "  {essid}", // Icon: wifi
"format-ethernet": " {ifname}", // Icon: ethernet
"format-disconnected": "Disconnected",
"tooltip-format": "{ifname}: {ipaddr}",
"on-click": "swaymsg exec \"termite -e nmtui\""
},
"tray": {
"icon-size": 22
//"spacing": 10
},
},
// TOUCHSCREEN > LEFT PANEL
{
"layer": "top",
"position": "left",
"width": 15,
"output": "DSI-1",
"modules-left": [
"cpu",
"memory",
//"battery", // broken for some reason...
"custom/battery",
"temperature",
"disk",
"backlight",
"pulseaudio",
],
"modules-center": [
],
"modules-right": [
//"custom/terminal",
"custom/keyshow",
"custom/keyhide"
],
"custom/battery": {
"exec": "waybar_battery",
"interval": "2",
"return-type": "json",
"format": "⚛ {}"
},
"custom/kill": {
"on-click": "swaymsg kill",
"format": "☠"
},
"custom/keyshow": {
"on-click": "swayphone_keyboard_show",
"format": "K↥"
},
"custom/keyhide": {
"on-click": "swayphone_keyboard_hide",
"format": "K↧"
},
"custom/terminal": {
"on-click": "termite",
"format": ">_"
},
"cpu": {
"interval": 5,
@ -139,7 +155,6 @@
"on-click": "termite -e \"htop --sort-key=PERCENT_CPU\""
},
"memory": {
"interval": 5,
"format": " {}%", // Icon: memory
@ -150,6 +165,14 @@
"on-click": "termite -e \"htop --sort-key=PERCENT_MEM\""
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 60,
"format-critical": " {temperatureC}°C",
"format": " {temperatureC}°C"
},
"network": {
"interval": 5,
"format-wifi": "  {essid}", // Icon: wifi
@ -178,10 +201,11 @@
"disk": {
"interval": 5,
"format": " {percentage_used:2}%",
"format": "✇ {percentage_used:2}%", // alt: 
"path": "/"
},
"backlight": {
// "device": "acpi_video1",
"format": "{icon} {percent}% ",
@ -189,16 +213,85 @@
"format-icons": ["", ""],
"on-click": "termite -e swayphone_backlightselect"
},
},
// EXTERNAL MONITOR
{
"layer": "top",
"position": "bottom",
"width": 100,
"output": "!DSI-1",
"modules-left": [
"sway/workspaces#monitor"
],
"modules-center": [
"clock#time"
],
"modules-right": [
"tray",
"clock#date"
],
"clock#time": {
"interval": 10,
"locale": "C",
"timezone": "Europe/Berlin",
"format": " {:%H:%M}",
"tooltip": false,
"on-click": "termite -e swayphone_menuselect"
},
"clock#date": {
"interval": 20,
"locale": "C",
"timezone": "Europe/Berlin",
"format": " {:%e %b %Y}", // Icon: calendar-alt
//"tooltip-format": "{:%e %B %Y}"
"tooltip": true,
"on-click": "termite -e swayphone_menuselect"
},
"sway/mode": {
"format": "<span style=\"italic\"> {}</span>",
"tooltip": true
},
"sway/workspaces#monitor": {
"all-outputs": false,
"disable-scroll": true,
/*"persistent_workspaces": {
"6:": [],
"7:": [],
"8:": [],
"9:": [],
"0:": []
},*/
"format": "{name}",
"format-icons": {
//"1:T": "", // Icon: terminal
"3:F": "龜", // Icon: firefox-browser
"8:M": "", // Icon: mail
"urgent": "",
"focused": "",
"default": ""
}
},
"network": {
"interval": 5,
"format-wifi": "  {essid}", // Icon: wifi
"format-ethernet": " {ifname}", // Icon: ethernet
"format-disconnected": "Disconnected",
"tooltip-format": "{ifname}: {ipaddr}",
"on-click": "swaymsg exec \"termite -e nmtui\""
},
"tray": {
"icon-size": 22
//"spacing": 10
},
"custom/bar": {
"format": "",
"tooltip": false
}
}
]