The first scripts have been added

- The help text
- The arguments
This commit is contained in:
Caesar
2020-05-09 09:47:19 -03:00
parent 9e8505fc5e
commit 03c4d230bb
12 changed files with 687 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
function nitrogenTemplate(){
cat << EOF
[xin_-1]
file=$HOME/.config/nitrogen/$wallpaper
mode=5
bgcolor=#000000
EOF
}
+300
View File
@@ -0,0 +1,300 @@
#!/bin/bash
function i3Template(){
local mod='$mod'
local ws1='$ws1'
local ws2='$ws2'
local ws3='$ws3'
local ws4='$ws4'
local ws5='$ws5'
local ws6='$ws6'
local ws7='$ws7'
local ws8='$ws8'
local mode_system='$mode_system'
local HOME='$HOME'
local mode_gaps='$mode_gaps'
local mode_gaps_outer='$mode_gaps_outer'
local mode_gaps_inner='$mode_gaps_inner'
cat << EOF
set $mod Mod4
new_window none
new_float none
hide_edge_borders none
bindsym $mod+u border none
bindsym $mod+y border pixel 1
bindsym $mod+n border normal
font xft:URWGothic-Book 11
floating_modifier $mod
bindsym $mod+Return exec i3-sensible-terminal
# Window kill command
bindsym $mod+Shift+q kill
# start program launcher
bindsym $mod+d exec --no-startup-id rofi -show run
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# workspace back and forth (with/without active container)
workspace_auto_back_and_forth yes
bindsym $mod+b workspace back_and_forth
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
# split orientation
bindsym $mod+h split h;exec notify-send 'tile horizontally'
bindsym $mod+v split v;exec notify-send 'tile vertically'
bindsym $mod+q split toggle
# toggle fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# toggle sticky
bindsym $mod+Shift+s sticky toggle
# focus the parent container
bindsym $mod+a focus parent
# 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
# navigate workspaces next / previous
bindsym $mod+Ctrl+Right workspace next
bindsym $mod+Ctrl+Left workspace prev
# workspaces
set $ws1 1
set $ws2 2
set $ws3 3
set $ws4 4
set $ws5 5
set $ws6 6
set $ws7 7
set $ws8 8
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
# Move focused container to workspace
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Ctrl+3 move container to workspace $ws3
bindsym $mod+Ctrl+4 move container to workspace $ws4
bindsym $mod+Ctrl+5 move container to workspace $ws5
bindsym $mod+Ctrl+6 move container to workspace $ws6
bindsym $mod+Ctrl+7 move container to workspace $ws7
bindsym $mod+Ctrl+8 move container to workspace $ws8
# Move to workspace with focused container
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8
# Open specific applications in floating mode
for_window [title="alsamixer"] floating enable border pixel 1
for_window [class="Calamares"] floating enable border normal
for_window [class="Clipgrab"] floating enable
for_window [title="File Transfer*"] floating enable
for_window [class="Galculator"] floating enable border pixel 1
for_window [class="GParted"] floating enable border normal
for_window [title="i3_help"] floating enable sticky enable border normal
for_window [class="Lightdm-gtk-greeter-settings"] floating enable
for_window [class="Lxappearance"] floating enable sticky enable border normal
for_window [class="Manjaro-hello"] floating enable
for_window [class="Manjaro Settings Manager"] floating enable border normal
for_window [title="MuseScore: Play Panel"] floating enable
for_window [class="Nitrogen"] floating enable sticky enable border normal
for_window [class="Oblogout"] fullscreen enable
for_window [class="octopi"] floating enable
for_window [title="About Pale Moon"] floating enable
for_window [class="Pamac-manager"] floating enable
for_window [class="Pavucontrol"] floating enable
for_window [class="qt5ct"] floating enable sticky enable border normal
for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
for_window [class="Simple-scan"] floating enable border normal
for_window [class="(?i)System-config-printer.py"] floating enable border normal
for_window [class="Skype"] floating enable border normal
for_window [class="Thus"] floating enable border normal
for_window [class="Timeset-gui"] floating enable border normal
for_window [class="Xfburn"] floating enable
# switch to workspace with urgent window automatically
for_window [urgent=latest] focus
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# Set shut down, restart and locking features
bindsym $mod+0 mode "$mode_system"
set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown
mode "$mode_system" {
bindsym l exec --no-startup-id i3exit lock, mode "default"
bindsym s exec --no-startup-id i3exit suspend, mode "default"
bindsym u exec --no-startup-id i3exit switch_user, mode "default"
bindsym e exec --no-startup-id i3exit logout, mode "default"
bindsym h exec --no-startup-id i3exit hibernate, mode "default"
bindsym r exec --no-startup-id i3exit reboot, mode "default"
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize"
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym j resize shrink width 5 px or 5 ppt
bindsym k resize grow height 5 px or 5 ppt
bindsym l resize shrink height 5 px or 5 ppt
bindsym semicolon resize grow width 5 px or 5 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# exit resize mode: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Autostart applications
exec --no-startup-id nitrogen --restore; sleep 1; compton -b
exec --no-startup-id nm-applet
# exec --no-startup-id xfce4-power-manager
exec --no-startup-id pamac-tray
exec --no-startup-id clipit
exec_always --no-startup-id ff-theme-util
exec_always --no-startup-id fix_xcursor
exec_always --no-startup-id $HOME/.config/polybar/i3wmthemer_bar_launch.sh
# Theme colors
client.focused ${i3wm['client.focused']}
client.focused_inactive ${i3wm['client.focused_inactive']}
client.unfocused ${i3wm['client.unfocused']}
client.urgent ${i3wm['client.urgent']}
client.placeholder ${i3wm['client.placeholder']}
client.background ${i3wm['client.background']}
# Gaps
gaps inner 10
gaps outer -4
smart_gaps on
# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
# set power-manager and volume control
exec --no-startup-id mate-power-manager
bindsym XF86AudioRaiseVolume exec --no-startup-id amixer -c 0 -q set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec --no-startup-id amixer -c 0 -q set Master 2db- unmute
bindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle
# touchpad on and off controller on laptop with Fn+<touchpad control functional key>
bindsym XF86TouchpadOn exec --no-startup-id synclient Touchpadoff=0
bindsym XF86TouchpadOff exec --no-startup-id synclient Touchpadoff=1
EOF
}
+167
View File
@@ -0,0 +1,167 @@
#!/bin/bash
function polybarTemplate(){
local USER='$USER'
cat << POLYBAR
[bar/i3wmthemer_bar]
width = 100%
height = 27
radius = 0
fixed-center = false
background = ${polybar['background']}
foreground = ${polybar['foreground']}
line-size = 3
line-color =
border-size = 0
border-color =
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = "Source Code Pro Semibold:size=10;1"
font-1 = "Font Awesome 5 Free:style=Solid:size=10;1"
font-2 = "Font Awesome 5 Brands:size=10;1"
modules-left = ${polybar['modules-left']}
modules-center = ${polybar['modules-center']}
modules-right = ${polybar['modules-right']}
tray-position =
;tray-padding =
wm-restack = i3
override-redirect = false
cursor-click = pointer
cursor-scroll = ns-resize
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
label-mode-padding = 2
label-mode-foreground = ${polybar['label-mode-foreground']}
label-mode-background = ${polybar['label-mode-background']}
label-focused = %index%
label-focused-background = ${polybar['label-focused-background']}
label-focused-foreground = ${polybar['label-focused-foreground']}
label-focused-padding = 2
label-unfocused = %index%
label-unfocused-background = ${polybar['label-unfocused-background']}
label-unfocused-foreground = ${polybar['label-unfocused-foreground']}
label-unfocused-padding = 2
label-visible = %index%
label-visible-background = ${polybar['label-visible-background']}
label-visible-foreground = ${polybar['label-visible-foreground']}
label-visible-padding = 2
label-urgent = %index%
label-urgent-background = #BA2922
label-urgent-padding = 2
[module/wlan]
type = internal/network
interface = net1
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-foreground = ${polybar['format-connected-foreground']}
format-connected-background = ${polybar['format-connected-background']}
format-connected-padding = 2
label-connected = %essid%
format-disconnected =
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${polybar['ramp-signal-foreground']}
[module/eth]
type = internal/network
interface = enp0s15
interval = 3.0
format-connected-padding = 2
format-connected-foreground = ${polybar['format-connected-foreground']}
format-connected-background = ${polybar['format-connected-background']}
format-connected-prefix = " "
format-connected-prefix-foreground = ${polybar['format-connected-prefix-foreground']}
label-connected = %local_ip%
format-disconnected =
[module/date]
type = internal/date
interval = 5
date =
date-alt = " %Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-prefix = 
format-foreground = ${polybar['format-foreground']}
format-background = ${polybar['format-background']}
format-padding = 2
label = %date% %time%
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${polybar['label-open-foreground']}
label-close =  cancel
label-close-foreground = ${polybar['label-close-foreground']}
label-separator = |
label-separator-foreground = ${polybar['label-separator-foreground']}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-0-2 = log off
menu-0-2-exec = menu-open-3
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
menu-3-0 = log off
menu-3-0-exec = pkill -KILL -u $USER
menu-3-1 = cancel
menu-3-1-exec = menu-open-0
[settings]
screenchange-reload = true
[global/wm]
margin-top = 0
margin-bottom = 0
POLYBAR
}
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
function xresourcesTemplate(){
cat << XRESOURCES
*background: ${xresources['background']}
*foreground: ${xresources['foreground']}
*cursorColor: ${xresources['cursorcolor']}
*color0: ${xresources['color0']}
*color8: ${xresources['color8']}
*color1: ${xresources['color1']}
*color9: ${xresources['color9']}
*color2: ${xresources['color2']}
*color10: ${xresources['color10']}
*color3: ${xresources['color3']}
*color11: ${xresources['color11']}
*color4: ${xresources['color4']}
*color12: ${xresources['color12']}
*color5: ${xresources['color5']}
*color13: ${xresources['color13']}
*color6: ${xresources['color6']}
*color14: ${xresources['color14']}
*color7: ${xresources['color7']}
*color15: ${xresources['color15']}
URxvt.font: xft:Source Code Pro:size=12
URxvt.depth: 32
URxvt*scrollBar: false
URxvt*mouseWheelScrollPage: false
URxvt*cursorBlink: true
URxvt*saveLines: 5000
URxvt*internalBorder: 5
URxvt*geometry: 70x19
rofi.color-enabled: true
rofi.color-window: ${xresources['rofi.color-window']}
rofi.color-normal: ${xresources['rofi.color-normal']}
rofi.color-active: ${xresources['rofi.color-active']}
rofi.color-urgent: ${xresources['rofi.color-urgent']}
rofi.separator-style: solid
rofi.sidebar-mode: false
rofi.lines: 5
rofi.font: Source Code Pro Semibold 10.5
rofi.bw: 1
rofi.columns: 2
rofi.padding: 5
rofi.fixed-num-lines: true
rofi.hide-scrollbar: true
! Normal copy-paste keybindings without perls
URxvt.iso14755: false
URxvt.keysym.Shift-Control-V: eval:paste_clipboard
URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard
!Xterm escape codes, word by word movement
URxvt.keysym.Control-Left: \033[1;5D
URxvt.keysym.Shift-Control-Left: \033[1;6D
URxvt.keysym.Control-Right: \033[1;5C
URxvt.keysym.Shift-Control-Right: \033[1;6C
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Shift-Control-Up: \033[1;6A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Shift-Control-Down: \033[1;6B
XRESOURCES
}
Executable
+77
View File
@@ -0,0 +1,77 @@
#!/bin/bash
function helpText() {
cat << HELP
I3WM-THEMER, a non-interactive program to apply themes on i3 window manager.
Usage:
./$(basename "$0") [OPTION]
Example:
./$(basename "$0") -a 00
Options:
-h, --help (Display this help message)
-a, --apply THEME_ID (Apply the theme with given id)
-r, --restore (Restore to distribution default configs)
Available themes:
$(listThemes)
Check /themes/screenshots to see how the themes look like and
send bugs and questions to <https://github.com/cizordj/i3wm-themer>
HELP
exit 0
}
function listThemes(){
cd themes
for file in *.sh ; do
echo $file
done
cd $OLDPWD
}
function restoreDefaults(){
echo "Resetting all configuration files to default"
exit 0
}
function missingTheme(){
cat << EOF
The theme you chose doesn't exist on themes directory
The available themes are:
$(listThemes)
EOF
exit 1
}
function createConfigFiles(){
mkdir -p $HOME/.config
mkdir -p $HOME/.config/i3
mkdir -p $HOME/.config/polybar
mkdir -p $HOME/.config/nitrogen
touch $HOME/.Xresources
touch $HOME/.config/i3/config
touch $HOME/.config/polybar/config
touch $HOME/.config/nitrogen/bg-saved.cfg
}
while [ 0 ]; do
if [[ ! $# -gt 0 ]] ; then
helpText
elif [ "$1" = "-h" -o "$1" = "--help" -o "$1" = "help" ] ; then
helpText
elif [ "$1" = "-a" -o "$1" = "--apply" -o "$1" = "apply" ] ; then
shift 1
THEME=$1
elif [ "$1" = "-r" -o "$1" = "--restore" -o "$1" = "restore" ] ; then
restoreDefaults
else
break
fi
done
CHOSEN_THEME="$PWD/themes/$THEME.sh"
if [ ! -f $THEME_FILE ] ; then
missingTheme
else
source $CHOSEN_THEME
fi
createConfigFiles
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
function loadTheme(){
$1='path/to/theme.sh'
}
function loadConfigFiles(){
}
Executable
+60
View File
@@ -0,0 +1,60 @@
#!/bin/bash
declare -A xresources
declare -A i3wm
declare -A polybar
xresources['background']='#1d1f21'
xresources['foreground']='#c5c8c6'
xresources['cursorcolor']='#c5c8c6'
xresources['color0']='#282a2e'
xresources['color1']='#a54242'
xresources['color2']='#8c9440'
xresources['color3']='#de935f'
xresources['color4']='#5f819d'
xresources['color5']='#85678f'
xresources['color6']='#5e8d87'
xresources['color7']='#707880'
xresources['color8']='#373b41'
xresources['color9']='#cc6666'
xresources['color10']='#b5bd68'
xresources['color11']='#f0c674'
xresources['color12']='#81a2be'
xresources['color13']='#b294bb'
xresources['color14']='#8abeb7'
xresources['color15']='#c5c8c6'
xresources['rofi.color-window']='#282a2e, #b5bd68, #b5bd68'
xresources['rofi.color-normal']='#282a2e, #c5c8c6, #8c9440, #c5c8c6, #78824B'
xresources['rofi.color-active']='#282a2e, #c5c8c6, #8c9440, #c5c8c6, #78824B'
xresources['rofi.color-urgent']='#282a2e, #c5c8c6, #8c9440, #c5c8c6, #78824B'
i3wm['client.background']='#1d1f21'
i3wm['client.focused']='#c5c8c6 #1d1f21 #c5c8c6 #81a2be #81a2be'
i3wm['client.unfocused']='#c5c8c6 #1d1f21 #c5c8c6 #5f819d #5f819d'
i3wm['client.focused_inactive']='#c5c8c6 #1d1f21 #c5c8c6 #5f819d #5f819d'
i3wm['client.urgent']='#c5c8c6 #1d1f21 #c5c8c6 #5f819d #5f819d'
i3wm['client.placeholder']='#c5c8c6 #1d1f21 #c5c8c6 #5f819d #5f819d'
polybar['background']='#1d1f21'
polybar['foreground']='#c5c8c6'
polybar['modules-left']='wlan eth'
polybar['modules-center']='i3'
polybar['modules-right']='date powermenu'
polybar['label-unfocused-background']='#81a2be'
polybar['label-unfocused-foreground']='#1d1f21'
polybar['label-mode-background']='#1d1f21'
polybar['label-mode-foreground']='#282a2e'
polybar['label-focused-foreground']='#1d1f21'
polybar['label-focused-background']='#5f819d'
polybar['label-visible-background']='#81a2be'
polybar['label-visible-foreground']='#1d1f21'
polybar['format-foreground']='#1d1f21'
polybar['format-background']='#81a2be'
polybar['label-open-foreground']='#81a2be'
polybar['label-close-foreground']='#81a2be'
polybar['label-separator-foreground']='#81a2be'
polybar['format-connected-foreground']='#1d1f21'
polybar['format-connected-background']='#81a2be'
polybar['format-connected-prefix-foreground']='#1d1f21'
polybar['ramp-signal-foreground']='#1d1f21'
wallpaper='000.png'