mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add unminimize.
This commit is contained in:
@ -12,6 +12,8 @@ import (
|
||||
type Desktop struct {
|
||||
Display string
|
||||
|
||||
Unminimize bool
|
||||
|
||||
ScreenWidth int
|
||||
ScreenHeight int
|
||||
ScreenRate int16
|
||||
@ -23,6 +25,11 @@ func (Desktop) Init(cmd *cobra.Command) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().Bool("desktop.unminimize", true, "automatically unminimize window when it is minimized")
|
||||
if err := viper.BindPFlag("desktop.unminimize", cmd.PersistentFlags().Lookup("desktop.unminimize")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -30,6 +37,8 @@ func (s *Desktop) Set() {
|
||||
// Display is provided by env variable
|
||||
s.Display = os.Getenv("DISPLAY")
|
||||
|
||||
s.Unminimize = viper.GetBool("desktop.unminimize")
|
||||
|
||||
s.ScreenWidth = 1280
|
||||
s.ScreenHeight = 720
|
||||
s.ScreenRate = 30
|
||||
|
@ -45,6 +45,7 @@ func (manager *DesktopManagerCtx) Start() {
|
||||
Str("screen_size", fmt.Sprintf("%dx%d@%d", width, height, rate)).
|
||||
Msgf("setting initial screen size")
|
||||
|
||||
xevent.Unminimize = manager.config.Unminimize
|
||||
go xevent.EventLoop(manager.config.Display)
|
||||
|
||||
// In case it was opened
|
||||
|
Reference in New Issue
Block a user