File config.sh of Package sway-test
#!/bin/bash
#================
# FILE : config.sh
#----------------
# PROJECT : OpenSuSE KIWI Image System
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved
# :
# AUTHOR : Marcus Schaefer <ms@suse.de>
# :
# BELONGS TO : Operating System images
# :
# DESCRIPTION : configuration script for SUSE based
# : operating systems
# :
# :
# STATUS : BETA
#----------------
#======================================
# Functions...
#--------------------------------------
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
#======================================
# Greeting...
#--------------------------------------
echo "Configure image: [$kiwi_iname]..."
#======================================
# Setup baseproduct link
#--------------------------------------
suseSetupProduct
#======================================
# Activate services
#--------------------------------------
suseInsertService sshd
suseInsertService grub_config
suseInsertService dracut_hostonly
#======================================
# Setup default target, multi-user
#--------------------------------------
baseSetRunlevel 3
for i in NetworkManager firewalld; do
systemctl -f enable $i
done
# Add repos from /etc/YaST2/control.xml
add-yast-repos
zypper --non-interactive rm -u live-add-yast-repos
mkdir -p /home/user/.config/tofi
tee /home/user/.config/tofi/config << 'EOF'
# Default config for tofi
#
# Copy this file to ~/.config/tofi/config and get customising!
#
# A complete reference of available options can be found in `man 5 tofi`.
#
### Fonts
#
# Font to use, either a path to a font file or a name.
#
# If a path is given, tofi will startup much quicker, but any
# characters not in the chosen font will fail to render.
#
# Otherwise, fonts are interpreted in Pango format.
font = "monospace"
# Point size of text.
font-size = 24
# Comma separated list of OpenType font feature settings to apply,
# if supported by the chosen font. The format is similar to the CSS
# "font-feature-settings" property.
#
# Examples:
#
# font-features = "smcp, c2sc" (all small caps)
# font-features = "liga 0" (disable ligatures)
font-features = ""
# Comma separated list of OpenType font variation settings to apply
# to variable fonts. The format is similar to the CSS
# "font-variation-settings" property.
#
# Examples:
#
# font-variations = "wght 900" (Extra bold)
# font-variations = "wdth 25, slnt -10" (Narrow and slanted)
font-variations = ""
# Perform font hinting. Only applies when a path to a font has been
# specified via `font`. Disabling font hinting speeds up text
# rendering appreciably, but will likely look poor at small font pixel
# sizes.
hint-font = true
#
### Text theming
#
# Default text color
#
# All text defaults to this color if not otherwise specified.
text-color = #ebdbb2
# All pieces of text have the same theming attributes available:
#
# *-color
# Foreground color
#
# *-background
# Background color
#
# *-background-padding
# Background padding in pixels (comma-delimited, CSS-style list).
# See "DIRECTIONAL VALUES" under `man 5 tofi` for more info.
#
# *-background-corner-radius
# Radius of background box corners in pixels
# Prompt text theme
# prompt-color = #FFFFFF
prompt-background = #00000000
prompt-background-padding = 0
prompt-background-corner-radius = 0
# Placeholder text theme
placeholder-color = #FFFFFFA8
placeholder-background = #00000000
placeholder-background-padding = 0
placeholder-background-corner-radius = 0
# Input text theme
# input-color = #FFFFFF
input-background = #00000000
input-background-padding = 0
input-background-corner-radius = 0
# Default result text theme
# default-result-color = #FFFFFF
default-result-background = #00000000
default-result-background-padding = 0
default-result-background-corner-radius = 0
# Alternate (even-numbered) result text theme
#
# If unspecified, these all default to the corresponding
# default-result-* attribute.
#
# alternate-result-color = #FFFFFF
# alternate-result-background = #00000000
# alternate-result-background-padding = 0
# alternate-result-background-corner-radius = 0
# Selection text
selection-color = #d79921
selection-background = #00000000
selection-background-padding = 0
selection-background-corner-radius = 0
# Matching portion of selection text
selection-match-color = #00000000
#
### Text cursor theme
#
# Style of the optional text cursor.
#
# Supported values: bar, block, underscore
text-cursor-style = bar
# Color of the text cursor
#
# If unspecified, defaults to the same as input-color
# text-cursor-color = #FFFFFF
# Color of text behind the text cursor when text-cursor-style = block
#
# If unspecified, defaults to the same as background-color
# text-cursor-background = #000000
# Corner radius of the text cursor
text-cursor-corner-radius = 0
# Thickness of the bar and underscore text cursors.
#
# If unspecified, defaults to a font-dependent value when
# text-cursor-style = underscore, or to 2 otherwise.
# text-cursor-thickness = 2
#
### Text layout
#
# Prompt to display.
prompt-text = "run: "
# Extra horizontal padding between prompt and input.
prompt-padding = 0
# Placeholder input text.
placeholder-text = ""
# Maximum number of results to display.
# If 0, tofi will draw as many results as it can fit in the window.
num-results = 5
# Spacing between results in pixels. Can be negative.
result-spacing = 0
# List results horizontally.
horizontal = false
# Minimum width of input in horizontal mode.
min-input-width = 0
#
### Window theming
#
# Width and height of the window. Can be pixels or a percentage.
width = 100%
height = 100%
# Window background color
background-color = #28282880
# Width of the border outlines in pixels.
outline-width = 0
# Border outline color
outline-color = #080800
# Width of the border in pixels.
border-width = 0
# Border color
border-color = #F92672
# Radius of window corners in pixels.
corner-radius = 0
# Padding between borders and text. Can be pixels or a percentage.
padding-top = 35%
padding-bottom = 8
padding-left = 35%
padding-right = 8
# Whether to clip text drawing to be within the specified padding. This
# is mostly important for allowing text to be inset from the border,
# while still allowing text backgrounds to reach right to the edge.
clip-to-padding = true
# Whether to scale the window by the output's scale factor.
scale = true
#
### Window positioning
#
# The name of the output to appear on. An empty string will use the
# default output chosen by the compositor.
output = ""
# Location on screen to anchor the window to.
#
# Supported values: top-left, top, top-right, right, bottom-right,
# bottom, bottom-left, left, center.
anchor = center
# Set the size of the exclusive zone.
#
# A value of -1 means ignore exclusive zones completely.
# A value of 0 will move tofi out of the way of other windows' zones.
# A value greater than 0 will set that much space as an exclusive zone.
#
# Values greater than 0 are only meaningful when tofi is anchored to a
# single edge.
exclusive-zone = -1
# Window offset from edge of screen. Only has an effect when anchored
# to the relevant edge. Can be pixels or a percentage.
margin-top = 0
margin-bottom = 0
margin-left = 0
margin-right = 0
#
### Behaviour
#
# Hide the mouse cursor.
hide-cursor = false
# Show a text cursor in the input field.
text-cursor = false
# Sort results by number of usages in run and drun modes.
history = true
# Specify an alternate file to read and store history information
# from / to. This shouldn't normally be needed, and is intended to
# facilitate the creation of custom modes.
# history-file = /path/to/histfile
# Use fuzzy matching for searches.
fuzzy-match = false
# If true, require a match to allow a selection to be made. If false,
# making a selection with no matches will print input to stdout.
# In drun mode, this is always true.
require-match = true
# If true, automatically accept a result if it is the only one
# remaining. If there's only one result on startup, window creation is
# skipped altogether.
auto-accept-single = false
# If true, typed input will be hidden, and what is displayed (if
# anything) is determined by the hidden-character option.
hide-input = false
# Replace displayed input characters with a character. If the empty
# string is given, input will be completely hidden.
# This option only has an effect when hide-input is set to true.
hidden-character = "*"
# If true, directly launch applications on selection when in drun mode.
# Otherwise, just print the command line to stdout.
drun-launch = false
# The terminal to run terminal programs in when in drun mode.
# This option has no effect if drun-launch is set to true.
# Defaults to the value of the TERMINAL environment variable.
terminal = alacritty
# Delay keyboard initialisation until after the first draw to screen.
# This option is experimental, and will cause tofi to miss keypresses
# for a short time after launch. The only reason to use this option is
# performance on slow systems.
late-keyboard-init = false
# If true, allow multiple simultaneous processes.
# If false, create a lock file on startup to prevent multiple instances
# from running simultaneously.
multi-instance = false
# Assume input is plain ASCII, and disable some Unicode handling
# functions. This is faster, but means e.g. a search for "e" will not
# match "é".
ascii-input = false
#
### Inclusion
#
# Configs can be split between multiple files, and then included
# within each other.
# include = /path/to/config
EOF
mkdir -p /home/user/.config/sway
tee /home/user/.config/sway/config << 'EOF'
# Default config for sway
#
# 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 alacritty
# 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 tofi-drun --drun-launch=true
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# 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 * power off"' resume 'swaymsg "output * power 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.
input * {
xkb_layout de
xkb_variant nodeadkeys
xkb_numlock enabled
}
focus_follows_mouse no
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# 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' '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:
#
# 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
#
# 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"
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
# theme
# class border background text indicator child_border
client.focused #fe8019 #d65d0e #ebdbb2 #665c54 #3c3836
client.focused_inactive #928374 #7c6f64 #ebdbb2 #665c54 #3c3836
# client.focused_inactive #928374 #7c6f64 #ebdbb2 #665c54 #3c3836
client.unfocused #3c3836 #1d2021 #ebdbb2 #665c54 #3c3836
client.urgent #fb4934 #cc241d #ebdbb2 #665c54 #3c3836
include /etc/sway/config.d/*
EOF
tee -a /home/user/.profile << 'EOF'
# If running from tty1 start sway
if [ "$(tty)" = "/dev/tty1" ] ; then
export GTK_THEME="Adwaita:dark"
export TERM="alacritty"
export _JAVA_AWT_WM_NONREPARENTING=1
exec sway
fi
EOF
mkdir /etc/systemd/system/getty@tty1.service.d/
tee -a /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF'
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin user %I $TERM
EOF