From e3e5c2546ebf2aa42c809cf9305f90cf395236a6 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Tue, 30 Apr 2024 12:43:32 -0400 Subject: fork to acer-chromebook --- src/Makefile | 8 +- src/etc/stackrpms-acer-chromebook/Xmodmap | 21 ++ src/etc/stackrpms-acer-chromebook/fluxbox.init | 89 +++++ src/etc/stackrpms-acer-chromebook/fluxbox.keys | 205 +++++++++++ src/etc/stackrpms-acer-chromebook/fluxbox.menu | 8 + src/etc/stackrpms-acer-chromebook/fluxbox.startup | 93 +++++ .../stackrpms-acer-chromebook/fluxbox.windowmenu | 15 + src/etc/stackrpms-thinkpad-p50s/Xmodmap | 20 -- src/etc/stackrpms-thinkpad-p50s/fluxbox.keys | 206 ----------- src/etc/stackrpms-thinkpad-p50s/fluxbox.startup | 92 ----- src/usr/bin/hwset-acer-chromebook | 380 +++++++++++++++++++++ src/usr/bin/hwset-thinkpad-p50s | 379 -------------------- src/usr/bin/netmounts-trayicon | 4 +- src/usr/bin/vpn-trayicon | 4 +- .../share/doc/stackrpms-acer-chromebook/README.md | 54 +++ .../share/doc/stackrpms-thinkpad-p50s/README.md | 61 ---- src/usr/share/man/man1/hwset-thinkpad-p50s.1.txt | 14 +- src/usr/share/man/man1/netmounts-off.1.txt | 2 +- src/usr/share/man/man1/netmounts-on.1.txt | 2 +- src/usr/share/man/man1/netmounts-trayicon.1.txt | 2 +- src/usr/share/man/man1/vpn-off.1.txt | 2 +- src/usr/share/man/man1/vpn-on.1.txt | 2 +- src/usr/share/man/man1/vpn-trayicon.1.txt | 2 +- 23 files changed, 886 insertions(+), 779 deletions(-) create mode 100644 src/etc/stackrpms-acer-chromebook/Xmodmap create mode 100644 src/etc/stackrpms-acer-chromebook/fluxbox.init create mode 100644 src/etc/stackrpms-acer-chromebook/fluxbox.keys create mode 100644 src/etc/stackrpms-acer-chromebook/fluxbox.menu create mode 100644 src/etc/stackrpms-acer-chromebook/fluxbox.startup create mode 100644 src/etc/stackrpms-acer-chromebook/fluxbox.windowmenu delete mode 100644 src/etc/stackrpms-thinkpad-p50s/Xmodmap delete mode 100644 src/etc/stackrpms-thinkpad-p50s/fluxbox.keys delete mode 100644 src/etc/stackrpms-thinkpad-p50s/fluxbox.startup create mode 100755 src/usr/bin/hwset-acer-chromebook delete mode 100755 src/usr/bin/hwset-thinkpad-p50s create mode 100644 src/usr/share/doc/stackrpms-acer-chromebook/README.md delete mode 100644 src/usr/share/doc/stackrpms-thinkpad-p50s/README.md (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 503527f..598b137 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,8 @@ -# File: Makefile for stackrpms-thinkpad-p50s -# Location: stackrpms-thinkpad-p50s source package +# File: Makefile for stackrpms-acer-chromebook +# Location: stackrpms-acer-chromebook source package # Author: bgstack15 # Startdate: 2022-11-04 -# Title: Makefile for stackrpms-thinkpad-p50s source package +# Title: Makefile for stackrpms-acer-chromebook source package # Purpose: To use traditional Unix make utility # History: # 2022-11-04 forked from bgscripts Makefile @@ -14,7 +14,7 @@ # Dependencies: # build-devuan: txt2man -APPNAME = stackrpms-thinkpad-p50s +APPNAME = stackrpms-acer-chromebook APPVERSION = 0.0.1 SRCDIR = $(CURDIR) prefix = /usr diff --git a/src/etc/stackrpms-acer-chromebook/Xmodmap b/src/etc/stackrpms-acer-chromebook/Xmodmap new file mode 100644 index 0000000..1d7eb58 --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/Xmodmap @@ -0,0 +1,21 @@ +! File: /etc/stackrpms-acer-chromebook/Xmodmap +! Location: stackrpms-acer-chromebook package +! Author: bgstack15 +! SPDX-License-Identifier: GPL-3.0 +! Startdate: 2019-12-26 +! Title: Common Xmodmap for Acer Chromebook platform +! Package: stackrpms-acer-chromebook +! Purpose: custom Xmodmap for Acer Chromebook +! History: +! 2022-11-03 adapted for package +! 2024-04-30 Included, but has no contents for Acer Chromebook C720 +! Usage: +! in ~/.fluxbox/startup (possibly symlinked to /etc/stackrpms-acer-chromebook/fluxbox.startup), run `xmodmap /etc/stackrpms-acer-chromebook/Xmodmap` +! Reference: +! xev +! Improve: +! Documentation: +! last modified: 2024-04-30-3 12:19 + +! turn calculator key into context menu key +!keycode 148 = Menu diff --git a/src/etc/stackrpms-acer-chromebook/fluxbox.init b/src/etc/stackrpms-acer-chromebook/fluxbox.init new file mode 100644 index 0000000..0d3904c --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/fluxbox.init @@ -0,0 +1,89 @@ +session.screen0.window.focus.alpha: 255 +session.screen0.window.unfocus.alpha: 255 +session.screen0.iconbar.iconTextPadding: 10 +session.screen0.iconbar.mode: {static groups} (workspace) +session.screen0.iconbar.iconWidth: 128 +session.screen0.iconbar.usePixmap: true +session.screen0.iconbar.alignment: Left +session.screen0.slit.autoHide: false +session.screen0.slit.maxOver: false +session.screen0.slit.acceptKdeDockapps: true +session.screen0.slit.onhead: 0 +session.screen0.slit.layer: Dock +session.screen0.slit.placement: RightBottom +session.screen0.slit.alpha: 255 +session.screen0.slit.autoRaise: false +session.screen0.menu.alpha: 255 +session.screen0.systray.pinLeft: +session.screen0.systray.pinRight: +session.screen0.tab.placement: TopLeft +session.screen0.tab.width: 64 +session.screen0.clientMenu.usePixmap: true +session.screen0.tabs.usePixmap: true +session.screen0.tabs.maxOver: false +session.screen0.tabs.intitlebar: true +session.screen0.titlebar.left: +session.screen0.titlebar.right: Minimize Maximize Close +session.screen0.toolbar.height: 0 +session.screen0.toolbar.autoHide: false +session.screen0.toolbar.layer: Dock +session.screen0.toolbar.autoRaise: false +session.screen0.toolbar.widthPercent: 100 +session.screen0.toolbar.maxOver: false +session.screen0.toolbar.tools: iconbar, systemtray, clock +session.screen0.toolbar.onhead: 1 +session.screen0.toolbar.placement: TopCenter +session.screen0.toolbar.alpha: 255 +session.screen0.toolbar.visible: true +session.screen0.noFocusWhileTypingDelay: 0 +session.screen0.edgeResizeSnapThreshold: 0 +session.screen0.demandsAttentionTimeout: 500 +session.screen0.defaultDeco: NORMAL +session.screen0.tooltipDelay: 500 +session.screen0.edgeSnapThreshold: 10 +session.screen0.workspacewarpinghorizontaloffset: 1 +session.screen0.maxDisableMove: false +session.screen0.clickRaises: true +session.screen0.workspacewarpingvertical: true +session.screen0.focusNewWindows: true +session.screen0.workspacewarpingverticaloffset: 1 +session.screen0.fullMaximization: false +session.screen0.rowPlacementDirection: LeftToRight +session.screen0.strftimeFormat: %b %d, %a %02k:%M:%S +session.screen0.windowPlacement: RowMinOverlapPlacement +session.screen0.maxDisableResize: false +session.screen0.workspacewarping: true +session.screen0.workspaces: 1 +session.screen0.tabFocusModel: ClickToTabFocus +session.screen0.autoRaise: true +session.screen0.maxIgnoreIncrement: true +session.screen0.workspaceNames: Workspace 1, +session.screen0.opaqueResize: false +session.screen0.focusModel: ClickFocus +session.screen0.workspacewarpinghorizontal: true +session.screen0.windowMenu: .fluxbox/windowmenu +session.screen0.showwindowposition: false +session.screen0.opaqueMove: true +session.screen0.allowRemoteActions: true +session.screen0.opaqueResizeDelay: 50 +session.screen0.colPlacementDirection: TopToBottom +session.screen0.menuDelay: 200 +session.screen0.showClientmachine: true +session.screen0.focusSameHead: false +session.tabPadding: 0 +session.tabsAttachArea: Window +session.forcePseudoTransparency: false +session.colorsPerChannel: 4 +session.cacheLife: 5 +session.styleFile: /usr/share/fluxbox/styles/bgstack15a +session.ignoreBorder: false +session.slitlistFile: .fluxbox/slitlist +session.appsFile: .fluxbox/apps +session.doubleClickInterval: 250 +session.keyFile: ~/.fluxbox/keys +session.styleOverlay: .fluxbox/overlay +session.menuSearch: itemstart +session.menuFile: ~/.fluxbox/menu +session.configVersion: 13 +session.autoRaiseDelay: 250 +session.cacheMax: 200 diff --git a/src/etc/stackrpms-acer-chromebook/fluxbox.keys b/src/etc/stackrpms-acer-chromebook/fluxbox.keys new file mode 100644 index 0000000..96865cd --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/fluxbox.keys @@ -0,0 +1,205 @@ +# File: /etc/stackrpms-acer-chromebook/fluxbox.keys +# Location: stackrpms-acer-chromebook package +# Author: bgstack15 +# Startdate: 2019-12-26 +# SPDX-License-Identifier: GPL-3.0 +# Title: Common fluxbox keys for Thinkpad P50s platform +# Package: stackrpms-acer-chromebook +# Purpose: standardize fluxbox config across systems +# History: +# 2019-12-26 started on ltb-018 +# 2022-11-03 adapted for this package +# 2023-12-12 revised to be identical for stackrpms-thinkpad-p50s and bgconf +# 2024-04-30 adapted for acer chromebook package +# Usage: +# symlink your ~/.fluxbox/keys to this file with: +# ln -sf /etc/stackrpms-acer-chromebook/fluxbox.keys ~/.fluxbox/keys +# Reference: +# ltb-018:~/.fluxbox/keys +# Improve: +# Documentation: +# last modified: 2024-04-30-3 12:20 + +# click on the desktop to get menus +OnDesktop Mouse1 :HideMenus +OnDesktop Mouse2 :WorkspaceMenu +OnDesktop Mouse3 :RootMenu + +Ctrl Shift Escape :RootMenu + +# scroll on the desktop to change workspaces +OnDesktop Mouse4 :PrevWorkspace +OnDesktop Mouse5 :NextWorkspace + +# scroll on the toolbar to change current window +# disabling these allows the alsa icon to work +#OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no) +#OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no) + +# alt + left/right click to move/resize a window +#OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} +OnWindow Mod1 Mouse1 :If {And {Matches (Fullscreen!=yes)} {Matches (@_NET_WM_STATE!=.*_FULLSCREEN.*)} } {MacroCmd {Raise} {Focus} {StartMoving}} +OnWindowBorder Move1 :StartMoving + +#OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner} +OnWindow Mod1 Mouse3 :If {And {Matches (Fullscreen!=yes)} {Matches (@_NET_WM_STATE!=.*_FULLSCREEN.*)} } {MacroCmd {Raise} {Focus} {StartResizing NearestCorner}} +OnLeftGrip Move1 :StartResizing bottomleft +OnRightGrip Move1 :StartResizing bottomright + +# alt + middle click to lower the window +OnWindow Mod1 Mouse2 :Lower + +# control-click a window's titlebar and drag to attach windows +OnTitlebar Ctrl Mouse1 :StartTabbing + +# double click on the titlebar to maximize instead of shade +OnTitlebar Double Mouse1 :Maximize + +# left click on the titlebar to move the window +OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab} +OnTitlebar Move1 :StartMoving + +# middle click on the titlebar to lower +#OnTitlebar Mouse2 :Lower + +# right click on the titlebar for a menu of options +OnTitlebar Mouse3 :WindowMenu + +# alt-tab +# handled by application alttab from startup +#Mod1 Tab :NextWindow {groups} (workspace=[current]) +#Mod1 Shift Tab :PrevWindow {groups} (workspace=[current]) + +# cycle through tabs in the current window +Mod4 Tab :NextTab +Mod4 Shift Tab :PrevTab + +# go to a specific tab in the current window +Mod4 1 :Tab 1 +Mod4 2 :Tab 2 +Mod4 3 :Tab 3 +Mod4 4 :Tab 4 +Mod4 5 :Tab 5 +Mod4 6 :Tab 6 +Mod4 7 :Tab 7 +Mod4 8 :Tab 8 +Mod4 9 :Tab 9 + +# open a terminal +Mod1 F1 :Exec x-terminal-emulator +Mod1 Shift F1 :Exec xterm + +# open a dialog to run programs +Mod1 F2 :Exec fbrun + +# volume settings, using common keycodes +# if these don't work, use xev to find out your real keycodes +# alsa only, volume control +#123 :Exec amixer sset Master,0 1+ +#122 :Exec amixer sset Master,0 1- +#121 :Exec amixer sset Master,0 toggle +# pulseaudio, volume control +Ctrl Shift 74 :Exec pulsemixer-notification toggle +Ctrl Shift 75 :Exec pulsemixer-notification down +Ctrl Shift 76 :Exec pulsemixer-notification up + +# Acer Chromebook C720 screen brightness +Ctrl Shift 72 :Exec /usr/bin/hwset bright down 85 +Ctrl Shift 73 :Exec /usr/bin/hwset bright up 85 + +# current window commands +Mod1 F4 :Close +Mod1 F5 :Kill +Mod1 F9 :Minimize +Mod1 F10 :Maximize +Mod1 F11 :Fullscreen + +# open the window menu +Mod1 space :WindowMenu + +# disabled because this is dangerous +# exit fluxbox +#Ctrl Mod1 Delete :Exit + +# change to previous/next workspace +Ctrl Mod1 Left :PrevWorkspace +Ctrl Mod1 Right :NextWorkspace + +# send the current window to previous/next workspace +#Mod4 Left :SendToPrevWorkspace +#Mod4 Right :SendToNextWorkspace + +# send the current window and follow it to previous/next workspace +#Ctrl Mod4 Left :TakeToPrevWorkspace +#Ctrl Mod4 Right :TakeToNextWorkspace + +# clipboard manager menu +Ctrl Shift z :ExecCommand copyq menu + +# bgstack15 custom +# adapted from https://abchk1234.wordpress.com/2015/02/01/native-window-snapping-window-tiling-with-fluxbox-openbox-and-xfwm4-xfce/ +# Up 111 +# Left 113 Right 114 +# Down 116 +Mod4 111 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up} +Mod4 113 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left} +Mod4 114 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right} +Mod4 116 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom} + +Mod4 Mod1 111 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 00% Up} +Mod4 Mod1 113 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 00% Up} +Mod4 Mod1 114 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 50% Up} +Mod4 Mod1 116 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 50% Up} +Mod4 Return :ToggleCmd {Maximize} {Restore} + +# move to next monitor +#Mod4 Shift 113 :ExecCommand move-to-next-monitor --reverse +#Mod4 Shift 114 :ExecCommand move-to-next-monitor +Mod4 Shift 113 :MacroCmd {SendToPrevHead} +Mod4 Shift 114 :MacroCmd {SendToNextHead} + +107 :Exec scrot -z -e 'mv $f ~/Pictures' +Mod1 107 :Exec scrot -ubz -e 'mv $f ~/Pictures' +Ctrl 107 :Exec sleep 0.08 ; scrot -s -f -l 'style=dash,width=1' -z -e 'mv $f ~/Pictures' +Mod4 Ctrl V :Exec veracrypt +Mod4 Ctrl C :Exec FreeFileSync +Mod4 D :ShowDesktop +Mod4 E :Exec xfe +Mod4 L :Exec xscreensaver-command -lock +Mod4 O :Exec scite +Mod4 R :Exec fbrun +Mod4 Shift C :Exec x-terminal-emulator +# librewolf used to use apulse +Mod4 Shift F :Exec librewolf +#Mod4 Shift F :Exec newmoon +Mod4 Shift G :Exec firefox +Mod4 Shift H :Exec waterfox +Mod4 Shift I :Exec irfanview +Mod4 Shift L :Exec keepass2 +Mod4 Shift V :Exec vlc +Mod4 Shift W :Exec libreoffice --writer +Mod4 Shift X :Exec libreoffice --calc + +Ctrl Mod4 R :Reconfigure +Ctrl Shift Mod4 R :Restart + +#Ctrl Shift Mod4 X :Exec bin/move-to-end-of-taskbar.sh +Ctrl Shift Mod4 X :Exec xdotool getactivewindow windowunmap windowmap + +# Numlock on +# 16 17 18 +# 13 14 15 +# 10 11 12 +Mod4 Mod1 87 :MacroCmd {ResizeTo 33% 33%} {MoveTo 00% 67% Up} +Mod4 Mod1 88 :MacroCmd {ResizeTo 34% 33%} {MoveTo 33% 67% Up} +Mod4 Mod1 89 :MacroCmd {ResizeTo 33% 33%} {MoveTo 67% 67% Up} +Mod4 Mod1 83 :MacroCmd {ResizeTo 33% 34%} {MoveTo 00% 33% Up} +Mod4 Mod1 84 :MacroCmd {ResizeTo 34% 34%} {MoveTo 33% 33% Up} +Mod4 Mod1 85 :MacroCmd {ResizeTo 33% 34%} {MoveTo 67% 33% Up} +Mod4 Mod1 79 :MacroCmd {ResizeTo 33% 33%} {MoveTo 00% 00% Up} +Mod4 Mod1 80 :MacroCmd {ResizeTo 34% 33%} {MoveTo 33% 00% Up} +Mod4 Mod1 81 :MacroCmd {ResizeTo 33% 33%} {MoveTo 67% 00% Up} + +# Acer Chromebook C720 keys, React to power key +# The ability to use this depends on elogind-inhibit! +124 :Exec logout-manager-gtk diff --git a/src/etc/stackrpms-acer-chromebook/fluxbox.menu b/src/etc/stackrpms-acer-chromebook/fluxbox.menu new file mode 100644 index 0000000..aab0c0a --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/fluxbox.menu @@ -0,0 +1,8 @@ +[begin] (fluxbox) +[include] (.fluxbox/xdg-menu) +#[include] (/etc/xdgmenumaker/fluxbox) +#[exec] (Update xdg menu) {/usr/bin/xdgmenumaker -f fluxbox -i > ~/.fluxbox/xdg-menu} +#[exec] (Resize display) {/usr/bin/resize-x} +[include] (/etc/X11/fluxbox/fluxbox-menu) +#[exec] (Logout...) {/usr/bin/logout-manager} +[end] diff --git a/src/etc/stackrpms-acer-chromebook/fluxbox.startup b/src/etc/stackrpms-acer-chromebook/fluxbox.startup new file mode 100644 index 0000000..ef8cd5a --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/fluxbox.startup @@ -0,0 +1,93 @@ +#!/bin/sh +# File: /etc/stackrpms-acer-chromebook/fluxbox.startup +# Location: stackrpms-acer-chromebook package +# Author: bgstack15 +# Startdate: 2019-12-26 +# SPDX-License-Identifier: GPL-3.0 +# Title: Common fluxbox startup file for Thinkpad P50s platform +# Package: stackrpms-acer-chromebook +# Purpose: standardize fluxbox config across systems +# History: +# 2019-12-26 started on ltb-018 from fluxbox startup example +# 2022-11-03 adapted for this package +# 2023-12-12 revised to be consistent across bgconf and stackrpms-thinkpad-p50s +# 2024-04-30 adapted for acer chromebook package +# Usage: +# symlink your ~/.fluxbox/startup to this file with: +# ln -sf /etc/stackrpms-acer-chromebook/fluxbox.startup ~/.fluxbox/startup +# Reference: +# ltb-018:~/.fluxbox/startup +# Improve: +# Documentation: +# last modified: 2022-11-03-5 14:28 + +# Change your keymap: +test -f /etc/stackrpms-acer-chromebook/Xmodmap && xmodmap /etc/stackrpms-acer-chromebook/Xmodmap +test -f .Xmodmap && xmodmap ".Xmodmap" + +echo "${PATH}" | grep -q "${HOME}/bin" 1>/dev/null 2>&1 && export PATH="${HOME}/bin:${PATH}" + +# for vlc on hidpi screens +export QT_AUTO_SCREEN_SCALE_FACTOR=0 +export QT_SCREEN_SCALE_FACTORS=1 + +# Applications you want to run with fluxbox. +which fbautostart > /dev/null +if [ $? -eq 0 ]; then + fbautostart +fi + +# for desktop icons. Because I use xfe for a file manager, spacefm would only be installed for xdg desktop icons +spacefm --desktop & + +start-pulseaudio-x11 & +volumeicon & +copyq & +xscreensaver -nosplash & +# This might be redundant if /usr/share/services/com.example.Notifications.service but will not hurt. +/usr/lib/notification-daemon/notification-daemon & +telegram-desktop & +alttab -w 1 -s 1 -theme Numix-Circle & +# It is expected to only use one of: cbatticon powerkit +cbatticon -i symbolic & +DESKTOP_SESSION=gnome powerkit & +sudo mount -a & +# Obviously should not be installed on physical systems +spice-vdagent 1>/dev/null 2>&1 & +# Fallback: +#xdgmenumaker -f fluxbox -i > ~/.fluxbox/xdg-menu & +xdgmenumaker-user fluxbox & +keyboard-leds-trayicons & +xscreensaver-watch & +logout-manager-trayicon & +# probably only one of these will be used: +wicd-client -t & +connman-gtk & +myautomountd & +myautomount-trayicon & +netmounts-trayicon & +# vpn-trayicon is only useful on demand. +#vpn-trayicon & +# If fbxkb is installed, set up us(qwerty) and us(dvorak) +which fbxkb 1>/dev/null 2>&1 && test -f /etc/use-fbxkb && { + setxkbmap -option grp:switch,grp:shifts_toggle 'us,us(dvorak)' & + fbxkb & +} +KRB5_AUTH_DIALOG_DEBUG="no-persistence,no-app-menu,no-header-bar" gtk3-nocsd krb5-auth-dialog & +/usr/bin/printf "" | sudo tee /var/lib/dbus/machine-id 1>/dev/null 2>&1 & + +# set wallpaper +# use by symlinking /etc/wallpaper to whatever you want +fbsetbg -a /etc/wallpaper + +# Mask weird button presses 8, 9 on scroll-up, scroll-down +xinput set-button-map "$( xinput | awk -F'[=]' '/ouse/{print $2}' | awk '{print $1}' | head -n1 )" 1 2 3 4 5 6 7 0 0 & + +# Make this extensible so I do not have to customize ~/.fluxbox/startup on each system +test -f "${HOME}/.fluxbox/startup-local" && . "${HOME}/.fluxbox/startup-local" & + +# And last but not least we start fluxbox. +# Because it is the last app you have to run it with ''exec'' before it. +exec fluxbox +# or if you want to keep a log: +# exec fluxbox -log ~/fluxbox/log diff --git a/src/etc/stackrpms-acer-chromebook/fluxbox.windowmenu b/src/etc/stackrpms-acer-chromebook/fluxbox.windowmenu new file mode 100644 index 0000000..3e5d4e0 --- /dev/null +++ b/src/etc/stackrpms-acer-chromebook/fluxbox.windowmenu @@ -0,0 +1,15 @@ +[begin] +# [shade] +# [stick] + [maximize] + [iconify] +# [raise] +# [lower] +# [settitledialog] +# [sendto] + [layer] +# [alpha] +# [extramenus] +# [separator] + [close] +[end] diff --git a/src/etc/stackrpms-thinkpad-p50s/Xmodmap b/src/etc/stackrpms-thinkpad-p50s/Xmodmap deleted file mode 100644 index 8d9cee6..0000000 --- a/src/etc/stackrpms-thinkpad-p50s/Xmodmap +++ /dev/null @@ -1,20 +0,0 @@ -! File: /etc/stackrpms-thinkpad-p50s/Xmodmap -! Location: stackrpms-thinkpad-p50s package -! Author: bgstack15 -! SPDX-License-Identifier: GPL-3.0 -! Startdate: 2019-12-26 -! Title: Common Xmodmap for Thinkpad P50s platform -! Package: stackrpms-thinkpad-p50s -! Purpose: custom Xmodmap for Thinkpad P50s -! History: -! 2022-11-03 adapted for package -! Usage: -! in ~/.fluxbox/startup (possibly symlinked to /etc/stackrpms-thinkpad-p50s/fluxbox.startup), run `xmodmap /etc/stackrpms-thinkpad-p50s/Xmodmap` -! Reference: -! xev -! Improve: -! Documentation: -! last modified: 2022-11-03-5 14:36 - -! turn calculator key into context menu key -keycode 148 = Menu diff --git a/src/etc/stackrpms-thinkpad-p50s/fluxbox.keys b/src/etc/stackrpms-thinkpad-p50s/fluxbox.keys deleted file mode 100644 index 2ab169f..0000000 --- a/src/etc/stackrpms-thinkpad-p50s/fluxbox.keys +++ /dev/null @@ -1,206 +0,0 @@ -# File: /etc/stackrpms-thinkpad-p50s/fluxbox.keys -# Location: stackrpms-thinkpad-p50s package -# Author: bgstack15 -# Startdate: 2019-12-26 -# SPDX-License-Identifier: GPL-3.0 -# Title: Common fluxbox keys for Thinkpad P50s platform -# Package: stackrpms-thinkpad-p50s -# Purpose: standardize fluxbox config across systems -# History: -# 2019-12-26 started on ltb-018 -# 2022-11-03 adapted for this package -# 2023-12-12 revised to be identical for stackrpms-thinkpad-p50s and bgconf -# Usage: -# symlink your ~/.fluxbox/keys to this file with: -# ln -sf /etc/stackrpms-thinkpad-p50s/fluxbox.keys ~/.fluxbox/keys -# Reference: -# ltb-018:~/.fluxbox/keys -# Improve: -# Documentation: -# last modified: 2023-12-12-3 18:25 - -# click on the desktop to get menus -OnDesktop Mouse1 :HideMenus -OnDesktop Mouse2 :WorkspaceMenu -OnDesktop Mouse3 :RootMenu - -Ctrl Shift Escape :RootMenu - -# scroll on the desktop to change workspaces -OnDesktop Mouse4 :PrevWorkspace -OnDesktop Mouse5 :NextWorkspace - -# scroll on the toolbar to change current window -# disabling these allows the alsa icon to work -#OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no) -#OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no) - -# alt + left/right click to move/resize a window -#OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving} -OnWindow Mod1 Mouse1 :If {And {Matches (Fullscreen!=yes)} {Matches (@_NET_WM_STATE!=.*_FULLSCREEN.*)} } {MacroCmd {Raise} {Focus} {StartMoving}} -OnWindowBorder Move1 :StartMoving - -#OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner} -OnWindow Mod1 Mouse3 :If {And {Matches (Fullscreen!=yes)} {Matches (@_NET_WM_STATE!=.*_FULLSCREEN.*)} } {MacroCmd {Raise} {Focus} {StartResizing NearestCorner}} -OnLeftGrip Move1 :StartResizing bottomleft -OnRightGrip Move1 :StartResizing bottomright - -# alt + middle click to lower the window -OnWindow Mod1 Mouse2 :Lower - -# control-click a window's titlebar and drag to attach windows -OnTitlebar Ctrl Mouse1 :StartTabbing - -# double click on the titlebar to maximize instead of shade -OnTitlebar Double Mouse1 :Maximize - -# left click on the titlebar to move the window -OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab} -OnTitlebar Move1 :StartMoving - -# middle click on the titlebar to lower -#OnTitlebar Mouse2 :Lower - -# right click on the titlebar for a menu of options -OnTitlebar Mouse3 :WindowMenu - -# alt-tab -# handled by application alttab from startup -#Mod1 Tab :NextWindow {groups} (workspace=[current]) -#Mod1 Shift Tab :PrevWindow {groups} (workspace=[current]) - -# cycle through tabs in the current window -Mod4 Tab :NextTab -Mod4 Shift Tab :PrevTab - -# go to a specific tab in the current window -Mod4 1 :Tab 1 -Mod4 2 :Tab 2 -Mod4 3 :Tab 3 -Mod4 4 :Tab 4 -Mod4 5 :Tab 5 -Mod4 6 :Tab 6 -Mod4 7 :Tab 7 -Mod4 8 :Tab 8 -Mod4 9 :Tab 9 - -# open a terminal -Mod1 F1 :Exec x-terminal-emulator -Mod1 Shift F1 :Exec xterm - -# open a dialog to run programs -Mod1 F2 :Exec fbrun - -# volume settings, using common keycodes -# if these don't work, use xev to find out your real keycodes -# alsa only, volume control -#123 :Exec amixer sset Master,0 1+ -#122 :Exec amixer sset Master,0 1- -#121 :Exec amixer sset Master,0 toggle -# pulseaudio, volume control -121 :Exec pulsemixer-notification toggle -122 :Exec pulsemixer-notification down -123 :Exec pulsemixer-notification up -# alsa or pulseaudio, mute mic, on Thinkpad P50s -# use Fn+F10 magnifying glass because Fn+F4 mic-mute is blocked by firmware? -225 :Exec amixer sset Capture,0 toggle - -# screen brightness for Thinkpad P50s -232 :Exec /usr/bin/hwset-thinkpad-p50s bright down 85 -233 :Exec /usr/bin/hwset-thinkpad-p50s bright up 85 -Ctrl 232 :Exec /usr/bin/hwset-thinkpad-p50s bright set min -Ctrl 233 :Exec /usr/bin/hwset-thinkpad-p50s bright set max -Ctrl 235 :Exec /usr/bin/hwset-thinkpad-p50s bright set safe - -# current window commands -Mod1 F4 :Close -Mod1 F5 :Kill -Mod1 F9 :Minimize -Mod1 F10 :Maximize -Mod1 F11 :Fullscreen - -# open the window menu -Mod1 space :WindowMenu - -# disabled because this is dangerous -# exit fluxbox -#Ctrl Mod1 Delete :Exit - -# change to previous/next workspace -Ctrl Mod1 Left :PrevWorkspace -Ctrl Mod1 Right :NextWorkspace - -# send the current window to previous/next workspace -#Mod4 Left :SendToPrevWorkspace -#Mod4 Right :SendToNextWorkspace - -# send the current window and follow it to previous/next workspace -#Ctrl Mod4 Left :TakeToPrevWorkspace -#Ctrl Mod4 Right :TakeToNextWorkspace - -# clipboard manager menu -Ctrl Shift z :ExecCommand copyq menu - -# bgstack15 custom -# adapted from https://abchk1234.wordpress.com/2015/02/01/native-window-snapping-window-tiling-with-fluxbox-openbox-and-xfwm4-xfce/ -# Up 111 -# Left 113 Right 114 -# Down 116 -Mod4 111 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up} -Mod4 113 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left} -Mod4 114 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right} -Mod4 116 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom} - -Mod4 Mod1 111 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 00% Up} -Mod4 Mod1 113 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 00% Up} -Mod4 Mod1 114 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 50% Up} -Mod4 Mod1 116 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 50% Up} -Mod4 Return :ToggleCmd {Maximize} {Restore} - -# move to next monitor -#Mod4 Shift 113 :ExecCommand move-to-next-monitor --reverse -#Mod4 Shift 114 :ExecCommand move-to-next-monitor -Mod4 Shift 113 :MacroCmd {SendToPrevHead} -Mod4 Shift 114 :MacroCmd {SendToNextHead} - -107 :Exec scrot -z -e 'mv $f ~/Pictures' -Mod1 107 :Exec scrot -ubz -e 'mv $f ~/Pictures' -Ctrl 107 :Exec sleep 0.08 ; scrot -s -f -l 'style=dash,width=1' -z -e 'mv $f ~/Pictures' -Mod4 Ctrl V :Exec veracrypt -Mod4 Ctrl C :Exec FreeFileSync -Mod4 D :ShowDesktop -Mod4 E :Exec xfe -Mod4 L :Exec xscreensaver-command -lock -Mod4 O :Exec scite -Mod4 R :Exec fbrun -Mod4 Shift C :Exec x-terminal-emulator -# librewolf used to use apulse -Mod4 Shift F :Exec librewolf -#Mod4 Shift F :Exec newmoon -Mod4 Shift G :Exec firefox -Mod4 Shift H :Exec waterfox -Mod4 Shift I :Exec irfanview -Mod4 Shift L :Exec keepass2 -Mod4 Shift V :Exec vlc -Mod4 Shift W :Exec libreoffice --writer -Mod4 Shift X :Exec libreoffice --calc - -Ctrl Mod4 R :Reconfigure -Ctrl Shift Mod4 R :Restart - -#Ctrl Shift Mod4 X :Exec bin/move-to-end-of-taskbar.sh -Ctrl Shift Mod4 X :Exec xdotool getactivewindow windowunmap windowmap - -# Numlock on -# 16 17 18 -# 13 14 15 -# 10 11 12 -Mod4 Mod1 87 :MacroCmd {ResizeTo 33% 33%} {MoveTo 00% 67% Up} -Mod4 Mod1 88 :MacroCmd {ResizeTo 34% 33%} {MoveTo 33% 67% Up} -Mod4 Mod1 89 :MacroCmd {ResizeTo 33% 33%} {MoveTo 67% 67% Up} -Mod4 Mod1 83 :MacroCmd {ResizeTo 33% 34%} {MoveTo 00% 33% Up} -Mod4 Mod1 84 :MacroCmd {ResizeTo 34% 34%} {MoveTo 33% 33% Up} -Mod4 Mod1 85 :MacroCmd {ResizeTo 33% 34%} {MoveTo 67% 33% Up} -Mod4 Mod1 79 :MacroCmd {ResizeTo 33% 33%} {MoveTo 00% 00% Up} -Mod4 Mod1 80 :MacroCmd {ResizeTo 34% 33%} {MoveTo 33% 00% Up} -Mod4 Mod1 81 :MacroCmd {ResizeTo 33% 33%} {MoveTo 67% 00% Up} diff --git a/src/etc/stackrpms-thinkpad-p50s/fluxbox.startup b/src/etc/stackrpms-thinkpad-p50s/fluxbox.startup deleted file mode 100644 index ca38336..0000000 --- a/src/etc/stackrpms-thinkpad-p50s/fluxbox.startup +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# File: /etc/stackrpms-thinkpad-p50s/fluxbox.startup -# Location: stackrpms-thinkpad-p50s package -# Author: bgstack15 -# Startdate: 2019-12-26 -# SPDX-License-Identifier: GPL-3.0 -# Title: Common fluxbox startup file for Thinkpad P50s platform -# Package: stackrpms-thinkpad-p50s -# Purpose: standardize fluxbox config across systems -# History: -# 2019-12-26 started on ltb-018 from fluxbox startup example -# 2022-11-03 adapted for this package -# 2023-12-12 revised to be consistent across bgconf and stackrpms-thinkpad-p50s -# Usage: -# symlink your ~/.fluxbox/startup to this file with: -# ln -sf /etc/stackrpms-thinkpad-p50s/fluxbox.startup ~/.fluxbox/startup -# Reference: -# ltb-018:~/.fluxbox/startup -# Improve: -# Documentation: -# last modified: 2022-11-03-5 14:28 - -# Change your keymap: -test -f /etc/stackrpms-thinkpad-p50s/Xmodmap && xmodmap /etc/stackrpms-thinkpad-p50s/Xmodmap -test -f .Xmodmap && xmodmap ".Xmodmap" - -echo "${PATH}" | grep -q "${HOME}/bin" 1>/dev/null 2>&1 && export PATH="${HOME}/bin:${PATH}" - -# for vlc on hidpi screens -export QT_AUTO_SCREEN_SCALE_FACTOR=0 -export QT_SCREEN_SCALE_FACTORS=1 - -# Applications you want to run with fluxbox. -which fbautostart > /dev/null -if [ $? -eq 0 ]; then - fbautostart -fi - -# for desktop icons. Because I use xfe for a file manager, spacefm would only be installed for xdg desktop icons -spacefm --desktop & - -start-pulseaudio-x11 & -volumeicon & -copyq & -xscreensaver -nosplash & -# This might be redundant if /usr/share/services/com.example.Notifications.service but will not hurt. -/usr/lib/notification-daemon/notification-daemon & -telegram-desktop & -alttab -w 1 -s 1 -theme Numix-Circle & -# It is expected to only use one of: cbatticon powerkit -cbatticon -i symbolic & -DESKTOP_SESSION=gnome powerkit & -sudo mount -a & -# Obviously should not be installed on physical systems -spice-vdagent 1>/dev/null 2>&1 & -# Fallback: -#xdgmenumaker -f fluxbox -i > ~/.fluxbox/xdg-menu & -xdgmenumaker-user fluxbox & -keyboard-leds-trayicons & -xscreensaver-watch & -logout-manager-trayicon & -# probably only one of these will be used: -wicd-client -t & -connman-gtk & -myautomountd & -myautomount-trayicon & -netmounts-trayicon & -# vpn-trayicon is only useful on demand. -#vpn-trayicon & -# If fbxkb is installed, set up us(qwerty) and us(dvorak) -which fbxkb 1>/dev/null 2>&1 && test -f /etc/use-fbxkb && { - setxkbmap -option grp:switch,grp:shifts_toggle 'us,us(dvorak)' & - fbxkb & -} -KRB5_AUTH_DIALOG_DEBUG="no-persistence,no-app-menu,no-header-bar" gtk3-nocsd krb5-auth-dialog & -/usr/bin/printf "" | sudo tee /var/lib/dbus/machine-id 1>/dev/null 2>&1 & - -# set wallpaper -# use by symlinking /etc/wallpaper to whatever you want -fbsetbg -a /etc/wallpaper - -# Mask weird button presses 8, 9 on scroll-up, scroll-down -xinput set-button-map "$( xinput | awk -F'[=]' '/ouse/{print $2}' | awk '{print $1}' | head -n1 )" 1 2 3 4 5 6 7 0 0 & - -# Make this extensible so I do not have to customize ~/.fluxbox/startup on each system -test -f "${HOME}/.fluxbox/startup-local" && . "${HOME}/.fluxbox/startup-local" & - -# And last but not least we start fluxbox. -# Because it is the last app you have to run it with ''exec'' before it. -exec fluxbox -# or if you want to keep a log: -# exec fluxbox -log ~/fluxbox/log diff --git a/src/usr/bin/hwset-acer-chromebook b/src/usr/bin/hwset-acer-chromebook new file mode 100755 index 0000000..0547aa0 --- /dev/null +++ b/src/usr/bin/hwset-acer-chromebook @@ -0,0 +1,380 @@ +#!/bin/sh +# File: /usr/bin/hwset-thinkpad-p50s +# Location: stackrpms-thinkpad-p50s package +# Author: bgstack15 +# SPDX-License-Identifier: GPL-3.0 +# Startdate: 2017-11-10 19:41:58 +# Title: Script that Adjusts Hardware Settings +# Package: stackrpms-thinkpad-p50s +# Purpose: Provide programmatic ways to adjust screen brightness, volume, etc. +# History: +# 2018-12-10 change directory +# 2019-12-26 adapted for Thinkpad P50s and add bright_set max/min/safe +# 2022-11-03 adapted for package +# 2024-04-29 adapted for Acer Chromebook C720 +# Usage: +# configure your display manager to react to key combinations, like vol-up to execute: hwset vol up +# Reference: ftemplate.sh 2017-11-10a; framework.sh 2017-11-10a +# Improve: +# Provide better 'screen 0' detection. Right now it is hard-coded to use display LVDS. +# Dependencies: +# dep-devuan: bgscripts-core +fiversion="2017-11-10a" +hwsetversion="2024-04-29a" # for Acer Chromebook C720 + +usage() { + less -F >&2 </dev/null )" + local current_level="$( mixer vol | awk '{print $NF}' )" + + debuglev 3 && ferror "saved: ${saved_level}\tcurrent: ${current_level}" + + # logic: if current level is other than "0:0", save current level and set to 0 + # logic: if current level is "0:0", set to saved level. + if echo "${current_level}" | grep -qE "^0:0$"; + then + # the current level is zero + if test -z "${saved_level}" || echo "${saved_level}" | grep -qvE "[0-9]+:[0-9]+"; + then + # nothing to revert to, so set to a basic level + mixer vol 70 + else + mixer vol "${saved_level}" + fi + else + # current level is not zero + echo "VOL_REGULAR_LEVEL=${current_level}" > "${HWSET_SND_TEMP_FILE}" + mixer vol "0:0" + fi +} + +bright_get() { + #local this_screen="$( xrandr --listactivemonitors | tail -n +2 | grep LVDS | awk '{print $NF}' )" + #xrandr --verbose --screen 0 | grep Brightness | awk '{print $NF}' + cat /sys/class/backlight/intel_backlight/brightness +} + +bright_safe() { + # call: new_brightness="$( bright_safe "${new_brightness}" )" + # this function makes sure the new brightness is not lower than the min and not higher than the max + local requested_brightness="${1}" + local output="$( echo "${requested_brightness}" | grep -oE '^-?[0-9]+(\.[0-9]{0,3})?$' )" + if test -n "${output}"; + then + # so it is a proper decimal number for a brightness value + local lt_min="$( printf '%f<%f\n' "${requested_brightness}" "${HWSET_BRIGHTNESS_MIN}" | bc )" + local gt_max="$( printf '%f>%f\n' "${requested_brightness}" "${HWSET_BRIGHTNESS_MAX}" | bc )" + test "${gt_max}" = "1" && output="${HWSET_BRIGHTNESS_MAX}" + test "${lt_min}" = "1" && output="${HWSET_BRIGHTNESS_MIN}" + #echo "lt=${lt} gt=${gt}" + echo "${output%%.*}" + else + # invalid input, so provide a safe number + echo "${HWSET_BRIGHTNESS_MAX:850}" + fi +} + +bright_up() { + # call: bright_up "${HWSET_BRIGHTNESS_INCREASE_SIZE}" + local current_brightness="$( bright_get )" + local increment="${1}" + local new_brightness="$( printf '%0.2f' "$( printf 'scale=3;%0.2f+%0.2f\n' "${current_brightness}" "${increment}" | bc )" )" + new_brightness="$( bright_safe "${new_brightness}" )" + debuglev 1 && ferror "current brightness:\"${current_brightness}\" new:\"${new_brightness}\"" + printf "${new_brightness}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null + #xrandr --output LVDS1 --brightness "${new_brightness}" +} + +bright_down() { + # call: bright_down "${HWSET_BRIGHTNESS_INCREASE_SIZE}" + local current_brightness="$( bright_get )" + local increment="${1}" + local new_brightness="$( printf '%0.2f' "$( printf 'scale=3;%0.2f-%0.2f\n' "${current_brightness}" "${increment}" | bc )" )" + new_brightness="$( bright_safe "${new_brightness}" )" + debuglev 1 && ferror "current brightness:\"${current_brightness}\" new:\"${new_brightness}\"" + printf "${new_brightness}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null + #xrandr --output LVDS1 --brightness "${new_brightness}" +} + +bright_set() { + # call: bright_set "${value}" + local value="${1}" + #xrandr --output LVDS1 --brightness "${value}" + local value_evaluated="$( echo "${value}" | tr '[a-z]' '[A-Z]' )" + case "${value_evaluated}" in + MAX*) test -n "${HWSET_BRIGHTNESS_MAX}" && value="${HWSET_BRIGHTNESS_MAX}" ;; + MIN*) test -n "${HWSET_BRIGHTNESS_MIN}" && value="${HWSET_BRIGHTNESS_MIN}" ;; + SAFE) test -n "${HWSET_BRIGHTNESS_SAFE}" && value="${HWSET_BRIGHTNESS_SAFE}" ;; + esac + debuglev 2 && ferror "setting to ${value}" + printf "${value}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null +} + +# DEFINE TRAPS + +clean_hwset() { + # use at end of entire script if you need to clean up tmpfiles + #rm -f ${tmpfile} 1>/dev/null 2>&1 + : +} + +CTRLC() { + # use with: trap "CTRLC" 2 + # useful for controlling the ctrl+c keystroke + : +} + +CTRLZ() { + # use with: trap "CTRLZ" 18 + # useful for controlling the ctrl+z keystroke + : +} + +parseFlag() { + flag="$1" + hasval=0 + case ${flag} in + # INSERT FLAGS HERE + "d" | "debug" | "DEBUG" | "dd" ) setdebug; ferror "debug level ${debug}";; + "u" | "usage" | "help" | "h" ) usage; exit 1;; + "V" | "fcheck" | "version" ) ferror "${scriptfile} version ${hwsetversion}"; exit 1;; + #"i" | "infile" | "inputfile" ) getval; infile1=${tempval};; + "c" | "conf" | "conffile" | "config" ) getval; conffile="${tempval}";; + esac + + debuglev 10 && { test ${hasval} -eq 1 && ferror "flag: ${flag} = ${tempval}" || ferror "flag: ${flag}"; } +} + +# DETERMINE LOCATION OF FRAMEWORK +while read flocation; do if test -e ${flocation} && test "$( sh ${flocation} --fcheck 2>/dev/null )" -ge 20170608; then frameworkscript="${flocation}"; break; fi; done <&2 && exit 4 + +# INITIALIZE VARIABLES +# variables set in framework: +# today server thistty scriptdir scriptfile scripttrim +# is_cronjob stdin_piped stdout_piped stderr_piped sendsh sendopts +. ${frameworkscript} || echo "$0: framework did not run properly. Continuing..." 1>&2 +infile1= +outfile1= +logfile=${scriptdir}/${scripttrim}.${today}.out +define_if_new interestedparties "bgstack15@gmail.com" +# SIMPLECONF +define_if_new default_conffile "/etc/hwset.conf" +define_if_new defuser_conffile ~/.config/hwset/hwset.conf + +# REACT TO OPERATING SYSTEM TYPE +case $( uname -s ) in + Linux) [ ];; + *) echo "${scriptfile}: 3. Indeterminate or unsupported OS: $( uname -s )" 1>&2 && exit 3;; +esac + +## REACT TO ROOT STATUS +#case ${is_root} in +# 1) # proper root +# [ ] ;; +# sudo) # sudo to root +# [ ] ;; +# "") # not root at all +# #ferror "${scriptfile}: 5. Please run as root or sudo. Aborted." +# #exit 5 +# [ ] +# ;; +#esac + +# SET CUSTOM SCRIPT AND VALUES +#setval 1 sendsh sendopts<&2 +} + +# make temp files +if test -n "${HWSET_SND_TEMP_FILE}" +then + tempdir="$( dirname "${HWSET_SND_TEMP_FILE}" )" + mkdir -p "${tempdir}" && touch "${HWSET_SND_TEMP_FILE}" +fi + +# MAIN LOOP +#{ + debuglev 2 && ferror "piece:\"${piece}\" action:\"${action}\" value:\"${value}\"" + case "${piece}" in + vol|volume) + case "${action}" in + up|down|mute) + debuglev 1 && ferror vol_${action} "${value:-$HWSET_SND_INCREMENT}" + vol_${action} "${value:-$HWSET_SND_INCREMENT}" + ;; + set) + if test -z "${value}"; + then + # you ran hwset vol set, without a value + # do nothing, silently + debuglev 1 && ferror "Cannot set vol to \"\". Skipped." + else + debuglev 1 && ferror vol_${action} "${value}" + vol_${action} "${value}" + fi + ;; + *) + ferror "${scripttrim}: piece ${piece} was given unknown action ${action}. Aborted." + exit 2 + ;; + esac + ;; + bright|brightness) + case "${action}" in + up|down) + debuglev 1 && ferror bright_${action} "${value:-${HWSET_BRIGHTNESS_INCREMENT}}" + bright_${action} "${value:-${HWSET_BRIGHTNESS_INCREMENT}}" + ;; + set) + if test -z "${value}"; + then + # you ran hwset bright set, without a value + # do nothing, silently + debuglev 1 && ferror "Cannot set brightness to \"\". Skipped." + else + debuglev 1 && ferror bright_${action} "${value}" + bright_${action} "${value}" + fi + ;; + *) + ferror "${scripttrim}: piece ${piece} was given unknown action ${action}. Aborted." + ;; + esac + ;; + *) + ferror "${scripttrim}: Unknown piece ${piece}. Aborted." + exit 2 + ;; + esac +#} | tee -a ${logfile} + +# EMAIL LOGFILE +#${sendsh} ${sendopts} "${server} ${scriptfile} out" ${logfile} ${interestedparties} + +## STOP THE READ CONFIG FILE +#exit 0 +#fi; done; } diff --git a/src/usr/bin/hwset-thinkpad-p50s b/src/usr/bin/hwset-thinkpad-p50s deleted file mode 100755 index 12e7c14..0000000 --- a/src/usr/bin/hwset-thinkpad-p50s +++ /dev/null @@ -1,379 +0,0 @@ -#!/bin/sh -# File: /usr/bin/hwset-thinkpad-p50s -# Location: stackrpms-thinkpad-p50s package -# Author: bgstack15 -# SPDX-License-Identifier: GPL-3.0 -# Startdate: 2017-11-10 19:41:58 -# Title: Script that Adjusts Hardware Settings -# Package: stackrpms-thinkpad-p50s -# Purpose: Provide programmatic ways to adjust screen brightness, volume, etc. -# History: -# 2018-12-10 change directory -# 2019-12-26 adapted for Thinkpad P50s and add bright_set max/min/safe -# 2022-11-03 adapted for package -# Usage: -# configure your display manager to react to key combinations, like vol-up to execute: hwset vol up -# Reference: ftemplate.sh 2017-11-10a; framework.sh 2017-11-10a -# Improve: -# Provide better 'screen 0' detection. Right now it is hard-coded to use display LVDS. -# Dependencies: -# dep-devuan: bgscripts-core -fiversion="2017-11-10a" -hwsetversion="2022-11-03a" # for Thinkpad P50s - -usage() { - less -F >&2 </dev/null )" - local current_level="$( mixer vol | awk '{print $NF}' )" - - debuglev 3 && ferror "saved: ${saved_level}\tcurrent: ${current_level}" - - # logic: if current level is other than "0:0", save current level and set to 0 - # logic: if current level is "0:0", set to saved level. - if echo "${current_level}" | grep -qE "^0:0$"; - then - # the current level is zero - if test -z "${saved_level}" || echo "${saved_level}" | grep -qvE "[0-9]+:[0-9]+"; - then - # nothing to revert to, so set to a basic level - mixer vol 70 - else - mixer vol "${saved_level}" - fi - else - # current level is not zero - echo "VOL_REGULAR_LEVEL=${current_level}" > "${HWSET_SND_TEMP_FILE}" - mixer vol "0:0" - fi -} - -bright_get() { - #local this_screen="$( xrandr --listactivemonitors | tail -n +2 | grep LVDS | awk '{print $NF}' )" - #xrandr --verbose --screen 0 | grep Brightness | awk '{print $NF}' - cat /sys/class/backlight/intel_backlight/brightness -} - -bright_safe() { - # call: new_brightness="$( bright_safe "${new_brightness}" )" - # this function makes sure the new brightness is not lower than the min and not higher than the max - local requested_brightness="${1}" - local output="$( echo "${requested_brightness}" | grep -oE '^-?[0-9]+(\.[0-9]{0,3})?$' )" - if test -n "${output}"; - then - # so it is a proper decimal number for a brightness value - local lt_min="$( printf '%f<%f\n' "${requested_brightness}" "${HWSET_BRIGHTNESS_MIN}" | bc )" - local gt_max="$( printf '%f>%f\n' "${requested_brightness}" "${HWSET_BRIGHTNESS_MAX}" | bc )" - test "${gt_max}" = "1" && output="${HWSET_BRIGHTNESS_MAX}" - test "${lt_min}" = "1" && output="${HWSET_BRIGHTNESS_MIN}" - #echo "lt=${lt} gt=${gt}" - echo "${output%%.*}" - else - # invalid input, so provide a safe number - echo "${HWSET_BRIGHTNESS_MAX:850}" - fi -} - -bright_up() { - # call: bright_up "${HWSET_BRIGHTNESS_INCREASE_SIZE}" - local current_brightness="$( bright_get )" - local increment="${1}" - local new_brightness="$( printf '%0.2f' "$( printf 'scale=3;%0.2f+%0.2f\n' "${current_brightness}" "${increment}" | bc )" )" - new_brightness="$( bright_safe "${new_brightness}" )" - debuglev 1 && ferror "current brightness:\"${current_brightness}\" new:\"${new_brightness}\"" - printf "${new_brightness}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null - #xrandr --output LVDS1 --brightness "${new_brightness}" -} - -bright_down() { - # call: bright_down "${HWSET_BRIGHTNESS_INCREASE_SIZE}" - local current_brightness="$( bright_get )" - local increment="${1}" - local new_brightness="$( printf '%0.2f' "$( printf 'scale=3;%0.2f-%0.2f\n' "${current_brightness}" "${increment}" | bc )" )" - new_brightness="$( bright_safe "${new_brightness}" )" - debuglev 1 && ferror "current brightness:\"${current_brightness}\" new:\"${new_brightness}\"" - printf "${new_brightness}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null - #xrandr --output LVDS1 --brightness "${new_brightness}" -} - -bright_set() { - # call: bright_set "${value}" - local value="${1}" - #xrandr --output LVDS1 --brightness "${value}" - local value_evaluated="$( echo "${value}" | tr '[a-z]' '[A-Z]' )" - case "${value_evaluated}" in - MAX*) test -n "${HWSET_BRIGHTNESS_MAX}" && value="${HWSET_BRIGHTNESS_MAX}" ;; - MIN*) test -n "${HWSET_BRIGHTNESS_MIN}" && value="${HWSET_BRIGHTNESS_MIN}" ;; - SAFE) test -n "${HWSET_BRIGHTNESS_SAFE}" && value="${HWSET_BRIGHTNESS_SAFE}" ;; - esac - debuglev 2 && ferror "setting to ${value}" - printf "${value}" | sudo tee /sys/class/backlight/intel_backlight/brightness 1>/dev/null -} - -# DEFINE TRAPS - -clean_hwset() { - # use at end of entire script if you need to clean up tmpfiles - #rm -f ${tmpfile} 1>/dev/null 2>&1 - : -} - -CTRLC() { - # use with: trap "CTRLC" 2 - # useful for controlling the ctrl+c keystroke - : -} - -CTRLZ() { - # use with: trap "CTRLZ" 18 - # useful for controlling the ctrl+z keystroke - : -} - -parseFlag() { - flag="$1" - hasval=0 - case ${flag} in - # INSERT FLAGS HERE - "d" | "debug" | "DEBUG" | "dd" ) setdebug; ferror "debug level ${debug}";; - "u" | "usage" | "help" | "h" ) usage; exit 1;; - "V" | "fcheck" | "version" ) ferror "${scriptfile} version ${hwsetversion}"; exit 1;; - #"i" | "infile" | "inputfile" ) getval; infile1=${tempval};; - "c" | "conf" | "conffile" | "config" ) getval; conffile="${tempval}";; - esac - - debuglev 10 && { test ${hasval} -eq 1 && ferror "flag: ${flag} = ${tempval}" || ferror "flag: ${flag}"; } -} - -# DETERMINE LOCATION OF FRAMEWORK -while read flocation; do if test -e ${flocation} && test "$( sh ${flocation} --fcheck 2>/dev/null )" -ge 20170608; then frameworkscript="${flocation}"; break; fi; done <&2 && exit 4 - -# INITIALIZE VARIABLES -# variables set in framework: -# today server thistty scriptdir scriptfile scripttrim -# is_cronjob stdin_piped stdout_piped stderr_piped sendsh sendopts -. ${frameworkscript} || echo "$0: framework did not run properly. Continuing..." 1>&2 -infile1= -outfile1= -logfile=${scriptdir}/${scripttrim}.${today}.out -define_if_new interestedparties "bgstack15@gmail.com" -# SIMPLECONF -define_if_new default_conffile "/etc/hwset.conf" -define_if_new defuser_conffile ~/.config/hwset/hwset.conf - -# REACT TO OPERATING SYSTEM TYPE -case $( uname -s ) in - Linux) [ ];; - *) echo "${scriptfile}: 3. Indeterminate or unsupported OS: $( uname -s )" 1>&2 && exit 3;; -esac - -## REACT TO ROOT STATUS -#case ${is_root} in -# 1) # proper root -# [ ] ;; -# sudo) # sudo to root -# [ ] ;; -# "") # not root at all -# #ferror "${scriptfile}: 5. Please run as root or sudo. Aborted." -# #exit 5 -# [ ] -# ;; -#esac - -# SET CUSTOM SCRIPT AND VALUES -#setval 1 sendsh sendopts<&2 -} - -# make temp files -if test -n "${HWSET_SND_TEMP_FILE}" -then - tempdir="$( dirname "${HWSET_SND_TEMP_FILE}" )" - mkdir -p "${tempdir}" && touch "${HWSET_SND_TEMP_FILE}" -fi - -# MAIN LOOP -#{ - debuglev 2 && ferror "piece:\"${piece}\" action:\"${action}\" value:\"${value}\"" - case "${piece}" in - vol|volume) - case "${action}" in - up|down|mute) - debuglev 1 && ferror vol_${action} "${value:-$HWSET_SND_INCREMENT}" - vol_${action} "${value:-$HWSET_SND_INCREMENT}" - ;; - set) - if test -z "${value}"; - then - # you ran hwset vol set, without a value - # do nothing, silently - debuglev 1 && ferror "Cannot set vol to \"\". Skipped." - else - debuglev 1 && ferror vol_${action} "${value}" - vol_${action} "${value}" - fi - ;; - *) - ferror "${scripttrim}: piece ${piece} was given unknown action ${action}. Aborted." - exit 2 - ;; - esac - ;; - bright|brightness) - case "${action}" in - up|down) - debuglev 1 && ferror bright_${action} "${value:-${HWSET_BRIGHTNESS_INCREMENT}}" - bright_${action} "${value:-${HWSET_BRIGHTNESS_INCREMENT}}" - ;; - set) - if test -z "${value}"; - then - # you ran hwset bright set, without a value - # do nothing, silently - debuglev 1 && ferror "Cannot set brightness to \"\". Skipped." - else - debuglev 1 && ferror bright_${action} "${value}" - bright_${action} "${value}" - fi - ;; - *) - ferror "${scripttrim}: piece ${piece} was given unknown action ${action}. Aborted." - ;; - esac - ;; - *) - ferror "${scripttrim}: Unknown piece ${piece}. Aborted." - exit 2 - ;; - esac -#} | tee -a ${logfile} - -# EMAIL LOGFILE -#${sendsh} ${sendopts} "${server} ${scriptfile} out" ${logfile} ${interestedparties} - -## STOP THE READ CONFIG FILE -#exit 0 -#fi; done; } diff --git a/src/usr/bin/netmounts-trayicon b/src/usr/bin/netmounts-trayicon index 72bf020..6f0ed59 100755 --- a/src/usr/bin/netmounts-trayicon +++ b/src/usr/bin/netmounts-trayicon @@ -1,11 +1,11 @@ #!/bin/sh # File: /usr/bin/netmounts-trayicon -# Location: stackrpms-thinkpad-p50s package +# Location: stackrpms-acer-chromebook package # Author: bgstack15 # SPDX-License-Identifier: GPL-3.0 # Startdate: 2022-01-07 14:15 # Title: Net mounts Trayicon utility -# Package: stackrpms-thinkpad-p50s +# Package: stackrpms-acer-chromebook # Purpose: Provide easy mount/unmount control for network shares from system tray # History: # 2022-11-03 adapted for package diff --git a/src/usr/bin/vpn-trayicon b/src/usr/bin/vpn-trayicon index ecae2de..e5dee28 100755 --- a/src/usr/bin/vpn-trayicon +++ b/src/usr/bin/vpn-trayicon @@ -1,11 +1,11 @@ #!/bin/sh # File: /usr/bin/vpn-trayicon -# Location: stackrpms-thinkpad-p50s package +# Location: stackrpms-acer-chromebook package # Author: bgstack15 # SPDX-License-Identifier: GPL-3.0 # Startdate: 2021-12-26 21:10 # Title: Vpn Trayicon utility -# Package: stackrpms-thinkpad-p50s +# Package: stackrpms-acer-chromebook # Purpose: Provide easy vpn control from system tray # History: # 2022-11-03 adapted for package diff --git a/src/usr/share/doc/stackrpms-acer-chromebook/README.md b/src/usr/share/doc/stackrpms-acer-chromebook/README.md new file mode 100644 index 0000000..c3b34ee --- /dev/null +++ b/src/usr/share/doc/stackrpms-acer-chromebook/README.md @@ -0,0 +1,54 @@ + + +# Overview +This project, `/mnt/public/Support/Platforms/stackrpms-acer-chromebook/` holds a git repository of my package of useful settings for Acer Chromebook C720 systems, which include: + +* cbb-001 Cute + +Some configurations include: + +* Xmodmap, automatically applied by the provided fluxbox startup file +* Netmounts tray icon +* Vpn tray icon +* hwset customized for Acer Chromebook C720 +* Fluxbox settings available in /etc/stackrpms-acer-chromebook/. You can symlink them with: + + ln -sf /etc/stackrpms-acer-chromebook/fluxbox.keys ~/.fluxbox/keys + ln -sf /etc/stackrpms-acer-chromebook/fluxbox.startup ~/.fluxbox/startup + +# Using +Install this package, and symlink the fluxbox config files as seen above. Optionally, install those in the /etc/skel path for `.fluxbox/`. + +# Success criteria +This project will be considered stable when the following are met: + +* CTRL+ALT+F6/F7 screen brightness up/down buttons work +* CTRL+ALT+F8 audio mute button works +* CTRL+ALT+F9/F10 Volume up/down buttons work +* Power button prompts for action instead of immediately shutting down + +# Building + + cd /mnt/public/Support/Platforms/ ; rm -f stackrpms-acer-chromebook-0.0.1.tar.gz ; tar -zcf stackrpms-acer-chromebook-0.0.1.tar.gz --exclude debian --exclude .git --exclude '.*.swp' stackrpms-acer-chromebook ; cd stackrpms-acer-chromebook/ + debuild -us -uc + +# Reference +This project was forked from stackrpms-thinkpad-p50s v0.0.4 on 2024-04-30. + +# Changelog +2024-04-30 v0.0.1 +* Initial release forked from stackrpms-thinkpad-p50s diff --git a/src/usr/share/doc/stackrpms-thinkpad-p50s/README.md b/src/usr/share/doc/stackrpms-thinkpad-p50s/README.md deleted file mode 100644 index fe9f6a5..0000000 --- a/src/usr/share/doc/stackrpms-thinkpad-p50s/README.md +++ /dev/null @@ -1,61 +0,0 @@ - - -# Overview -This project, `/mnt/public/Support/Platforms/stackrpms-thinkpad-p50s/` holds a git repository of my package of useful settings for Thinkpad P50s systems, which include: - -* ltb-018 Shiny -* ltb-020 Clone -* ltb-021 Copy -* ltb-022 Dupe -* ltb-023 Mundane - -Some configurations include: - -* Xmodmap, automatically applied by the provided fluxbox startup file -* Netmounts tray icon -* Vpn tray icon -* hwset customized for Thinkpad P50s -* Fluxbox settings available in /etc/stackrpms-thinkpad-p50s/. You can symlink them with: - - ln -sf /etc/stackrpms-thinkpad-p50s/fluxbox.keys ~/.fluxbox/keys - ln -sf /etc/stackrpms-thinkpad-p50s/fluxbox.startup ~/.fluxbox/startup - -# Using -Install this package, and symlink the fluxbox config files as seen above. Optionally, install those in the /etc/skel path for `.fluxbox/`. - -# Success criteria -This project will be considered stable when the following are met: - -* F1 Toggle audio mute button works -* F2, F3 Volume up/down buttons work -* F5, F6 Screen brightness up/down buttons work -* F8 toggle wireless network button works -* Calculator button initiates the context menu - -# Building - - cd /mnt/public/Support/Platforms/ ; rm -f stackrpms-thinkpad-p50s-0.0.1.tar.gz ; tar -zcf stackrpms-thinkpad-p50s-0.0.1.tar.gz --exclude debian --exclude .git --exclude '.*.swp' stackrpms-thinkpad-p50s ; cd stackrpms-thinkpad-p50s/ - debuild -us -uc - -# Changelog -2023-08-22 version 0.0.2 update fluxbox keys for Fn+F10 to toggle mic mute because Fn+F4 is blocked/used by something I cannot control. - -2023-09-09 version 0.0.3 use correct amixer command for mic mute - -2023-12-12 version 0.0.4 -* Make fluxbox startup and keys files match bgconf (want#1) -* fluxbox.keys: use pulseaudio now on Devuan (want#2) diff --git a/src/usr/share/man/man1/hwset-thinkpad-p50s.1.txt b/src/usr/share/man/man1/hwset-thinkpad-p50s.1.txt index 78602c1..fc1bbea 100644 --- a/src/usr/share/man/man1/hwset-thinkpad-p50s.1.txt +++ b/src/usr/share/man/man1/hwset-thinkpad-p50s.1.txt @@ -1,13 +1,13 @@ -title hwset-thinkpad-p50s +title hwset-acer-chromebook section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual -date November 2022 +date April 2024 ===== NAME - hwset-thinkpad-p50s - adjust hardware settings like audio volume and screen brightness + hwset-acer-chromebook - adjust hardware settings like audio volume and screen brightness SYNOPSIS - hwset-thinkpad-p50s [PIECE] [ACTION] [VALUE] + hwset-acer-chromebook [PIECE] [ACTION] [VALUE] PIECES vol | bright ACTIONS @@ -16,8 +16,8 @@ VALUES vol: 0-100 bright: 0.0-1.0 | safe | min | max DESCRIPTION - A customized hwset.sh (from bgscripts-core) specifically for Thinkpad P50s platform. Primarily hwset is called from the stackrpms-thinkpad-p50s fluxbox keys file on the Function-F6 type key presses. - The included fluxbox keys file uses amixer to set volume, not hwset. + A customized hwset.sh (from bgscripts-core) specifically for Acer Chromebook platform. Primarily hwset is called from the stackrpms-acer-chromebook fluxbox keys file on the F6 type key presses. + The included fluxbox keys file uses pulsemixer-notification to set volume, not hwset. AUTHOR B. Stack COPYRIGHT diff --git a/src/usr/share/man/man1/netmounts-off.1.txt b/src/usr/share/man/man1/netmounts-off.1.txt index e198013..c4844d0 100644 --- a/src/usr/share/man/man1/netmounts-off.1.txt +++ b/src/usr/share/man/man1/netmounts-off.1.txt @@ -1,6 +1,6 @@ title netmounts-off section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== diff --git a/src/usr/share/man/man1/netmounts-on.1.txt b/src/usr/share/man/man1/netmounts-on.1.txt index 0095f34..9fdb14d 100644 --- a/src/usr/share/man/man1/netmounts-on.1.txt +++ b/src/usr/share/man/man1/netmounts-on.1.txt @@ -1,6 +1,6 @@ title netmounts-on section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== diff --git a/src/usr/share/man/man1/netmounts-trayicon.1.txt b/src/usr/share/man/man1/netmounts-trayicon.1.txt index 0d6ff00..8b8f2a7 100644 --- a/src/usr/share/man/man1/netmounts-trayicon.1.txt +++ b/src/usr/share/man/man1/netmounts-trayicon.1.txt @@ -1,6 +1,6 @@ title netmounts-trayicon section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== diff --git a/src/usr/share/man/man1/vpn-off.1.txt b/src/usr/share/man/man1/vpn-off.1.txt index cb80c8d..149b18e 100644 --- a/src/usr/share/man/man1/vpn-off.1.txt +++ b/src/usr/share/man/man1/vpn-off.1.txt @@ -1,6 +1,6 @@ title vpn-off section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== diff --git a/src/usr/share/man/man1/vpn-on.1.txt b/src/usr/share/man/man1/vpn-on.1.txt index f32ff9a..7604bef 100644 --- a/src/usr/share/man/man1/vpn-on.1.txt +++ b/src/usr/share/man/man1/vpn-on.1.txt @@ -1,6 +1,6 @@ title vpn-on section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== diff --git a/src/usr/share/man/man1/vpn-trayicon.1.txt b/src/usr/share/man/man1/vpn-trayicon.1.txt index 2e59127..bbbb005 100644 --- a/src/usr/share/man/man1/vpn-trayicon.1.txt +++ b/src/usr/share/man/man1/vpn-trayicon.1.txt @@ -1,6 +1,6 @@ title vpn-trayicon section 1 -project stackrpms-thinkpad-p50s +project stackrpms-acer-chromebook volume General Commands Manual date November 2022 ===== -- cgit