feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Collection of quirks and blacklist/whitelists for specific devices.
|
||||
|
||||
|
||||
# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
|
||||
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
|
||||
Section "InputClass"
|
||||
Identifier "ThinkPad HDAPS accelerometer blacklist"
|
||||
MatchProduct "ThinkPad HDAPS accelerometer data"
|
||||
Option "Ignore" "on"
|
||||
EndSection
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=523914
|
||||
# Mouse does not move in PV Xen guest
|
||||
# Explicitly tell evdev to not ignore the absolute axes.
|
||||
Section "InputClass"
|
||||
Identifier "Xen Virtual Pointer axis blacklist"
|
||||
MatchProduct "Xen Virtual Pointer"
|
||||
Option "IgnoreAbsoluteAxes" "off"
|
||||
Option "IgnoreRelativeAxes" "off"
|
||||
EndSection
|
||||
|
||||
# https://bugs.freedesktop.org/show_bug.cgi?id=55867
|
||||
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
|
||||
Section "InputClass"
|
||||
Identifier "Tag trackballs as XI_TRACKBALL"
|
||||
MatchProduct "trackball"
|
||||
MatchDriver "evdev"
|
||||
Option "TypeName" "TRACKBALL"
|
||||
EndSection
|
||||
|
||||
# https://bugs.freedesktop.org/show_bug.cgi?id=62831
|
||||
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
|
||||
Section "InputClass"
|
||||
Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
|
||||
MatchProduct "La-VIEW Technology Naos 5000 Mouse"
|
||||
MatchDriver "evdev"
|
||||
Option "TypeName" "MOUSE"
|
||||
EndSection
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2152414
|
||||
# Xorg server does not correctly select the DCP for the display without
|
||||
# a quirk on Apple Silicon
|
||||
Section "OutputClass"
|
||||
Identifier "appledrm"
|
||||
MatchDriver "apple"
|
||||
Driver "modesetting"
|
||||
Option "PrimaryGPU" "true"
|
||||
EndSection
|
||||
@@ -0,0 +1,52 @@
|
||||
# Match on all types of devices but joysticks
|
||||
#
|
||||
# If you want to configure your devices, do not copy this file.
|
||||
# Instead, use a config snippet that contains something like this:
|
||||
#
|
||||
# Section "InputClass"
|
||||
# Identifier "something or other"
|
||||
# MatchDriver "libinput"
|
||||
#
|
||||
# MatchIsTouchpad "on"
|
||||
# ... other Match directives ...
|
||||
# Option "someoption" "value"
|
||||
# EndSection
|
||||
#
|
||||
# This applies the option any libinput device also matched by the other
|
||||
# directives. See the xorg.conf(5) man page for more info on
|
||||
# matching devices.
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput pointer catchall"
|
||||
MatchIsPointer "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
EndSection
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput keyboard catchall"
|
||||
MatchIsKeyboard "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
EndSection
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput touchpad catchall"
|
||||
MatchIsTouchpad "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
EndSection
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput touchscreen catchall"
|
||||
MatchIsTouchscreen "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
EndSection
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput tablet catchall"
|
||||
MatchIsTablet "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
EndSection
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.impl.portal.PermissionStore
|
||||
Exec=/bin/true
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.impl.portal.desktop.gtk
|
||||
Exec=/bin/true
|
||||
@@ -0,0 +1,3 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.portal.Desktop
|
||||
Exec=/bin/true
|
||||
@@ -0,0 +1,3 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.portal.Documents
|
||||
Exec=/bin/true
|
||||
@@ -0,0 +1,8 @@
|
||||
polkit.addRule(function(action, subject) {
|
||||
if ((action.id.indexOf("org.freedesktop.ModemManager1.") == 0 ||
|
||||
action.id.indexOf("org.freedesktop.login1.") == 0 ||
|
||||
action.id.indexOf("org.freedesktop.NetworkManager.") == 0) &&
|
||||
(subject.isInGroup("plugdev") || subject.isInGroup("wheel"))) {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
! Space to setup configversion
|
||||
! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
|
||||
|
||||
dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
|
||||
dmenu.background: #1c1c1c
|
||||
dmenu.foreground: #e0e0e0
|
||||
dmenu.selbackground: #005577
|
||||
dmenu.selforeground: #ffffff
|
||||
|
||||
dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
|
||||
dwm.normbgcolor: #323232
|
||||
dwm.normbordercolor: #444444
|
||||
dwm.normfgcolor: #dddddd
|
||||
dwm.selbgcolor: #005577
|
||||
dwm.selbordercolor: #005577
|
||||
dwm.selfgcolor: #ffffff
|
||||
|
||||
st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true
|
||||
st.background: #1c1c1c
|
||||
st.foreground: #e5e5e5
|
||||
st.cursorColor: #cccccc
|
||||
|
||||
svkbd.font: Fira Code:pixelsize=12
|
||||
@@ -1,18 +1,24 @@
|
||||
-- Space to setup configversion
|
||||
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
|
||||
conky.config = {
|
||||
out_to_x = false,
|
||||
out_to_wayland = true,
|
||||
output_backend = 'x11',
|
||||
out_to_x = true,
|
||||
out_to_wayland = false,
|
||||
own_window = true,
|
||||
own_window_type = 'override',
|
||||
own_window_transparent = true,
|
||||
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
|
||||
double_buffer = true,
|
||||
alignment = 'top_middle',
|
||||
gap_y = 12,
|
||||
own_window_argb_value = 0,
|
||||
own_window_type = 'desktop',
|
||||
gap_x = 0,
|
||||
gap_y = 34,
|
||||
default_color = 'white',
|
||||
default_shade_color = 'black',
|
||||
draw_shades = true,
|
||||
font = 'Sxmo:size=13',
|
||||
font = 'Fira Code:size=14:style=Regular',
|
||||
use_xft = true,
|
||||
update_interval = 15,
|
||||
}
|
||||
|
||||
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
|
||||
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
|
||||
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
|
||||
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
frame_width = 2
|
||||
frame_color = "#005577"
|
||||
idle_threshold = 120
|
||||
font = Monospace 12
|
||||
font = Fira Code 9.5
|
||||
markup = full
|
||||
max_icon_size = 24
|
||||
dmenu = sxmo_dmenu.sh -p dunst:
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- configversion: c90188e736e042ebe71879799645b0c4 -->
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<alias>
|
||||
<family>Sxmo</family>
|
||||
<prefer>
|
||||
<family>Fira Code</family>
|
||||
<family>DejaVu SansM Nerd Font</family>
|
||||
<family>Dejavu Sans Mono Nerd Font</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>Fira Code</family>
|
||||
<family>DejaVu SansM Nerd Font</family>
|
||||
<family>Dejavu Sans Mono Nerd Font</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias>
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
<family>Fira Code</family>
|
||||
<family>DejaVu SansM Nerd Font</family>
|
||||
<family>Dejavu Sans Mono Nerd Font</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias>
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
<family>Fira Code</family>
|
||||
<family>DejaVu SansM Nerd Font</family>
|
||||
<family>Dejavu Sans Mono Nerd Font</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
</fontconfig>
|
||||
@@ -1,40 +0,0 @@
|
||||
# Space to setup configversion
|
||||
# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
|
||||
font=monospace:size=13
|
||||
dpi-aware=no
|
||||
pad=2x2
|
||||
|
||||
[colors-dark]
|
||||
# alpha=1.0
|
||||
foreground=eaeaea
|
||||
background=000000
|
||||
regular0=000000 # black
|
||||
regular1=d54e53 # red
|
||||
regular2=b9ca4a # green
|
||||
regular3=e6c547 # yellow
|
||||
regular4=7aa6da # blue
|
||||
regular5=c397d8 # magenta
|
||||
regular6=70c0ba # cyan
|
||||
regular7=eaeaea # white
|
||||
bright0=666666 # bright black
|
||||
bright1=ff3334 # bright red
|
||||
bright2=9ec400 # bright green
|
||||
bright3=e7c547 # bright yellow
|
||||
bright4=7aa6da # bright blue
|
||||
bright5=b77ee0 # bright magenta
|
||||
bright6=54ced6 # bright cyan
|
||||
bright7=ffffff # bright white
|
||||
|
||||
[scrollback]
|
||||
lines=5000
|
||||
|
||||
[key-bindings]
|
||||
scrollback-up-page=Shift+Page_Up
|
||||
scrollback-down-page=Shift+Page_Down
|
||||
scrollback-up-half-page=Page_Up
|
||||
scrollback-down-half-page=Page_Down
|
||||
scrollback-up-line=Shift+Up
|
||||
scrollback-down-line=Shift+Down
|
||||
scrollback-home=Shift+Home
|
||||
scrollback-end=Shift+End
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
# configversion: e7cdaa3a889d251bed8a89ce8c622995
|
||||
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
# Please modify this file to your liking
|
||||
|
||||
# Important Instructions:
|
||||
# All processes you launch from this script must
|
||||
# be non-blocking: launch them in the background (using &)
|
||||
# or ensure they return quickly. Only after this script
|
||||
# finishes will the window manager be loaded
|
||||
|
||||
# You will sometime get SMS or calls from not
|
||||
# country code prefixed phone numbers. To make
|
||||
# it easy to fixup configure the default countryu.
|
||||
#export DEFAULT_COUNTRY=FR
|
||||
|
||||
### Configuration Parameters ###
|
||||
|
||||
# Note that this is just a subset of all available
|
||||
# parameters, see the sxmo documentation for more.
|
||||
|
||||
# Use firefox as default browser if installed
|
||||
command -v firefox >/dev/null && export BROWSER=firefox
|
||||
|
||||
# Prepopulate Subreddits menu with custom subreddits
|
||||
#export SXMO_SUBREDDITS="postmarketos pinephoneOfficial pinephone unixporn"
|
||||
|
||||
# Change the default terminal command
|
||||
export TERMCMD="sxmo_terminal.sh"
|
||||
|
||||
# Change the used terminal command
|
||||
# export SXMO_TERMINAL="st"
|
||||
|
||||
# When scrolling past the beginning or end of a menu, wrap it around:
|
||||
#export DMENU_WRAP_AROUND=1
|
||||
|
||||
# Enable audio feedback on keypress
|
||||
#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)"
|
||||
|
||||
# Or, enable vibration feedback on keypress
|
||||
#export KEYBOARD_ARGS="-o | clickclack -V"
|
||||
|
||||
# Set the scale factor in sway
|
||||
# export SXMO_SWAY_SCALE=2
|
||||
|
||||
# To load specific part of configuration depending on the running environment
|
||||
case "$SXMO_WM" in
|
||||
sway)
|
||||
;;
|
||||
dwm)
|
||||
;;
|
||||
esac
|
||||
|
||||
#Set RINGTONE to audio file to play for incoming call
|
||||
export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)"
|
||||
|
||||
#Set TEXTSOUND to audio file to play when received text message
|
||||
export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)"
|
||||
|
||||
#Set RINGTIME to number of seconds the phone will ring
|
||||
export SXMO_RINGTIME=20
|
||||
|
||||
#Set RINGNUMBER to number of times phone will ring or repeat ringtone
|
||||
#(whichever of SXMO_RINGTIME or SXMO_RINGNUMBER runs less will limit how long phone rings)
|
||||
export SXMO_RINGNUMBER=10
|
||||
|
||||
#Set to the default text for a new text message.
|
||||
export SXMO_DEFAULT_DRAFT="Enter new message here."
|
||||
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
export SXMO_WM="dwm"
|
||||
export SXMO_MENU="dmenu"
|
||||
export SXMO_TERMINAL="st"
|
||||
export DMENU_WRAP_AROUND=1
|
||||
export SXMO_DMENU_PORTRAIT_LINES=12
|
||||
export SXMO_DMENU_LANDSCAPE_LINES=8
|
||||
export SXMO_DISABLE_LEDS=1
|
||||
export SXMO_NO_VIRTUAL_KEYBOARD=1
|
||||
export NO_AT_BRIDGE=1
|
||||
export GTK_A11Y=none
|
||||
export GTK_USE_PORTAL=0
|
||||
export GTK_IM_MODULE=fcitx
|
||||
export QT_IM_MODULE=fcitx
|
||||
export XMODIFIERS=@im=fcitx
|
||||
|
||||
export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
|
||||
@@ -1,296 +0,0 @@
|
||||
# Default config for sway
|
||||
# configversion: 076611fe8cc699bcaa01092a8e4481c0
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left h
|
||||
set $down j
|
||||
set $up k
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term sxmo_terminal.sh
|
||||
# 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
|
||||
|
||||
font "Sxmo 13"
|
||||
xwayland disable
|
||||
output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
|
||||
default_orientation vertical
|
||||
|
||||
exec_always sxmo_swayinitconf.sh
|
||||
|
||||
exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
|
||||
|
||||
mode "menu" {
|
||||
bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
|
||||
bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
|
||||
bindsym XF86AudioRaiseVolume exec wtype -k Up
|
||||
bindsym XF86AudioLowerVolume exec wtype -k Down
|
||||
bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
|
||||
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
|
||||
}
|
||||
|
||||
# Mode specifically for use with Nokia N900 hardware keyboard
|
||||
mode "N900" {
|
||||
# follow the standard sxmo keybinds as far as possible
|
||||
bindsym t exec $term; mode "default"
|
||||
bindsym q mode "default"
|
||||
bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
|
||||
bindsym p exec sxmo_appmenu.sh; mode "default"
|
||||
bindsym d exec $menu; mode "default"
|
||||
bindsym Shift+q kill; mode "default"
|
||||
bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
|
||||
bindsym Shift+c reload; mode "default"
|
||||
bindsym f fullscreen; mode "default"
|
||||
bindsym Shift+space floating toggle; mode "default"
|
||||
bindsym a focus parent; mode "default"
|
||||
}
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
input * xkb_options compose:ralt
|
||||
|
||||
# Nokia N900 hardware keyboard
|
||||
input "1:1:TWL4030_Keypad" {
|
||||
xkb_model "nokiarx51"
|
||||
xkb_layout "us"
|
||||
# ralt has special meaning on N900 keyboard so do not use as
|
||||
# compose key
|
||||
xkb_options compose:rwin
|
||||
}
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Launch appmenu
|
||||
bindsym $mod+p exec sxmo_appmenu.sh
|
||||
bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
|
||||
|
||||
# Wm menu switcher
|
||||
bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+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+Shift+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' 'sxmo_power.sh logout'
|
||||
#
|
||||
# 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
|
||||
|
||||
# Move the focused workspace to output
|
||||
bindsym $mod+Shift+Ctrl+$left move workspace output left
|
||||
bindsym $mod+Shift+Ctrl+$down move workspace output down
|
||||
bindsym $mod+Shift+Ctrl+$up move workspace output up
|
||||
bindsym $mod+Shift+Ctrl+$right move workspace output right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace number 1
|
||||
bindsym $mod+2 workspace number 2
|
||||
bindsym $mod+3 workspace number 3
|
||||
bindsym $mod+4 workspace number 4
|
||||
bindsym $mod+5 workspace number 5
|
||||
bindsym $mod+6 workspace number 6
|
||||
bindsym $mod+7 workspace number 7
|
||||
bindsym $mod+8 workspace number 8
|
||||
bindsym $mod+9 workspace number 9
|
||||
bindsym $mod+0 workspace number 10
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace number 1
|
||||
bindsym $mod+Shift+2 move container to workspace number 2
|
||||
bindsym $mod+Shift+3 move container to workspace number 3
|
||||
bindsym $mod+Shift+4 move container to workspace number 4
|
||||
bindsym $mod+Shift+5 move container to workspace number 5
|
||||
bindsym $mod+Shift+6 move container to workspace number 6
|
||||
bindsym $mod+Shift+7 move container to workspace number 7
|
||||
bindsym $mod+Shift+8 move container to workspace number 8
|
||||
bindsym $mod+Shift+9 move container to workspace number 9
|
||||
bindsym $mod+Shift+0 move container to workspace number 10
|
||||
# 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
|
||||
|
||||
# Manual locker
|
||||
bindsym $mod+g exec sxmo_state.sh set locker
|
||||
|
||||
# Shutdown
|
||||
bindsym $mod+t exec sxmo_appmenu.sh power
|
||||
|
||||
#
|
||||
# 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 30px
|
||||
bindsym $down resize grow height 30px
|
||||
bindsym $up resize shrink height 30px
|
||||
bindsym $right resize grow width 30px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 30px
|
||||
bindsym Down resize grow height 30px
|
||||
bindsym Up resize shrink height 30px
|
||||
bindsym Right resize grow width 30px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
#
|
||||
# Status Bar:
|
||||
#
|
||||
# Read `man 5 sway-bar` for more information about this section.
|
||||
bar {
|
||||
position top
|
||||
height 24
|
||||
font "Sxmo 13"
|
||||
|
||||
# When the status_command prints a new line to stdout, swaybar updates.
|
||||
# The default just shows the current date and time.
|
||||
status_command sxmo_status_watch.sh -o pango
|
||||
|
||||
pango_markup enabled
|
||||
|
||||
colors {
|
||||
statusline #ffffff
|
||||
background #323232
|
||||
inactive_workspace #323232 #323232 #ffffff
|
||||
font "Sxmo 13"
|
||||
}
|
||||
}
|
||||
|
||||
for_window [app_id="pinentry-.*"] floating true
|
||||
for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
|
||||
for_window [title="megapixels"] inhibit_idle open
|
||||
for_window [title="ep[yr].*"] inhibit_idle visible
|
||||
|
||||
default_border pixel 2
|
||||
titlebar_border_thickness 2
|
||||
hide_edge_borders smart
|
||||
|
||||
# Need playerctl installed and running
|
||||
bindsym --locked XF86AudioPlay exec playerctl play-pause
|
||||
bindsym --locked XF86AudioPause exec playerctl play-pause
|
||||
bindsym --locked XF86AudioStop exec playerctl stop
|
||||
bindsym --locked XF86AudioNext exec playerctl next
|
||||
bindsym --locked XF86AudioPrev exec playerctl previous
|
||||
|
||||
bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
|
||||
bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
|
||||
|
||||
# Nokia N900-specific key bindings:
|
||||
# 1. Bind lock key (XF86ScreenSaver)
|
||||
# Use keycode due to https://github.com/swaywm/sway/issues/8438
|
||||
bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
|
||||
# 2. Workaround the lack of a free ModX key on hardware keyboard
|
||||
bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
|
||||
|
||||
bindsym Print exec sxmo_screenshot.sh
|
||||
|
||||
bindsym button2 kill
|
||||
|
||||
bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
|
||||
bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
|
||||
|
||||
# Nokia 8110 4G hardware keypad bindings (User:Ybon)
|
||||
bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
|
||||
bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
|
||||
bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
|
||||
|
||||
include /etc/sway/config.d/*
|
||||
|
||||
exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
|
||||
|
||||
exec sxmo_hook_start.sh
|
||||
|
||||
# vim: ft=swayconfig
|
||||
@@ -1,6 +0,0 @@
|
||||
# Space to setup configversion
|
||||
# configversion: 4de2da84af48414f557742c29bde606e
|
||||
anchor = top
|
||||
width = 220
|
||||
height = 28
|
||||
margin = 28
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Space to setup configversion */
|
||||
/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
|
||||
* {
|
||||
font-family: monospace;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
window {
|
||||
margin: 0px;
|
||||
border: 2px solid #005577;
|
||||
background-color: #1c1c1c;
|
||||
}
|
||||
|
||||
#input {
|
||||
margin: 0px;
|
||||
padding: 4px 6px;
|
||||
border-radius: 0px;
|
||||
border: 1px solid #005577;
|
||||
background-color: #383838;
|
||||
color: #ffffff;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
margin: 0px;
|
||||
color: #ffdd00;
|
||||
}
|
||||
|
||||
#text {
|
||||
margin: 1px 4px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#entry {
|
||||
padding: 3px 2px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
background-color: #005577;
|
||||
font-weight: bold;
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# configversion: 36730424afa6d6bf9e9fb6d111c35504
|
||||
|
||||
dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
|
||||
|
||||
# Run actions on start
|
||||
sxmo_hook_start.sh &
|
||||
@@ -1,18 +1,24 @@
|
||||
-- Space to setup configversion
|
||||
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
|
||||
conky.config = {
|
||||
out_to_x = false,
|
||||
out_to_wayland = true,
|
||||
output_backend = 'x11',
|
||||
out_to_x = true,
|
||||
out_to_wayland = false,
|
||||
own_window = true,
|
||||
own_window_type = 'override',
|
||||
own_window_transparent = true,
|
||||
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
|
||||
double_buffer = true,
|
||||
alignment = 'top_middle',
|
||||
gap_y = 12,
|
||||
own_window_argb_value = 0,
|
||||
own_window_type = 'desktop',
|
||||
gap_x = 0,
|
||||
gap_y = 34,
|
||||
default_color = 'white',
|
||||
default_shade_color = 'black',
|
||||
draw_shades = true,
|
||||
font = 'Sxmo:size=13',
|
||||
font = 'Fira Code:size=14:style=Regular',
|
||||
use_xft = true,
|
||||
update_interval = 15,
|
||||
}
|
||||
|
||||
conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
|
||||
${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
|
||||
conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
|
||||
${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
. sxmo_hook_icons.sh
|
||||
|
||||
APPS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache"
|
||||
if [ -f "$APPS_CACHE" ] && [ ! "$0" -nt "$APPS_CACHE" ] && [ ! /usr/bin -nt "$APPS_CACHE" ] && [ ! /usr/local/bin -nt "$APPS_CACHE" ]; then
|
||||
cat "$APPS_CACHE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec 3>&1 > "$APPS_CACHE.tmp"
|
||||
trap 'mv -f "$APPS_CACHE.tmp" "$APPS_CACHE" 2>/dev/null; cat "$APPS_CACHE" >&3 2>/dev/null' EXIT
|
||||
|
||||
write_line() {
|
||||
printf "%s ^ 0 ^ %s\n" "$1" "$2"
|
||||
}
|
||||
@@ -69,8 +78,6 @@ write_line_app firefox-esr "$icon_ffx Firefox ESR" "firefox-esr"
|
||||
write_line_app flare "$icon_msg Flare" "flare"
|
||||
write_line_app flowtime "$icon_hrg Flowtime" "flowtime"
|
||||
write_line_app foliate "$icon_bok Foliate" "foliate"
|
||||
( [ -n "$WAYLAND_DISPLAY" ] && command -v foot >/dev/null) && \
|
||||
write_line "$icon_trm Foot" "foot $SHELL"
|
||||
write_line_app foxtrotgps "$icon_gps Foxtrotgps" "foxtrotgps"
|
||||
write_line_app fractal "$icon_msg Fractal" "fractal"
|
||||
write_line_app fragments "$icon_rld Fragments" "fragments"
|
||||
@@ -195,8 +202,7 @@ write_line_app siglo "$icon_clk Siglo" "siglo"
|
||||
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
|
||||
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
|
||||
write_line_app solanum "$icon_pom Solanum" "solanum"
|
||||
([ -z "$WAYLAND_DISPLAY" ] && command -v st >/dev/null) && \
|
||||
write_line "$icon_trm St" "st -e $SHELL"
|
||||
write_line_app st "$icon_trm St" "st -e ${SHELL:-/bin/sh}"
|
||||
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
|
||||
write_line_app surf "$icon_glb Surf" "surf"
|
||||
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
|
||||
|
||||
@@ -1,30 +1,64 @@
|
||||
#!/bin/sh
|
||||
# configversion: d031535bc22ba19d69704317b8d50560
|
||||
|
||||
load_data() {
|
||||
data="$(upower -i "$1" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
|
||||
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
|
||||
}
|
||||
|
||||
data_get() {
|
||||
printf "%b" "$data" | grep "^$1:" | cut -d: -f2
|
||||
}
|
||||
|
||||
SET_LED_PATH="$XDG_RUNTIME_DIR/sxmo_hook_battery_set_led"
|
||||
|
||||
device_changed() {
|
||||
name="$(data_get "native-path")"
|
||||
state="$(data_get "state")"
|
||||
percentage="$(data_get "percentage" | cut -d% -f1)"
|
||||
object="${1:-/org/freedesktop/UPower/devices/battery_default}"
|
||||
event="${2:-device changed}"
|
||||
|
||||
if [ -z "$name" ] || [ -z "$state" ]; then
|
||||
return
|
||||
fi
|
||||
case "$event" in
|
||||
"device changed") ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
if [ "$state" = unknown ]; then
|
||||
return
|
||||
fi
|
||||
case "$object" in
|
||||
*/battery_*)
|
||||
raw_name="${object##*/battery_}"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
sysfs_dir=""
|
||||
if [ -d "/sys/class/power_supply/$raw_name" ]; then
|
||||
sysfs_dir="/sys/class/power_supply/$raw_name"
|
||||
name="$raw_name"
|
||||
else
|
||||
for d in /sys/class/power_supply/*; do
|
||||
[ -r "$d/type" ] || continue
|
||||
read -r pstype < "$d/type" 2>/dev/null || continue
|
||||
if [ "$pstype" = "Battery" ]; then
|
||||
sysfs_dir="$d"
|
||||
name="${d##*/}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$sysfs_dir" ] && [ -r "$sysfs_dir/capacity" ] && [ -r "$sysfs_dir/status" ]; then
|
||||
read -r percentage < "$sysfs_dir/capacity" 2>/dev/null || percentage=""
|
||||
read -r raw_status < "$sysfs_dir/status" 2>/dev/null || raw_status=""
|
||||
case "$raw_status" in
|
||||
"Full"|"full") state="fully-charged" ;;
|
||||
"Charging"|"charging") state="charging" ;;
|
||||
"Discharging"|"discharging"|"Not charging"|"not charging") state="discharging" ;;
|
||||
*) state="unknown" ;;
|
||||
esac
|
||||
else
|
||||
data="$(upower -i "$object" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
|
||||
type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
|
||||
[ "$type" = "battery" ] || exit 0
|
||||
name="$(printf "%b" "$data" | grep "^native-path:" | cut -d: -f2)"
|
||||
state="$(printf "%b" "$data" | grep "^state:" | cut -d: -f2)"
|
||||
percentage="$(printf "%b" "$data" | grep "^percentage:" | cut -d: -f2 | cut -d% -f1)"
|
||||
fi
|
||||
|
||||
if [ -z "$name" ] || [ -z "$state" ] || [ -z "$percentage" ] || [ "$state" = "unknown" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
if [ "$percentage" -lt 25 ] && [ ! -f "$SET_LED_PATH" ]; then
|
||||
touch "$SET_LED_PATH"
|
||||
sxmo_led.sh set red 100
|
||||
@@ -32,21 +66,17 @@ device_changed() {
|
||||
rm "$SET_LED_PATH"
|
||||
sxmo_led.sh set red 0
|
||||
fi
|
||||
|
||||
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
|
||||
}
|
||||
|
||||
object="$1"
|
||||
event="$2"
|
||||
|
||||
load_data "$object"
|
||||
|
||||
if [ "$type" != "battery" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
case "$event" in
|
||||
"device changed")
|
||||
device_changed "$object"
|
||||
;;
|
||||
esac
|
||||
CACHE_FILE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_bat_state_${name}"
|
||||
ICON_FILE="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}/040-battery-icon-${name}"
|
||||
NEW_VAL="${state}:${percentage}"
|
||||
if [ -r "$CACHE_FILE" ] && [ -f "$ICON_FILE" ]; then
|
||||
read -r OLD_VAL < "$CACHE_FILE" 2>/dev/null || OLD_VAL=""
|
||||
if [ "$OLD_VAL" = "$NEW_VAL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
printf '%s\n' "$NEW_VAL" > "$CACHE_FILE"
|
||||
|
||||
sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
|
||||
|
||||
@@ -23,6 +23,20 @@ sxmo_service_isrunning() {
|
||||
sxmo_jobs.sh running "$1" -q
|
||||
}
|
||||
|
||||
bt_is_unblocked() {
|
||||
for rfk in /sys/class/rfkill/rfkill*; do
|
||||
[ -r "$rfk/type" ] || continue
|
||||
read -r rtype < "$rfk/type" 2>/dev/null || continue
|
||||
if [ "$rtype" = "bluetooth" ]; then
|
||||
read -r soft < "$rfk/soft" 2>/dev/null || soft=0
|
||||
read -r hard < "$rfk/hard" 2>/dev/null || hard=0
|
||||
[ "$soft" = "0" ] && [ "$hard" = "0" ] && return 0
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
rfkill list bluetooth -no ID,SOFT,HARD 2>/dev/null | grep -vq " blocked"
|
||||
}
|
||||
|
||||
case "$WMCLASS" in
|
||||
scripts)
|
||||
# Scripts menu
|
||||
@@ -43,11 +57,8 @@ case "$WMCLASS" in
|
||||
printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
|
||||
printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
|
||||
) && sxmo_hook_statusbar.sh modem
|
||||
$icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem
|
||||
$icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh
|
||||
$icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh
|
||||
$icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh
|
||||
$icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh
|
||||
"
|
||||
WINNAME=Modem
|
||||
;;
|
||||
@@ -56,27 +67,12 @@ case "$WMCLASS" in
|
||||
CHOICES="
|
||||
$icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up
|
||||
$icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down
|
||||
$icon_cfg Touch $(
|
||||
sxmo_wm.sh inputevent touchscreen | grep -q on && \
|
||||
printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
|
||||
printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
|
||||
)
|
||||
$icon_cfg Stylus $(
|
||||
sxmo_wm.sh inputevent stylus | grep -q on && \
|
||||
printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
|
||||
printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
|
||||
)
|
||||
$icon_cfg Gestures $(
|
||||
superd_service_isrunning "sxmo_hook_lisgd" &&
|
||||
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
|
||||
) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
|
||||
$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
|
||||
$icon_bth Bluetooth $(
|
||||
rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
|
||||
bt_is_unblocked &&
|
||||
printf %b "$icon_ton" || printf %b "$icon_tof";
|
||||
printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
|
||||
)
|
||||
$(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
|
||||
$icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh
|
||||
$icon_zzz Auto-suspend $(
|
||||
[ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
|
||||
@@ -84,24 +80,7 @@ case "$WMCLASS" in
|
||||
$icon_zzz Auto-screen-off $(
|
||||
[ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
|
||||
) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_state.sh set unlock
|
||||
$icon_ror Autorotate $(
|
||||
sxmo_jobs.sh running autorotate -q &&
|
||||
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
|
||||
) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh
|
||||
$([ -n "$SXMO_KEYBOARD_SLIDER_EVENT_DEVICE" ] && echo "$icon_ror Autorotate on Keyboard Open/Close $(
|
||||
sxmo_jobs.sh running kb_autorotate -q &&
|
||||
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
|
||||
) ^ 1 ^ toggle_daemon 'Keyboard Autorotate' kb_autorotate sxmo_keyboard_autorotate.sh")
|
||||
$icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate
|
||||
$icon_brightness Adaptive Brightness $(
|
||||
superd_service_isrunning sxmo_adaptivebrightness &&
|
||||
printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
|
||||
) ^ 1 ^ supertoggle_daemon sxmo_adaptivebrightness
|
||||
$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
|
||||
$icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh
|
||||
$icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh
|
||||
$(sxmo_wm.sh configmenuentry)
|
||||
$(command -v pmos-tweaks >/dev/null && echo "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
|
||||
$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_debug_suspend.sh
|
||||
$icon_inf Log ^ 0 ^ sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
|
||||
$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
|
||||
@@ -114,7 +93,6 @@ case "$WMCLASS" in
|
||||
$icon_lck Lock ^ 0 ^ sxmo_state.sh set lock
|
||||
$icon_lck Lock (Screen off) ^ 0 ^ sxmo_state.sh set screenoff
|
||||
$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
|
||||
$icon_rol Switch WM ^ 0 ^ sxmo_power.sh togglewm
|
||||
$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
|
||||
$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
|
||||
"
|
||||
@@ -213,7 +191,7 @@ case "$WMCLASS" in
|
||||
"
|
||||
WINNAME=St
|
||||
;;
|
||||
*foot*|st|st-*|*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4|*alacritty*)
|
||||
st|st-*|*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4|*alacritty*)
|
||||
|
||||
# These git commands only launch the editor.
|
||||
case "$WMNAME" in
|
||||
@@ -458,6 +436,8 @@ case "$WMCLASS" in
|
||||
case "$WMCLASS" in
|
||||
st|st-*)
|
||||
CHOICES="
|
||||
$icon_trm New Terminal ^ 0 ^ sxmo_terminal.sh
|
||||
$icon_cls Close Terminal ^ 0 ^ sxmo_killwindow.sh
|
||||
$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
|
||||
$icon_itm Toggle Selmode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k s
|
||||
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
|
||||
@@ -472,29 +452,6 @@ case "$WMCLASS" in
|
||||
"
|
||||
WINNAME=St
|
||||
;;
|
||||
*foot*)
|
||||
CHOICES="
|
||||
$icon_win Next Window ^ 0 ^ swaymsg focus next
|
||||
$icon_rld Toggle Layout ^ 0 ^ sxmo_wm.sh togglelayout
|
||||
$icon_mnu Tile Vertical ^ 0 ^ swaymsg layout splitv && swaymsg splitv
|
||||
$icon_grd Tile Horizontal ^ 0 ^ swaymsg layout splith && swaymsg splith
|
||||
$icon_trm New Terminal ^ 0 ^ sxmo_terminal.sh
|
||||
$icon_cls Close Terminal ^ 0 ^ sxmo_killwindow.sh
|
||||
$icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
|
||||
$icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
|
||||
$icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
|
||||
$icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
|
||||
$icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
|
||||
$icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
|
||||
$icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
|
||||
$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
|
||||
$icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
|
||||
$icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
|
||||
$icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
|
||||
$icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
|
||||
"
|
||||
WINNAME=Foot
|
||||
;;
|
||||
*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4)
|
||||
CHOICES="$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
|
||||
WINNAME=Terminal
|
||||
@@ -806,30 +763,28 @@ case "$WMCLASS" in
|
||||
*)
|
||||
# Default system menu (no matches)
|
||||
CHOICES="
|
||||
$icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
|
||||
$icon_trm St ^ 0 ^ st -e ${SHELL:-/bin/sh}
|
||||
$icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications
|
||||
$([ "$SXMO_MENU" = "wofi" ] && echo "$icon_grd All Apps ^ 0 ^ wofi -O alphabetical -i --show drun")
|
||||
$([ "$SXMO_MENU" != "wofi" ] && command -v j4-dmenu-desktop > /dev/null && echo "$icon_grd All Apps ^ 0 ^ j4-dmenu-desktop --dmenu=sxmo_dmenu.sh --term=sxmo_terminal.sh")
|
||||
$icon_grd Binaries ^ 0 ^ sxmo_brun.sh
|
||||
$icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
|
||||
$icon_dir Files ^ 0 ^ sxmo_files.sh
|
||||
$icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh
|
||||
$icon_msg Texts ^ 0 ^ sxmo_modemtext.sh
|
||||
$icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh
|
||||
$(
|
||||
rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
|
||||
bt_is_unblocked &&
|
||||
printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
|
||||
)
|
||||
$icon_cam Camera ^ 0 ^ bananarchy-photo --menu
|
||||
$(
|
||||
if command -v bananarchy-photo >/dev/null; then
|
||||
echo "$icon_cam Camera ^ 0 ^ bananarchy-photo --menu"
|
||||
elif command -v megapixels >/dev/null; then
|
||||
echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels"
|
||||
brightness=""
|
||||
if [ -r /sys/class/leds/white:torch/brightness ]; then
|
||||
read -r brightness < /sys/class/leds/white:torch/brightness 2>/dev/null || brightness=""
|
||||
elif [ -r /sys/class/leds/white:flash/brightness ]; then
|
||||
read -r brightness < /sys/class/leds/white:flash/brightness 2>/dev/null || brightness=""
|
||||
fi
|
||||
)
|
||||
$(
|
||||
if brightness="$(brightnessctl -l -m | grep -e "white:torch" -e "white:flash" | cut -d ',' -f 3)" && [ -n "$brightness" ]; then
|
||||
if [ -n "$brightness" ]; then
|
||||
printf "%s Flashlight " "$icon_fll"
|
||||
[ "$brightness" -gt 0 ] &&
|
||||
[ "$brightness" -gt 0 ] 2>/dev/null &&
|
||||
printf %b "$icon_ton" || printf %b "$icon_tof";
|
||||
printf %b "^ 1 ^ sxmo_flashtoggle.sh"
|
||||
fi
|
||||
@@ -839,7 +794,6 @@ case "$WMCLASS" in
|
||||
$icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem
|
||||
$icon_win Windows ^ 0 ^ sxmo_wmmenu.sh
|
||||
$icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config
|
||||
$icon_inf Help ^ 0 ^ sxmo_terminal.sh man sxmo
|
||||
$icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power
|
||||
"
|
||||
WINNAME=Sys
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
# for all the variables we define here
|
||||
# shellcheck disable=SC2034
|
||||
|
||||
[ -n "$SXMO_ICONS_LOADED" ] && return 0 2>/dev/null
|
||||
SXMO_ICONS_LOADED=1
|
||||
|
||||
#this script is meant to be sourced
|
||||
#the glyphs are often in the private use area and
|
||||
#therefore require a font like those in https://github.com/ryanoasis/nerd-fonts/ for proper display
|
||||
|
||||
@@ -17,38 +17,51 @@ stop_proximity_lock() {
|
||||
sxmo_jobs.sh stop proximity_lock
|
||||
}
|
||||
|
||||
exec 0<<EOF
|
||||
STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
|
||||
if [ -r "$STATE_FILE" ]; then
|
||||
read -r CURRENT_STATE < "$STATE_FILE" || CURRENT_STATE=""
|
||||
else
|
||||
CURRENT_STATE="$(sxmo_state.sh get)"
|
||||
fi
|
||||
|
||||
if [ "$CURRENT_STATE" != "unlock" ] && sxmo_state.sh is_locked; then
|
||||
case "$ACTION" in
|
||||
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
|
||||
if [ -n "$WAYLAND_DISPLAY" ]; then
|
||||
wlopm --on "*" >/dev/null 2>&1 || sxmo_wm.sh display on
|
||||
else
|
||||
sxmo_wm.sh display on
|
||||
fi
|
||||
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
|
||||
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
else
|
||||
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
|
||||
fi
|
||||
sxmo_state.sh set unlock &
|
||||
exit 0
|
||||
;;
|
||||
"voldown_one"|"volup_one")
|
||||
exec 0<<EOF
|
||||
$(sxmo_wm.sh focusedwindow -r)
|
||||
EOF
|
||||
read -r WMCLASS
|
||||
read -r WMNAME
|
||||
|
||||
sxmo_debug "STATE: $(sxmo_state.sh get) ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
|
||||
|
||||
if sxmo_state.sh is_locked; then
|
||||
case "$WMNAME" in # Handle programs
|
||||
*"epy"*|*"epr"*)
|
||||
case "$ACTION" in
|
||||
"voldown_one")
|
||||
sxmo_type.sh l
|
||||
exit 0
|
||||
;;
|
||||
"volup_one")
|
||||
sxmo_type.sh h
|
||||
read -r WMCLASS
|
||||
read -r WMNAME
|
||||
case "$WMNAME" in
|
||||
*"epy"*|*"epr"*)
|
||||
if [ "$ACTION" = "voldown_one" ]; then
|
||||
sxmo_type.sh l
|
||||
else
|
||||
sxmo_type.sh h
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case "$ACTION" in
|
||||
"powerbutton_one"|"powerbutton_two"|"powerbutton_three"|"menuleft_one"|"menuright_one"|"enter_one"|"enter_two"|"enter_three")
|
||||
brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
|
||||
sxmo_state.sh set unlock
|
||||
sxmo_wm.sh display on
|
||||
;;
|
||||
"voldown_one")
|
||||
sxmo_audio.sh vol down 5
|
||||
exit
|
||||
if [ "$ACTION" = "voldown_one" ]; then
|
||||
sxmo_audio.sh vol down 5
|
||||
else
|
||||
sxmo_audio.sh vol up 5
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
"voldown_two")
|
||||
sxmo_audio.sh vol down 10
|
||||
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
|
||||
sxmo_audio.sh vol down 15
|
||||
exit
|
||||
;;
|
||||
"volup_one")
|
||||
sxmo_audio.sh vol up 5
|
||||
exit
|
||||
;;
|
||||
"volup_two")
|
||||
sxmo_audio.sh vol up 10
|
||||
exit
|
||||
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$ACTION" in
|
||||
"menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
|
||||
WMCLASS=""
|
||||
WMNAME=""
|
||||
;;
|
||||
*)
|
||||
if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
|
||||
{
|
||||
read -r WMCLASS || WMCLASS=""
|
||||
read -r WMNAME || WMNAME=""
|
||||
} < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
|
||||
else
|
||||
exec 0<<EOF
|
||||
$(sxmo_wm.sh focusedwindow -r)
|
||||
EOF
|
||||
read -r WMCLASS
|
||||
read -r WMNAME
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$SXMO_DEBUG" ]; then
|
||||
sxmo_debug "STATE: $CURRENT_STATE ACTION: $ACTION WMCLASS: $WMCLASS WMNAME: $WMNAME"
|
||||
fi
|
||||
|
||||
#special context-sensitive handling
|
||||
case "$WMCLASS" in
|
||||
*"mpv"*)
|
||||
@@ -367,7 +401,7 @@ case "$ACTION" in
|
||||
exit 0
|
||||
;;
|
||||
"enter_one")
|
||||
if pidof -q sxmo_RepeatRing.sh; then
|
||||
if pidof -s sxmo_RepeatRing.sh >/dev/null; then
|
||||
sxmo_hook_pickup.sh
|
||||
else
|
||||
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
|
||||
|
||||
@@ -17,13 +17,19 @@
|
||||
|
||||
# This hook is called when the system reaches a locked state
|
||||
|
||||
sxmo_led.sh blink blue &
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_led.sh blink blue &
|
||||
fi
|
||||
|
||||
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
|
||||
sxmo_wm.sh display on
|
||||
sxmo_wm.sh inputevent touchscreen off
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
|
||||
sxmo_wm.sh inputevent touchscreen off
|
||||
fi
|
||||
|
||||
sxmo_jobs.sh stop periodic_blink
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_jobs.sh stop periodic_blink
|
||||
fi
|
||||
sxmo_jobs.sh stop periodic_wakelock_check
|
||||
|
||||
# Go down after 8 seconds of inactivity
|
||||
|
||||
@@ -17,13 +17,20 @@
|
||||
|
||||
# This hook is called when the system reaches a off state (screen off)
|
||||
|
||||
sxmo_led.sh blink red blue &
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_led.sh blink red blue &
|
||||
fi
|
||||
|
||||
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
|
||||
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
|
||||
printf '0' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
sxmo_wm.sh display off
|
||||
sxmo_wm.sh inputevent touchscreen off
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
|
||||
sxmo_wm.sh inputevent touchscreen off
|
||||
fi
|
||||
|
||||
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ]; then
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ]; then
|
||||
sxmo_jobs.sh start periodic_blink \
|
||||
sxmo_run_periodically.sh -w 2 -- sxmo_led.sh blink red blue
|
||||
fi
|
||||
@@ -44,7 +51,7 @@ wait
|
||||
|
||||
case "$SXMO_WM" in
|
||||
sway)
|
||||
if command -v peanutbutter > /dev/null; then
|
||||
if [ -n "$SXMO_HAS_PEANUTBUTTER" ] && command -v peanutbutter > /dev/null; then
|
||||
peanutbutter --font Sxmo --statuscommand sxmo_hook_lockstatusbar.sh && sxmo_hook_statusbar.sh state_change &
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -11,18 +11,38 @@
|
||||
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
|
||||
. sxmo_hook_icons.sh
|
||||
|
||||
SCRIPTS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache"
|
||||
APPSCRIPTS_DIR="$(xdg_data_path sxmo/appscripts)"
|
||||
if [ -f "$SCRIPTS_CACHE" ] && [ ! "$0" -nt "$SCRIPTS_CACHE" ] && \
|
||||
[ ! "$APPSCRIPTS_DIR" -nt "$SCRIPTS_CACHE" ] && \
|
||||
{ [ ! -e "$XDG_CONFIG_HOME/sxmo/userscripts" ] || [ ! "$XDG_CONFIG_HOME/sxmo/userscripts" -nt "$SCRIPTS_CACHE" ]; }; then
|
||||
cat "$SCRIPTS_CACHE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec 3>&1 > "$SCRIPTS_CACHE.tmp"
|
||||
trap 'mv -f "$SCRIPTS_CACHE.tmp" "$SCRIPTS_CACHE" 2>/dev/null; cat "$SCRIPTS_CACHE" >&3 2>/dev/null' EXIT
|
||||
|
||||
write_line() {
|
||||
printf "%s ^ 0 ^ %s\n" "$1" "$2"
|
||||
}
|
||||
|
||||
get_title() {
|
||||
title=""
|
||||
eval "$(head "$1" | grep '# title="[^\\"]*"' | sed 's/^# //g')"
|
||||
while IFS= read -r line; do
|
||||
case "$line" in
|
||||
"# title=\""*"\"")
|
||||
title="${line#*# title=\"}"
|
||||
title="${title%\"*}"
|
||||
title="$(eval "printf '%s' \"$title\"" 2>/dev/null || printf '%s' "$title")"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < "$1"
|
||||
if [ -n "$title" ]; then
|
||||
echo "$title"
|
||||
printf "%s\n" "$title"
|
||||
else
|
||||
basename="$(basename "$1")"
|
||||
echo "$icon_itm $basename"
|
||||
printf "%s %s\n" "$icon_itm" "${1##*/}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -33,12 +53,18 @@ elif [ -d "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
|
||||
title="$(get_title "$script")"
|
||||
write_line "$title" "$script"
|
||||
done
|
||||
write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
|
||||
fi
|
||||
|
||||
write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
|
||||
|
||||
# System Scripts
|
||||
find "$(xdg_data_path sxmo/appscripts)" -type f -o -type l | sort -f | while read -r script; do
|
||||
title="$(get_title "$script")"
|
||||
write_line "$title" "$script"
|
||||
done
|
||||
if [ -n "$APPSCRIPTS_DIR" ]; then
|
||||
find "$APPSCRIPTS_DIR" -type f -o -type l | sort -f | while read -r script; do
|
||||
case "${script##*/}" in
|
||||
sxmo_record.sh|sxmo_screenshot.sh|sxmo_websearch.sh|sxmo_youtube*.sh)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
title="$(get_title "$script")"
|
||||
write_line "$title" "$script"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -10,13 +10,18 @@
|
||||
. sxmo_common.sh
|
||||
|
||||
# Create xdg user directories, such as ~/Pictures
|
||||
xdg-user-dirs-update
|
||||
[ -d "$HOME/Pictures" ] || xdg-user-dirs-update &
|
||||
|
||||
# Ensure fontconfig cache is valid without forcing a full rescan on every boot
|
||||
if command -v fc-cache > /dev/null && [ -z "$(ls -A /var/cache/fontconfig 2>/dev/null)" ]; then
|
||||
fc-cache >/dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
sxmo_jobs.sh start daemon_manager superd
|
||||
|
||||
# let time to superd to start correctly
|
||||
while ! superctl status > /dev/null 2>&1; do
|
||||
sleep 0.5
|
||||
sleep 0.05
|
||||
done
|
||||
|
||||
# Not dangerous if "locker" isn't an available state
|
||||
@@ -54,48 +59,14 @@ superctl start dunst
|
||||
# start adaptive brightness at boot
|
||||
# superctl start sxmo_adaptivebrightness
|
||||
|
||||
# load some other little things here too.
|
||||
case "$SXMO_WM" in
|
||||
river)
|
||||
superctl start sxmo_wob
|
||||
[ "$(command -v bonsaid)" ] && superctl start bonsaid
|
||||
[ "$(command -v fcitx5)" ] && superctl start fcitx5
|
||||
superctl start sxmo_riverbar
|
||||
;;
|
||||
sway)
|
||||
superctl start sxmo_wob
|
||||
superctl start sxmo_menumode_toggler
|
||||
[ "$(command -v bonsaid)" ] && superctl start bonsaid
|
||||
[ "$(command -v fcitx5)" ] && superctl start fcitx5
|
||||
;;
|
||||
dwm|i3)
|
||||
superctl start sxmo_xob
|
||||
|
||||
# Auto hide cursor with touchscreen, Show it with a mouse
|
||||
if command -v "unclutter-xfixes" > /dev/null; then
|
||||
set -- unclutter-xfixes
|
||||
else
|
||||
set -- unclutter
|
||||
fi
|
||||
superctl start "$1"
|
||||
|
||||
superctl start autocutsel
|
||||
superctl start autocutsel-primary
|
||||
superctl start sxmo-x11-status
|
||||
[ "$(command -v bonsaid)" ] && superctl start bonsaid
|
||||
[ "$(command -v fcitx5)" ] && superctl start fcitx5
|
||||
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
|
||||
# Set onboard to auto-hide in config first
|
||||
if [ "$KEYBOARD" = "onboard" ]; then
|
||||
onboard "$KEYBOARD_ARGS"
|
||||
fi
|
||||
case "$SXMO_WM" in
|
||||
i3)
|
||||
xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
# load X11 dwm services
|
||||
[ "$(command -v sxmo_xob)" ] && superctl start sxmo_xob
|
||||
pidof -s sxmo_status_xsetroot.sh >/dev/null 2>&1 || superctl start sxmo-x11-status
|
||||
[ "$(command -v bonsaid)" ] && superctl start bonsaid
|
||||
if ! pidof -s fcitx5 >/dev/null 2>&1 && [ "$(command -v fcitx5)" ]; then
|
||||
superctl start fcitx5
|
||||
fi
|
||||
[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
|
||||
|
||||
# Turn on auto-suspend
|
||||
if sxmo_wakelock.sh isenabled; then
|
||||
@@ -106,8 +77,8 @@ fi
|
||||
# To setup initial unlock state
|
||||
sxmo_state.sh set unlock
|
||||
|
||||
# Turn on lisgd
|
||||
if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
|
||||
# Turn on lisgd only on touch devices
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
|
||||
superctl start sxmo_hook_lisgd
|
||||
fi
|
||||
|
||||
@@ -120,11 +91,8 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
|
||||
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
|
||||
fi
|
||||
|
||||
# Start the desktop wallpaper
|
||||
superctl start sxmo_bg
|
||||
|
||||
# Start the desktop widget (e.g. clock)
|
||||
superctl start sxmo_conky
|
||||
pidof -s conky >/dev/null 2>&1 || superctl start sxmo_conky
|
||||
|
||||
# Monitor the battery
|
||||
superctl start sxmo_battery_monitor
|
||||
@@ -135,25 +103,8 @@ superctl start sxmo_networkmonitor
|
||||
# The daemon that display notifications popup messages
|
||||
superctl start sxmo_notificationmonitor
|
||||
|
||||
# Play a funky startup tune if you want (disabled by default)
|
||||
#mpv --quiet --no-video ~/welcome.ogg &
|
||||
|
||||
# mmsd and vvmd
|
||||
if [ -z "$SXMO_NO_MODEM" ]; then
|
||||
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
|
||||
superctl start mmsd-tng
|
||||
fi
|
||||
|
||||
if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
|
||||
superctl start vvmd
|
||||
fi
|
||||
fi
|
||||
|
||||
# add some warnings if things are not setup correctly
|
||||
if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
|
||||
sxmo_notify_user.sh --urgency=critical \
|
||||
"No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
|
||||
fi
|
||||
|
||||
sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
|
||||
"Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
|
||||
# Pre-warm app and script menu caches in background
|
||||
(
|
||||
sxmo_hook_apps.sh >/dev/null 2>&1 || true
|
||||
sxmo_hook_scripts.sh >/dev/null 2>&1 || true
|
||||
) &
|
||||
|
||||
@@ -18,14 +18,7 @@
|
||||
# right and "variable" icons (that come and go) on the left.
|
||||
|
||||
set_time() {
|
||||
if pidof peanutbutter > /dev/null; then
|
||||
#peanutbutter already features a clock, no need for one in the icon bar
|
||||
sxmobar -d time
|
||||
else
|
||||
date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}" | while read -r date; do
|
||||
sxmobar -a time 99 "$date"
|
||||
done
|
||||
fi
|
||||
sxmobar -a time 99 " $(date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}")"
|
||||
}
|
||||
|
||||
set_state() {
|
||||
@@ -38,13 +31,8 @@ set_state() {
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v peanutbutter > /dev/null; then
|
||||
# no need for a state icon in this (default) scenario, the state will be obvious, either peanutbutter is on or it isn't
|
||||
sxmobar -d state
|
||||
return
|
||||
fi
|
||||
|
||||
case "$(sxmo_state.sh get)" in
|
||||
read -r cur_state < "$SXMO_STATE" 2>/dev/null || cur_state=""
|
||||
case "$cur_state" in
|
||||
screenoff)
|
||||
sxmobar -a -e bold -f red state 90 "$icon_state_screenoff" # filled circle
|
||||
;;
|
||||
@@ -52,7 +40,7 @@ set_state() {
|
||||
sxmobar -a -e bold -f red state 90 "$icon_state_lock" # open circle with slash
|
||||
;;
|
||||
unlock)
|
||||
sxmobar -a -e bold state 90 "$icon_state_unlock" # open circle
|
||||
sxmobar -d state
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -211,7 +199,7 @@ set_modem() {
|
||||
# $2 = interface name (wlan0, tun0)
|
||||
set_wifi() {
|
||||
|
||||
if rfkill list wifi | grep -q "yes"; then
|
||||
if /usr/sbin/rfkill list wifi 2>/dev/null | grep -q "yes"; then
|
||||
sxmobar -d wifi-status
|
||||
return
|
||||
fi
|
||||
@@ -238,7 +226,7 @@ set_wifi() {
|
||||
wifivpn=0
|
||||
fi
|
||||
|
||||
wifi_signal="$(nmcli -f IN-USE,SIGNAL,SSID device wifi | awk '/^\*/{if (NR!=1) {print $2}}')"
|
||||
wifi_signal="$(nmcli -f IN-USE,SIGNAL,SSID device wifi list --rescan no 2>/dev/null | awk '/^\*/{if (NR!=1) {print $2}}')"
|
||||
if [ -z "$wifi_signal" ]; then
|
||||
icon_wif="$icon_wifi_signal_exclam"
|
||||
elif [ "$wifi_signal" -lt 20 ]; then
|
||||
@@ -406,33 +394,33 @@ set_volume() {
|
||||
*Headset*)
|
||||
VOLCMP="$icon_hst"
|
||||
;;
|
||||
*)
|
||||
VOLCMP="$icon_mic"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if sxmo_audio.sh vol ismuted; then
|
||||
VOLCMP="$VOLCMP $icon_mut"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_mut"
|
||||
else
|
||||
case "$(sxmo_audio.sh device get 2>/dev/null)" in
|
||||
*Speaker*|"")
|
||||
# nothing for default or pulse devices
|
||||
;;
|
||||
*Headphone*)
|
||||
VOLCMP="$VOLCMP $icon_hdp"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_hdp"
|
||||
;;
|
||||
*Earpiece*)
|
||||
VOLCMP="$VOLCMP $icon_ear"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_ear"
|
||||
;;
|
||||
esac
|
||||
VOL="$(sxmo_audio.sh vol get)"
|
||||
VOL="$(sxmo_audio.sh vol get 2>/dev/null)"
|
||||
case "$VOL" in
|
||||
''|*[!0-9]*) VOL=0 ;;
|
||||
esac
|
||||
if [ "$VOL" -gt 66 ]; then
|
||||
VOLCMP="$VOLCMP $icon_spk"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_spk"
|
||||
elif [ "$VOL" -gt 33 ]; then
|
||||
VOLCMP="$VOLCMP $icon_spm"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_spm"
|
||||
elif [ "$VOL" -ge 0 ]; then
|
||||
VOLCMP="$VOLCMP $icon_spl"
|
||||
VOLCMP="${VOLCMP:+$VOLCMP }$icon_spl"
|
||||
fi
|
||||
fi
|
||||
sxmobar -a volume 50 "$VOLCMP"
|
||||
@@ -446,6 +434,17 @@ set_notch() {
|
||||
fi
|
||||
}
|
||||
|
||||
set_inputmethod() {
|
||||
im_file="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_t9_mode"
|
||||
if [ -r "$im_file" ]; then
|
||||
read -r im_mode < "$im_file" 2>/dev/null || im_mode="[abc]"
|
||||
else
|
||||
im_mode="[abc]"
|
||||
fi
|
||||
[ -n "$im_mode" ] || im_mode="[abc]"
|
||||
sxmobar -a input-method 5 "$im_mode"
|
||||
}
|
||||
|
||||
sxmo_debug "$@"
|
||||
case "$1" in
|
||||
network)
|
||||
@@ -456,20 +455,28 @@ case "$1" in
|
||||
shift
|
||||
set_battery "$@"
|
||||
;;
|
||||
time|modem|volume|state|notifications|notch)
|
||||
time|modem|volume|state|notifications|notch|inputmethod)
|
||||
set_"$1"
|
||||
;;
|
||||
periodics|state_change) # 55 s loop and screenlock triggers
|
||||
state_change)
|
||||
set_state
|
||||
set_time
|
||||
set_inputmethod
|
||||
;;
|
||||
periodics) # 55 s loop
|
||||
set_time
|
||||
set_inputmethod
|
||||
if [ -z "$SXMO_NO_MODEM" ]; then
|
||||
set_modem
|
||||
fi
|
||||
set_notch
|
||||
set_state
|
||||
set_network wifi wlan0
|
||||
sxmo_hook_battery.sh 2>/dev/null || true
|
||||
;;
|
||||
all)
|
||||
sxmobar -r
|
||||
set_inputmethod
|
||||
set_time
|
||||
if [ -z "$SXMO_NO_MODEM" ]; then
|
||||
set_modem
|
||||
@@ -481,8 +488,13 @@ case "$1" in
|
||||
set_notifications
|
||||
set_notch
|
||||
set_network wifi wlan0
|
||||
sxmo_hook_battery.sh 2>/dev/null || true
|
||||
;;
|
||||
*)
|
||||
exit # swallow it !
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${SXMO_WM:-dwm}" = "dwm" ] && command -v xsetroot >/dev/null 2>&1; then
|
||||
DISPLAY="${DISPLAY:-:0}" xsetroot -name "$(sxmo_status.sh)" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
@@ -9,12 +9,21 @@
|
||||
|
||||
# This hook is called when the system becomes unlocked again
|
||||
|
||||
sxmo_led.sh blink red green &
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_led.sh blink red green &
|
||||
fi
|
||||
|
||||
sxmo_wm.sh display on
|
||||
sxmo_wm.sh inputevent touchscreen on
|
||||
if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
|
||||
printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
|
||||
fi
|
||||
if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
|
||||
sxmo_wm.sh inputevent touchscreen on
|
||||
fi
|
||||
|
||||
sxmo_jobs.sh stop periodic_blink
|
||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||
sxmo_jobs.sh stop periodic_blink
|
||||
fi
|
||||
sxmo_jobs.sh stop periodic_wakelock_check
|
||||
|
||||
# Go to the next idle state after 120 seconds of inactivity
|
||||
|
||||
Reference in New Issue
Block a user